CVE-2026-24425

NameCVE-2026-24425
DescriptionTwig 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.
SourceCVE (at NVD; CERT, ENISA, LWN, oss-sec, fulldisc, Debian ELTS, Red Hat, Ubuntu, Gentoo, SUSE bugzilla/CVE, GitHub advisories/code/issues, web search, more)
ReferencesDSA-6311-1

Vulnerable and fixed packages

The table below lists information on source packages.

Source PackageReleaseVersionStatus
php-twig (PTS)bullseye2.14.3-1+deb11u2fixed
bullseye (security)2.14.3-1+deb11u4fixed
bookworm, bookworm (security)3.5.1-1+deb12u1fixed
trixie3.20.0-2vulnerable
trixie (security)3.27.0-0+deb13u1fixed
forky3.26.0-1fixed
sid3.27.0-1fixed

The information below is based on the following data on fixed versions.

PackageTypeReleaseFixed VersionUrgencyOriginDebian Bugs
php-twigsourcebullseye(not affected)
php-twigsourcebookworm(not affected)
php-twigsourcetrixie3.27.0-0+deb13u1DSA-6311-1
php-twigsource(unstable)3.26.0-1

Notes

[bookworm] - php-twig <not-affected> (Vulnerable code introduced later)
[bullseye] - php-twig <not-affected> (Vulnerable code introduced later)
https://github.com/twigphp/Twig/security/advisories/GHSA-2q52-x2ff-qgfr
https://symfony.com/blog/cve-2026-24425-possible-sandbox-bypass-when-using-a-source-policy

Search for package or bug name: Reporting problems