CVE-2019-9942: Twig/twig Twig Sandbox Information Disclosure Vulnerability
LOWCVE-2019-9942 is a LOW (CVSS 3.7) twig sandbox information disclosure vulnerability (CWE-200: Exposure of Sensitive Information to an Unauthorized Actor) affecting Twig/twig libraries in the Packagist ecosystem. The issue involves twig sandbox information disclosure. Remediation is available by upgrading affected packages to version 1.38.0, 2.7.0.
CVE-2019-9942 at a Glance
Security Impact
CVSS: 3.7
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:L/I:N/A:N).
How to Fix CVE-2019-9942
To remediate this vulnerability, upgrade all affected Twig/twig dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
Upgrade twig/twig to 1.38.0
Upgrade twig/twig to 2.7.0
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
inspect dependencies for twig/twig
How to Check if You Are Affected
To determine whether your application is affected by CVE-2019-9942, inspect your project dependencies for Twig/twig:
inspect dependencies for twig/twig
Analyze the terminal output to locate any version of Twig/twig in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 1.38.0), your application is affected.
Note: Verify declared build manifests and deployed runtime container environments.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under CWE-200: Exposure of Sensitive Information to an Unauthorized Actor, where the product exposes sensitive information to an actor that is not explicitly authorized to have access to that information. In Twig/twig, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.
Source Advisory Statement
CVE-2019-9942 Affected Twig/twig Versions
2 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
twig/twig
|
Packagist |
< 1.38.0
|
1.38.0
|
|
twig/twig
|
Packagist |
≥ 2.0.0
< 2.7.0
|
2.7.0
|
References
Frequently Asked Questions
What is CVE-2019-9942?
Which Twig/twig versions are affected?
What version fixes CVE-2019-9942?
Is twig/twig affected?
What is the CVSS score of CVE-2019-9942?
What CWE is associated with CVE-2019-9942?
How can I check Packagist dependencies for CVE-2019-9942?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-vxrc-68xx-x48g",
"modified" : "2023-09-21T19:49:03Z",
"published" : "2022-03-26T00:25:25Z",
"aliases" : [ "CVE-2019-9942" ],
"summary" : "Twig Sandbox Information Disclosure",
"details" : "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.",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:L/I:N/A:N"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "Packagist",
"name" : "twig/twig"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "1.38.0"
} ]
} ]
}, {
"package" : {
"ecosystem" : "Packagist",
"name" : "twig/twig"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "2.0.0"
}, {
"fixed" : "2.7.0"
} ]
} ]
} ],
"references" : [ {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2019-9942"
}, {
"type" : "WEB",
"url" : "https://github.com/twigphp/Twig/commit/eac5422956e1dcca89a3669a03a3ff32f0502077"
}, {
"type" : "WEB",
"url" : "https://github.com/FriendsOfPHP/security-advisories/blob/master/twig/twig/CVE-2019-9942.yaml"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/twigphp/Twig"
}, {
"type" : "WEB",
"url" : "https://seclists.org/bugtraq/2019/Mar/60"
}, {
"type" : "WEB",
"url" : "https://symfony.com/blog/twig-sandbox-information-disclosure"
}, {
"type" : "WEB",
"url" : "https://www.debian.org/security/2019/dsa-4419"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-200" ],
"severity" : "LOW",
"github_reviewed" : true,
"github_reviewed_at" : "2022-03-26T00:25:25Z",
"nvd_published_at" : "2019-03-23T15:29:00Z"
}
}