Skip to main content
Network Thinking Solutions Logo

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/.

All CVEs
CVE-2022-39261Published 9/28/2022

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/.

Vendor advisory
CVSS7.5High

Overview

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.

Published
9/28/2022
Last modified
6/17/2026
CVE assigner
Not available
NVD analysis
Not available

Exploitation

No CISA KEV flag in the saved record

An absent KEV flag does not establish that exploitation has never occurred. Verify current intelligence before prioritizing work.

EPSS predictions and CISA SSVC assessments are not imported here. Review additional intelligence on Cloudflare

Affected products

Affected-version rules published in the advisory. Conditions and uncertain comparisons require verification.

Vendor / productAffected versionsPlatform / conditionsEvidence
twig
symfony
≥ 1.0.0, < 1.44.7

Verify advisory

Source
twig
symfony
≥ 2.0.0, < 2.15.3

Verify advisory

Source
twig
symfony
≥ 3.0.0, < 3.4.3

Verify advisory

Source
drupal
drupal
≥ 8.0.0, < 9.3.22

Verify advisory

Source
drupal
drupal
≥ 9.4.0, < 9.4.7

Verify advisory

Source
fedora
fedoraproject
35

Verify advisory

Source
fedora
fedoraproject
36

Verify advisory

Source
fedora
fedoraproject
37

Verify advisory

Source
debian linux
debian
10.0

Verify advisory

Source
debian linux
debian
11.0

Verify advisory

Source
Twig
twigphp
=> 1.0.0, < 1.44.7

Verify advisory

Source
Twig
twigphp
>= 2.0.0, < 2.15.3

Verify advisory

Source
Twig
twigphp
>= 3.0.0, < 3.4.3

Verify advisory

Source

Recommended actions

Verify the product, installed version, platform, and advisory prerequisites on each system. Apply the vendor's applicable fixed release or mitigation. An affected-range boundary alone is not a universal update recommendation.

Vendor advisory links

Derived from non-aggregator references because the source record has no vendor tags. Verify the advisory before acting on it.

Severity

CVSS describes technical impact. It is separate from exploitation evidence.

Published headline score: 7.5. Score version, vector, and attribution are not available in this record. Additional score details appear when the source record is next refreshed.

Sources & references

Sources: Official CVE List, NVD and cve.now (summaries CC BY 4.0). Uses NVD data; not endorsed by NVD.