Advisory Database
  • Advisories
  • Dependency Scanning
  1. composer
  2. ›
  3. drupal/core
  4. ›
  5. CVE-2022-39261

CVE-2022-39261: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')

September 28, 2022 (updated November 7, 2023)

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.

References

  • github.com/twigphp/Twig/commit/35f3035c5deb0041da7b84daf02dea074ddc7a0b
  • github.com/twigphp/Twig/security/advisories/GHSA-52m2-vc4m-jj33
  • nvd.nist.gov/vuln/detail/CVE-2022-39261
  • www.drupal.org/sa-core-2022-016

Code Behaviors & Features

Detect and mitigate CVE-2022-39261 with GitLab Dependency Scanning

Secure your software supply chain by verifying that all open source dependencies used in your projects contain no disclosed vulnerabilities. Learn more about Dependency Scanning →

Affected versions

All versions starting from 8.0.0 before 9.3.22, all versions starting from 9.4.0 before 9.4.7

Fixed versions

  • 9.3.22
  • 9.4.7

Solution

Upgrade to versions 9.3.22, 9.4.7 or above.

Impact 7.5 HIGH

CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N

Learn more about CVSS

Weakness

  • CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')

Source file

packagist/drupal/core/CVE-2022-39261.yml

Spotted a mistake? Edit the file on GitLab.

  • Site Repo
  • About GitLab
  • Terms
  • Privacy Statement
  • Contact

Page generated Wed, 14 May 2025 12:15:18 +0000.