CVE-2026-24425
Twig 2.16.x & 3.9.0-3.25.x Sandbox Bypass via SourcePolicyInterface
Reported by vulncheck · Published May 20, 2026
twig/twig is fixed in 3.26.0 and 2.16.1 (Packagist)
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.
Fixed versions
Upgrade to a fixed version or later. Language registries are listed first, then Linux distributions, then vendor products.
| Package | Ecosystem | Fixed in |
|---|---|---|
| twig/twig | Packagist | 3.26.0, 2.16.1 |
| twig | symfony | 3.26.0, 2.16.1 |
| Twig | twigphp | 3.26.0 |
Risk scores
Affected products
| Vendor | Product | Versions |
|---|---|---|
| twigphp | Twig | 3.9.0, 2.16.0 |
| twig | twig | 2.16.0, 3.9.0 |
| twigphp | Twig | 3.9.0, 2.16.0 |
| symfony | twig | 3.9.0 |
Timeline
- May 20, 2026 PoC Published (3 in total, the first dated here)
- May 20, 2026 CVE Published
- May 21, 2026 EPSS Score (30 in total, the first dated here)
- May 21, 2026 Coalition ESS Score
- May 25, 2026 Security Advisory
Query this with the API
The same record, from the CLI:
vulnetix vdb vuln CVE-2026-24425
vulnetix vdb fixes CVE-2026-24425
Or with curl, using the org id and key from your account page:
curl -s -H "Authorization: ApiKey ${VULNETIX_ORG_ID}:${VULNETIX_API_KEY}" \
"https://api.vdb.vulnetix.com/v2/vuln/CVE-2026-24425/fixes/registry"
The Community plan is free and allows 50 queries a day. Get a free API key · API quickstart
References
- GitHub Security Advisory (GHSA-2q52-x2ff-qgfr) vendor-advisory
- Twig 3.26.0 Release Notes release-notes
- third-party-advisory
- https://nvd.nist.gov/vuln/detail/CVE-2026-24425 advisory
- https://github.com/advisories/GHSA-2q52-x2ff-qgfr advisory
- https://github.com/FriendsOfPHP/security-advisories/blob/master/twig/twig/CVE-2026-24425.yaml url
- https://symfony.com/cve-2026-24425 url