Path traversal in Twig - CVE-2022-39261

 

Path traversal in Twig - CVE-2022-39261

Published: September 28, 2022


Vulnerability identifier: #VU67723
CSH Severity: Medium
CVSS v4: 8.7 [CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:N/VA:N/SC:N/SI:N/SA:N]
CVE-ID: CVE-2022-39261
CWE-ID: CWE-22
Exploitation vector: Remote access
Exploit availability: No public exploit available

Vulnerability details

The vulnerability allows a remote attacker to perform directory traversal attacks.

The vulnerability exists due to input validation error when processing directory traversal sequences when loading templates. A remote attacker can use the "source" or "include" statement to read arbitrary files on the system.


Affected software

Twig
Drupal
Debian Linux
Ubuntu
Fedora
php-twig (Ubuntu package)
php-twig
php-twig (Debian package)
php-twig2

How to mitigate CVE-2022-39261

Install update from vendor's website.

Twig - addressed in versions 1.44.7, 2.15.3, 3.4.3
Drupal - addressed in versions 9.3.22, 9.4.7
php-twig (Ubuntu package) - update to Ubuntu Pro
php-twig - addressed in versions 1.44.7-1.fc35, 1.44.7-1.fc36, 1.44.7-1.fc37
php-twig (Debian package) - update to 2.14.3-1+deb11u2
php-twig2 - addressed in versions 2.15.3-1.fc35, 2.15.3-1.fc36, 2.15.3-1.fc37

External References

Related Security Bulletins