CVE-2026-24425
Twig 2.16.x & 3.9.0-3.25.x Sandbox Bypass via SourcePolicyInterface
HIGH 8.7
At a glance
- Source
- NVD
- EPSS
- EPSS 0.76 % · percentile 55 ()
- State
- PUBLISHED
- Published
- Updated
- Assigner
- VulnCheck
- NVD status
- Analyzed
Description
Twig versions 2.16.x and 3.9.0 through 3.25.x contain a sandbox bypass vulnerability when using a SourcePolicyInterface that allows attackers with template rendering capabilities to pass arbitrary PHP callables to sort, filter, map, and reduce filters. Attackers can exploit the runtime check that fails to use the current template source to bypass sandbox restrictions and execute arbitrary code when the sandbox is enabled through a source policy rather than globally.
Weaknesses (CWE)
- CWE-693 — Protection Mechanism Failure
References
Scores
| Version | Score | Vector | Scored by |
|---|---|---|---|
| CVSS 4.0 | HIGH 8.7 | CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N | VulnCheck |
| CVSS 3.1 | HIGH 8.8 | CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H | VulnCheck |
| CVSS 4.0 | HIGH 8.7 | CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X | NVD · disclosure@vulncheck.com (Secondary) |
| CVSS 3.1 | HIGH 8.8 | CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H | NVD · disclosure@vulncheck.com (Secondary) |
| CVSS 3.1 | CRITICAL 9.9 | CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:H | NVD · nvd@nist.gov (Primary) |
Advisories
- GHSA-2q52-x2ff-qgfr — Twig: Possible sandbox bypass when using a source policy
European references
- ENISA EUVD · EUVD-2026-31113
- GCVE · GCVE-0-2026-24425
Affected configurations (NVD CPE)
cpe:2.3:a:symfony:twig:*:*:*:*:*:*:*:*≥ 2.16.0 ≤ 2.16.1cpe:2.3:a:symfony:twig:*:*:*:*:*:*:*:*≥ 3.9.0 < 3.26.0
Affected products
| Product | Versions |
|---|---|
| twigphp · Twig | affected 3.9.0 < 3.26.0 ; affected 2.16.* |
Sources
| Source | Licence |
|---|---|
| CVE List (CVEProject cvelistV5) | CVE Program Terms of Use |
| EPSS (FIRST.org) | FIRST — attribution requested |
| ENISA EUVD | ENISA — reproduction authorised, source acknowledged |
| NVD (NIST) via fkie-cad/nvd-json-data-feeds | Public domain — this product uses data from the NVD API but is not endorsed or certified by the NVD |