CVE-2026-24425
HIGH 8.7CVSS 4.0Twig: Possible sandbox bypass when using a source policy
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.
- Published
- 20 May 2026
- Last modified
- 17 Nov 2026
- Assigned by
- disclosure@vulncheck.com
- NVD status
- Analyzed
- Weakness
- CWE-693
- Also known as
- GHSA-2q52-x2ff-qgfr
- Sources
- NVDJSONOSV GHSA-2q52-x2ff-qgfrJSON
Scores
| Source | Scored by | Version | Score | Vector / decision |
|---|---|---|---|---|
| NVD | disclosure@vulncheck.com (Secondary) | 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 |
| OSV | GitHub | CVSS 4.0 | 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 | |
| NVD | nvd@nist.gov (Primary) | 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 | 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 |
| OSV | GitHub | 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 |
Affected
| Source | Vendor / ecosystem | Product / package | Affected versions | Fixed in |
|---|---|---|---|---|
| NVD | symfony | twigcpe:2.3:a:symfony:twig:*:*:*:*:*:*:*:* |
>= 2.16.0, <= 2.16.1 | |
| NVD | symfony | twigcpe:2.3:a:symfony:twig:*:*:*:*:*:*:*:* |
>= 3.9.0, < 3.26.0 | 3.26.0 |
| OSV | Packagist | twig/twig | >= 2.16.0, <= 2.16.1 | |
| OSV | Packagist | twig/twig | >= 3.9.0, < 3.26.0 | 3.26.0 |
References
- https://github.com/twigphp/Twig/releases/tag/v3.26.0 · Product, Release Notes, WEB
- https://github.com/twigphp/Twig/security/advisories/GHSA-2q52-x2ff-qgfr · Vendor Advisory, WEB
- https://www.vulncheck.com/advisories/twig-x-x-sandbox-bypass-via-sourcepolicyinterface · Third Party Advisory, WEB
- https://nvd.nist.gov/vuln/detail/CVE-2026-24425 · ADVISORY
- https://github.com/FriendsOfPHP/security-advisories/blob/master/twig/twig/CVE-2026-24425.yaml · WEB
- https://github.com/twigphp/Twig · PACKAGE
- https://symfony.com/cve-2026-24425 · WEB
History
- 25 Nov 2026 21:02 UTC · NVD: first stored (published 20 May 2026)
- 25 Nov 2026 20:14 UTC · OSV: first stored (published 5 Jun 2026)