CVE-2022-39261 in Debian Linux and 3 more products
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...
Affects 4 products from 4 vendors. Facts below cite their sources.
Remotely exploitable over the network, low complexity, no authentication required, no user interaction needed, impact contained to the vulnerable component, full confidentiality impact, no integrity impact, no availability impact.
Affected products and versions
| Vendor | Product | Affected versions |
|---|---|---|
| Debian | Debian Linux | 10.0 11.0 |
| Drupal | Drupal | ≥ 8.0.0, < 9.3.22 ≥ 9.4.0, < 9.4.7 |
| Fedoraproject | Fedora | 35 36 37 |
| Symfony | Twig | ≥ 1.0.0, < 1.44.7 ≥ 2.0.0, < 2.15.3 ≥ 3.0.0, < 3.4.3 |
A product listed here is affected only at the versions shown. Use the free check to test the exact version you run.
Fix and vendor advisory
No official vendor advisory link on record. See the CVE record.
Exploitation
| CISA known-exploited | Not in the CISA KEV catalog |
|---|---|
| Public exploit | Not confirmed |
Official description
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.
Source: NIST NVD / MITRE CVE.
Record details
| CVE ID | CVE-2022-39261 |
|---|---|
| BreachSpider ID | BS-2022-GLOBAL-065537-H |
| CVSS vector | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N |
| Published | 2022-09-28 |
| Last modified | 2024-11-21 |
| Weakness (CWE) | |
| Source | NVD |
Weakness definitions
CWE-22: Path Traversal
Attacker manipulates file path inputs to access files outside the intended directory.
Related attack patterns (CAPEC)
CAPEC-64 Using Slashes and URL Encoding Combined to Bypass Validation Logic via CWE-22
CAPEC-76 Manipulating Web Input to File System Calls via CWE-22
CAPEC-78 Using Escaped Slashes in Alternate Encoding via CWE-22
CAPEC-79 Using Slashes in Alternate Encoding via CWE-22
CAPEC-126 Path Traversal via CWE-22
Mapping is CWE to CAPEC per MITRE CAPEC 3.9.
Analysis AI-written, not human-reviewed
Twig, a template language for PHP, is vulnerable to arbitrary file reading due to improper handling of user input in template names, allowing attackers to access files outside the designated templates directory.
An attacker can exploit this vulnerability by using the `source` or `include` statement with a specially crafted template name that includes a namespace with directory traversal sequences (e.g., `@somewhere/../some.file`). This allows the attacker to read arbitrary files from the server's filesystem.
Questions
What is CVE-2022-39261?
Twig, a template language for PHP, is vulnerable to arbitrary file reading due to improper handling of user input in template names, allowing attackers to access files outside the designated templates directory.
What is the CVSS score for CVE-2022-39261?
CVE-2022-39261 has CVSS 7.5 (High). Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N. EPSS: 3.5%.
Is CVE-2022-39261 actively exploited?
No confirmed active exploitation of CVE-2022-39261 as of 2026-05-30.
How do I remediate CVE-2022-39261?
Priority: HIGH.
What systems are affected by CVE-2022-39261?
CVE-2022-39261 affects Debian Debian Linux; Drupal Drupal; Fedoraproject Fedora; Symfony Twig.
For developers and AI agents
Run this check from your own code or agent
REST API
curl -s https://breachspider.com/api/v1/assets/correlate-cves \
-H "Authorization: Bearer $BREACHSPIDER_API_KEY" \
-H "Content-Type: application/json" \
-d '{"assets":[{"asset_id":"dev-1","vendor":"Debian","product":"Debian Linux","version":"1.0"}]}'
MCP for AI agents
# hosted: add as a connector
https://mcp.breachspider.com/mcp
# local
pipx install breachspider-mcp
Free trial: 14 days, 750 device checks, no card.
Page facts from NVD, MITRE, CISA and vendor advisories, record last modified 2024-11-21.