CVE-2026-24425
Twig versions 2.16.x and 3.9.0 through 3.25.x contain a sandbox bypass ...
Severity by source
Trivy's own label is CRITICAL. Rated critical by NVD. Rated lower by GHSA (high), Ubuntu (medium).
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 and fixed versions
| Source | Package | Fixed in |
|---|---|---|
| composer::GitHub Security Advisory Composer | twig/twig | 3.26.0 |
| composer::PHP Security Advisories Database | twig/twig | no fix listed |
| debian 13 | php-twig | 3.27.0-0+deb13u1 |
| debian 14 | php-twig | 3.26.0-1 |
| rapidfort debian 12 | php-twig | 0:3.26.0-1, 0:3.27.0-0+deb13u1 |
| rapidfort debian 13 | php-twig | 0:3.26.0-1, 0:3.27.0-0+deb13u1 |
| rapidfort ubuntu 20.04 | php-twig | 0:3.26.0-1 |
| rapidfort ubuntu 22.04 | php-twig | 0:3.26.0-1 |
| rapidfort ubuntu 24.04 | php-twig | 0:3.26.0-1 |
| ubuntu 26.04 | php-twig | no fix listed |
References
- https://github.com/FriendsOfPHP/security-advisories/blob/master/twig/twig/CVE-2026-24425.yaml
- https://github.com/twigphp/Twig
- https://github.com/twigphp/Twig/releases/tag/v3.26.0
- https://github.com/twigphp/Twig/security/advisories/GHSA-2q52-x2ff-qgfr
- https://nvd.nist.gov/vuln/detail/CVE-2026-24425
- https://symfony.com/blog/cve-2026-24425-possible-sandbox-bypass-when-using-a-source-policy
- https://symfony.com/cve-2026-24425
- https://ubuntu.com/security/notices/USN-8408-1