CVE-2026-24425: CWE-693 Protection Mechanism Failure in twigphp Twig
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.
AI Analysis
Technical Summary
CVE-2026-24425 is a sandbox bypass vulnerability in twigphp's Twig templating engine affecting versions 2.16.x and 3.9.0 through 3.25.x. The issue occurs when using a SourcePolicyInterface to enable sandboxing, allowing attackers with template rendering permissions to supply arbitrary PHP callables to filters such as sort, filter, map, and reduce. The runtime check intended to enforce sandbox restrictions fails to correctly validate the source context, enabling bypass of sandbox protections and arbitrary code execution. This vulnerability is classified under CWE-693 (Protection Mechanism Failure) and has a CVSS 4.0 score of 8.7 (high severity). No patch or official remediation level has been published, and no exploits are currently known in the wild.
Potential Impact
Successful exploitation allows an attacker who can render templates to bypass sandbox restrictions and execute arbitrary PHP code within the context of the application. This can lead to unauthorized code execution, potentially compromising the affected system. The vulnerability affects specific Twig versions and requires the sandbox to be enabled via a SourcePolicyInterface, not globally. There are no known active exploits reported at this time.
Mitigation Recommendations
Patch status is not yet confirmed — check the vendor advisory for current remediation guidance. Until an official fix is released, avoid enabling sandboxing through a SourcePolicyInterface or restrict template rendering capabilities to trusted users only. Monitor vendor communications for updates on patches or official mitigations.
CVE-2026-24425: CWE-693 Protection Mechanism Failure in twigphp Twig
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.
AI-Powered Analysis
Machine-generated threat intelligence
Technical Analysis
CVE-2026-24425 is a sandbox bypass vulnerability in twigphp's Twig templating engine affecting versions 2.16.x and 3.9.0 through 3.25.x. The issue occurs when using a SourcePolicyInterface to enable sandboxing, allowing attackers with template rendering permissions to supply arbitrary PHP callables to filters such as sort, filter, map, and reduce. The runtime check intended to enforce sandbox restrictions fails to correctly validate the source context, enabling bypass of sandbox protections and arbitrary code execution. This vulnerability is classified under CWE-693 (Protection Mechanism Failure) and has a CVSS 4.0 score of 8.7 (high severity). No patch or official remediation level has been published, and no exploits are currently known in the wild.
Potential Impact
Successful exploitation allows an attacker who can render templates to bypass sandbox restrictions and execute arbitrary PHP code within the context of the application. This can lead to unauthorized code execution, potentially compromising the affected system. The vulnerability affects specific Twig versions and requires the sandbox to be enabled via a SourcePolicyInterface, not globally. There are no known active exploits reported at this time.
Mitigation Recommendations
Patch status is not yet confirmed — check the vendor advisory for current remediation guidance. Until an official fix is released, avoid enabling sandboxing through a SourcePolicyInterface or restrict template rendering capabilities to trusted users only. Monitor vendor communications for updates on patches or official mitigations.
Technical Details
- Data Version
- 5.2
- Assigner Short Name
- VulnCheck
- Date Reserved
- 2026-01-22T20:23:19.801Z
- Cvss Version
- 4.0
- State
- PUBLISHED
- Remediation Level
- null
Threat ID: 6a0dc2e7ba1db4736284c24c
Added to database: 5/20/2026, 2:19:19 PM
Last enriched: 5/20/2026, 2:34:10 PM
Last updated: 5/21/2026, 6:24:29 AM
Views: 5
Community Reviews
0 reviewsCrowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.
Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.
Actions
Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.
Need more coverage?
Upgrade to Pro Console for AI refresh and higher limits.
For incident response and remediation, OffSeq services can help resolve threats faster.
Latest Threats
Check if your credentials are on the dark web
Instant breach scanning across billions of leaked records. Free tier available.