Vulnerability in Symfony Twig
CVE-2026-24425
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 · last modified .
CVSS v3 metric
CVSS v3 base score 8.8 (High). Vector: CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H.
EPSS exploit prediction
EPSS 0.008, 55.8th percentile (scored ); unchanged over 30 days. About EPSS.
Affected products
- Symfony Twig
- Twigphp Twig — versions 3.9.0, 2.16.*
Weakness classification (CWE)
References
- Twig 3.26.0 Release Notes (release-notes, Product, Release Notes)
- GitHub Security Advisory (GHSA-2q52-x2ff-qgfr) (vendor-advisory, Vendor Advisory)
- www.vulncheck.com/advisories/twig-x-x-sandbox-bypass-via-sourcepolicyinterface (Third Party Advisory, third-party-advisory)