Path Traversal in Drupal
CVE-2022-39261
Twig is a template language for PHP. Versions 1.x prior to 1.44.7, 2.x prior to 2.15.3, and 3.x prior to 3.4.3 encounter an issue when the filesystem loader loads templates for which the name is a user input. It is possible to use the `source` or `include` statement to read arbitrary files from outside the templates' directory when using a namespace like `@somewhere/../some.file`. In such a case, validation is bypassed. Versions 1.44.7, 2.15.3, and 3.4.3 contain a fix for validation of such template names. There are no known workarounds aside from upgrading.
Vulnerability class: Path Traversal (Directory Traversal)
Published · last modified .
CVSS v3 metric
CVSS v3 base score 7.5 (High). Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N.
EPSS exploit prediction
EPSS 0.032, 88.2th percentile (scored ); unchanged over 30 days. About EPSS.
Affected products
- Drupal
- Symfony Twig
- Twigphp Twig — versions => 1.0.0, < 1.44.7, >= 2.0.0, < 2.15.3, >= 3.0.0, < 3.4.3
- Debian Linux — versions 10.0, 11.0
- Fedoraproject Fedora — versions 35, 36, 37
Weakness classification (CWE)
Public exploits and proof-of-concept code
Also mentioned in 3 other repositories (ARPSyndicate/cvemon, KatenKyoukotsu/devsecops, typomedia/inspector). These reference the CVE in a list, notes or a scanner and are not exploit code for it.
References
- github.com/twigphp/Twig/security/advisories/GHSA-52m2-vc4m-jj33 (Third Party Advisory)
- github.com/twigphp/Twig/commit/35f3035c5deb0041da7b84daf02dea074ddc7a0b (Patch, Third Party Advisory)
- www.drupal.org/sa-core-2022-016 (Patch, Third Party Advisory)
- DSA-5248 (vendor-advisory, Third Party Advisory)
- FEDORA-2022-4490a4772d (vendor-advisory)
- FEDORA-2022-d39b2a755b (vendor-advisory)
- FEDORA-2022-1695454935 (vendor-advisory)
- FEDORA-2022-9d8ee4a6de (vendor-advisory)
- [debian-lts-announce] 20221011 [SECURITY] [DLA 3147-1] twig security update (mailing-list, Mailing List, Third Party Advisory)
- FEDORA-2022-c6fe3ebd94 (vendor-advisory)