Twig Sandbox Information Disclosure
A sandbox information disclosure exists in Twig before 1.38.0 and 2.x before 2.7.0 because, under some circumstances, it is possible to call the __toString() method on an object even if not allowed by the security policy in place.
Affected software
Click a technology to see all vulnerabilities affecting it.
| Platform | Package | Vulnerable versions | Fixed in |
|---|---|---|---|
| Composer package | twig/twig | < 1.38.0, >= 2.0.0, < 2.7.0 | 1.38.0, 2.7.0 |
References
- https://nvd.nist.gov/vuln/detail/CVE-2019-9942
- https://github.com/twigphp/Twig/commit/eac5422956e1dcca89a3669a03a3ff32f0502077
- https://github.com/FriendsOfPHP/security-advisories/blob/master/twig/twig/CVE-2019-9942.yaml
- https://github.com/twigphp/Twig
- https://seclists.org/bugtraq/2019/Mar/60
- https://symfony.com/blog/twig-sandbox-information-disclosure
- https://www.debian.org/security/2019/dsa-4419
- CVSS vector
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:L/I:N/A:N- Weakness (CWE)
CWE-200- Platform
- Composer
- Package
twig/twig- Disclosed
- 26.03.2022
- Updated
- 11.10.2026 10:22
Sources and licenses
OSV / GitHub Advisory Database - GHSA-vxrc-68xx-x48g - CC BY 4.0
Vulnerability history: twig/twig
All published vulnerabilities of this package (Composer package), newest first. Shows whether this is a one-off slip or a package that needs watching.
- Total entries
- 24
- First → latest
- 02.2022 07.2026
- Without a fix
- 0
- Exploited in attacks
- 0
Severity breakdown
- Critical 1
- High 8
- Medium 8
- Low 7
Disclosures per year
- 2022: 4
- 2023: 0
- 2024: 4
- 2025: 1
- 2026: 15
-
Twig Sandbox Information Disclosure this entry
Know which vulnerabilities affect your application
With the DockRay integration and software inventory enabled, DockRay checks reported component versions against known vulnerabilities and notifies you about confirmed matches. Coverage depends on the supported technology and available advisory data.