Vulnerability · Published May 20, 2026 · Assigned by VulnCheck
CVE-2026-24425Twig 2.16.x & 3.9.0-3.25.x Sandbox Bypass via SourcePolicyInterface
High 8.8
In plain English
A high-severity security flaw in Twig from twigphp. There are no confirmed reports of exploitation so far. The chance it is exploited in the next 30 days is estimated at 0.8% (higher than 55% of all known vulnerabilities). Fixed versions are available - upgrade the affected package.
Official 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.
Affected packages & fixed versions
| Ecosystem | Package | Fixed in | Advisory |
|---|---|---|---|
| Debian:13 | php-twig | 3.27.0-0+deb13u1 | DEBIAN-CVE-2026-24425 |
| Debian:14 | php-twig | 3.26.0-1 | DEBIAN-CVE-2026-24425 |
| Packagist | twig/twig | no fix listed | GHSA-2q52-x2ff-qgfr |
| Packagist | twig/twig | 3.26.0 | GHSA-2q52-x2ff-qgfr |
| Ubuntu:25.10 | php-twig | no fix listed | UBUNTU-CVE-2026-24425 |
Affected products (as reported)
Weakness: CWE-693 · Vector: CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H