CVE-2026-24425: 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.
Security readout for executives and security teams
Plain-English summary
Twig’s sandbox can be bypassed in specific configurations, allowing a user who can submit or control templates to escape intended restrictions. In the worst case, this can lead to arbitrary code execution in the application process. Exposure depends on whether the application permits template rendering by less-trusted users and uses SourcePolicyInterface-based sandboxing.
Executive priority
Treat this as high priority where customers, partners, or lower-privileged staff can influence templates. Internal-only systems with trusted template authors are lower urgency but still need patch planning.
Technical view
CVE-2026-24425 affects Twig 2.16.x and 3.9.0 through 3.25.x. The issue involves sandbox runtime checks not using the current template source, allowing arbitrary PHP callables through sort, filter, map, and reduce filters when sandboxing is enabled via SourcePolicyInterface rather than globally.
Likely exposure
Highest risk is in PHP applications that let authenticated or semi-trusted users create, edit, upload, or influence Twig templates while relying on SourcePolicyInterface sandbox controls.
Exploitation context
The CVSS vector indicates network reachability, low complexity, required low privileges, and no user interaction. The source bundle does not show CISA KEV listing or confirmed active exploitation.
Researcher notes
The key exposure discriminator is sandbox mode: SourcePolicyInterface-based enablement is implicated, not simply all Twig usage. Evidence provided does not establish exploit-in-the-wild status, public exploit availability, or a complete 2.x remediation path.
Mitigation direction
Upgrade affected Twig 3.x deployments to version 3.26.0 or later where applicable.
Review the Twig security advisory for 2.16.x remediation guidance.
Identify and restrict untrusted template authoring or rendering paths.
Review SourcePolicyInterface-based sandbox usage and reduce reliance until patched.
Monitor vendor advisories for any additional supported fixes.
Validation and detection
Inventory composer.lock and deployed artifacts for Twig versions 2.16.x or 3.9.0 through 3.25.x.
Confirm whether the application enables Twig sandboxing through SourcePolicyInterface.
Identify routes, CMS features, or admin tools that render user-controlled templates.
Verify patched deployments use Twig 3.26.0 or another vendor-supported fixed release.
Check logs for unusual template errors around sort, filter, map, or reduce usage.
Generated from the cited source records. This long-tail analysis has not been individually reviewed by a named human.
Potential ATT&CK relevance
Conservative CVE-to-ATT&CK context
These mappings and lookup hints may be relevant to the vulnerability behavior, CWE, affected product, or exposure path. Glexia-inferred context is not an official MITRE, ATT&CK, CWE, or CVE Program mapping.
ATT&CK lookup starting points
Use these exact CWE pages and searches to review the Glexia ATT&CK library from this CVE's weakness and description context.
cwe · low confidence lookup
CWE-693: Exact CWE lookup
Use the exact CWE identifier as the starting point before reviewing related ATT&CK behavior. Open the exact CWE lookup page first, then review the ATT&CK searches from that MITRE weakness context. This is a Glexia lookup hint, not an official ATT&CK mapping.
The CVE wording references code or command execution, so execution technique review may help defensive triage. This is a Glexia inferred lookup path, not an official MITRE, ATT&CK, or CVE Program mapping.
These fields come from the CVE record and ADP containers, not from Glexia's Take. They preserve time-varying source decisions such as CISA SSVC, KEV status, CVSS metrics, and provider references.
2CVSS vectors
3Timeline events
1ADP providers
4Source links
SSVC decision data
CISA-ADPCISA Coordinator
Timestamp
Version
2.0.3
Exploitation: noneAutomatable: noTechnical Impact: total
CVSS vector scores
2 official scores
We collect every scored CVSS vector available in the official CNA and ADP containers. When more than one version is present, the table keeps the source vectors side by side instead of collapsing them into the highest score.
CWE links open Glexia weakness intelligence pages with official CWE context, developer remediation guidance, and related CVE mappings.
CWE-693 · source CWE mapping
Protection Mechanism Failure
Protection Mechanism Failure represents a recurring weakness pattern that can create exploitable paths when design, validation, or implementation controls are missing.