High severity8.8NVD Advisory· Published May 20, 2026· Updated Jun 2, 2026
CVE-2026-24425
CVE-2026-24425
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.
AI Insight
LLM-synthesized narrative grounded in this CVE's description and references.
Affected packages
Versions sourced from the GitHub Security Advisory.
| Package | Affected versions | Patched versions |
|---|---|---|
twig/twigPackagist | >= 2.16.0, <= 2.16.1 | — |
twig/twigPackagist | >= 3.9.0, < 3.26.0 | 3.26.0 |
Affected products
3Patches
Vulnerability mechanics
References
7- github.com/advisories/GHSA-2q52-x2ff-qgfrghsaADVISORY
- github.com/twigphp/Twig/security/advisories/GHSA-2q52-x2ff-qgfrnvdVendor AdvisoryWEB
- nvd.nist.gov/vuln/detail/CVE-2026-24425ghsaADVISORY
- www.vulncheck.com/advisories/twig-x-x-sandbox-bypass-via-sourcepolicyinterfacenvdThird Party AdvisoryWEB
- github.com/FriendsOfPHP/security-advisories/blob/master/twig/twig/CVE-2026-24425.yamlghsaWEB
- github.com/twigphp/Twig/releases/tag/v3.26.0nvdProductRelease NotesWEB
- symfony.com/cve-2026-24425ghsaWEB
News mentions
0No linked articles in our index yet.