Twig 2.16.x & 3.9.0-3.25.x Sandbox Bypass via SourcePolicyInterface
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.
CVE-2026-24425
Primary source · Revision 1
Imported from structured advisory data. Source references identify upstream records or fields; verify affected versions and your deployed configuration.
Security context
Source reference: cve:CVE-2026-24425
Twig
Source reference: /containers/cna/affected/0/product
- Affected versions
- Not stated in this record
- Fixed versions
- Not stated in this record
- Prerequisites
- Not stated in this record
Structured affected-version data
Original package identities and version rules from this source.
[
{
"repo": "https://github.com/twigphp/Twig",
"vendor": "twigphp",
"product": "Twig",
"versions": [
{
"status": "affected",
"version": "3.9.0",
"lessThan": "3.26.0",
"versionType": "semver"
},
{
"status": "affected",
"version": "2.16.*",
"versionType": "custom"
}
],
"packageURL": "pkg:composer/twig/twig",
"defaultStatus": "affected"
}
]- Related CVEs
- CVE-2026-24425
Source reference:
/cveMetadata/cveId
Publisher severity
high
Source reference: /containers/cna/metrics
- Event
- #12702 · Revision 1
- Added to Heist Feed
- Publisher date