CVE-2019-9942
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.
Attack profile
How easy it is to exploit
- Attack vector
- Network
- Complexity
- High
- Privileges needed
- None
- User interaction
- None
What an attacker can affect
- Confidentiality
- Low
- Integrity
- None
- Availability
- None
Exploit likelihood
What each source reports
NVD Score used
3.7
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.
- Record
CVE-2019-9942- CVSS 3.1
- 3.7 Low
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:L/I:N/A:N - CVSS 2.0
- 4.3 Medium
AV:N/AC:M/Au:N/C:P/I:N/A:N - Updated
- 2026-11-02
CVE List No score
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.
- Record
CVE-2019-9942- Updated
- 2026-11-02
EUVDEUVD-2022-1558 No score
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.
- Record
EUVD-2022-1558- Updated
- 2026-11-03
GitHub AdvisoriesGHSA-vxrc-68xx-x48g
3.7
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.
- Record
GHSA-vxrc-68xx-x48g- CVSS 3.1
- 3.7 Low
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:L/I:N/A:N - Weakness
- CWE-200
- Updated
- 2026-11-02
OSV
3.7
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.
- Record
CVE-2019-9942- CVSS 3.1
- 3.7 Low
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:L/I:N/A:N - Updated
- 2026-11-02
OSVGHSA-vxrc-68xx-x48g
3.7
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.
- Record
GHSA-vxrc-68xx-x48g- CVSS 3.1
- 3.7 Low
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:L/I:N/A:N - Weakness
- CWE-200
- Updated
- 2026-11-02
OSVUBUNTU-CVE-2019-9942
3.7
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.
- Record
UBUNTU-CVE-2019-9942- CVSS 3.1
- 3.7 Low
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:L/I:N/A:N - CVSS 3.0
- 3.7 Low
CVSS:3.0/AV:N/AC:H/PR:N/UI:N/S:U/C:L/I:N/A:N - Updated
- 2026-11-02
OSVUSN-5947-1 No score
php-twig, twig vulnerabilities
Fabien Potencier discovered that Twig was not properly enforcing sandbox policies when dealing with objects automatically cast to strings by PHP. An attacker could possibly use this issue to expose sensitive information. This issue was only fixed in Ubuntu 16.04 ESM and Ubuntu 18.04 ESM. (CVE-2019-9942)
Marlon Starkloff discovered that Twig was not properly enforcing closure constraints in some of its array filtering functions. An attacker could possibly use this issue to execute arbitrary code. This issue was only fixed in Ubuntu 20.04 ESM. (CVE-2022-23614)
Dariusz Tytko discovered that Twig was not properly verifying input data utilized when defining pathnames used to access files in a system. An attacker could possibly use this issue to access unauthorized resources and expose sensitive information. (CVE-2022-39261)
- Record
USN-5947-1- Updated
- 2026-11-02
Affected products
Affected packages
| Package | Affected | Fixed |
|---|---|---|
twig/twigPackagist |
before 1.38.0 | 1.38.0 |
twig/twigPackagist |
2.0.0 up to 2.7.0 | 2.7.0 |
twigDebian:9 |
before 1.24.0-2+deb9u1, plus listed versions 1.24.0-2 |
1.24.0-2+deb9u1 |
twig/twigPackagist |
before 1.38.0, plus listed versions 1.3.01.4.01.5.01.5.11.6.0 Show 45 moreShow less1.6.11.6.21.6.31.6.41.6.5v1.10.0v1.10.1v1.10.2v1.10.3v1.11.0v1.11.1v1.12.0v1.12.0-RC1v1.12.1v1.12.2v1.12.3v1.13.0v1.13.1v1.13.2v1.14.0v1.14.1v1.14.2v1.15.0v1.15.1v1.16.0v1.16.1v1.16.2v1.16.3v1.17.0v1.18.0v1.18.1v1.18.2v1.19.0v1.20.0v1.21.0v1.21.1v1.21.2v1.22.0v1.22.1v1.22.2v1.22.3v1.23.0v1.23.1v1.23.2v1.23.3 |
1.38.0 |
twig/twigPackagist |
2.0.0 up to 2.7.0, plus listed versions v2.0.0v2.1.0v2.2.0v2.3.0v2.3.1 Show 14 moreShow lessv2.3.2v2.4.0v2.4.1v2.4.2v2.4.3v2.4.4v2.4.5v2.4.6v2.4.7v2.4.8v2.5.0v2.6.0v2.6.1v2.6.2 |
2.7.0 |
twigUbuntu:Pro:16.04:LTS |
before 1.23.1-1ubuntu4+esm1, plus listed versions 1.20.0-11.23.1-1ubuntu11.23.1-1ubuntu4 |
1.23.1-1ubuntu4+esm1 |
twigUbuntu:Pro:18.04:LTS |
before 2.4.6-1ubuntu0.1~esm1, plus listed versions 1.24.0-2ubuntu12.4.4-2ubuntu12.4.6-1 |
2.4.6-1ubuntu0.1~esm1 |
twigUbuntu:Pro:16.04:LTS From an advisory covering 3 CVEs |
before 1.23.1-1ubuntu4+esm1, plus listed versions 1.20.0-11.23.1-1ubuntu11.23.1-1ubuntu4 |
1.23.1-1ubuntu4+esm1 |
twigUbuntu:Pro:18.04:LTS From an advisory covering 3 CVEs |
before 2.4.6-1ubuntu0.1~esm1, plus listed versions 1.24.0-2ubuntu12.4.4-2ubuntu12.4.6-1 |
2.4.6-1ubuntu0.1~esm1 |
php-twigUbuntu:Pro:20.04:LTS From an advisory covering 3 CVEs |
before 2.12.5-1ubuntu0.1~esm1, plus listed versions 2.11.3-22.12.1-12.12.2-12.12.3-12.12.5-1 |
2.12.5-1ubuntu0.1~esm1 |
php-twigUbuntu:Pro:22.04:LTS From an advisory covering 3 CVEs |
before 3.3.8-2ubuntu4+esm1, plus listed versions 3.3.2-1ubuntu33.3.4-13.3.6-13.3.7-13.3.8-2ubuntu4 |
3.3.8-2ubuntu4+esm1 |
History
| Recorded | Changed | Sources |
|---|---|---|
| affected, facts | ||
| aliases | EUVD | |
| first indexed | CVE List, GitHub Advisories, NVD, OSV |
Dates are when Every CVE recorded each change. Upstream dates may differ.
In short
CVE-2019-9942 is a low vulnerability (CVSS 3.7) in Symfony Twig, published March 23, 2019. No source lists public exploit code. EPSS puts the chance of exploitation in the next 30 days at 1.41%, the 72nd percentile. Fixed in twig/twig 1.38.0.
References
symfony.com/blog/twig-sandbox-information-disclosure
github.com/twigphp/Twig/commit/eac5422956e1dcca89a3669a03a3ff32f0502077
debian.org/security/2019/dsa-4419
seclists.org/bugtraq/2019/Mar/60
nvd.nist.gov/vuln/detail/CVE-2019-9942
github.com/FriendsOfPHP/security-advisories/blob/master/twig/twig/CVE-2019-9942.yaml
Left out here: 38 versions. The JSON record has them.