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
The vulnerability in Twig (CVE-2026-24425) involves a sandbox bypass when using a SourcePolicyInterface. Attackers who can render templates can exploit the failure in the runtime check that does not correctly reference the current template source, allowing them to pass arbitrary PHP callables to filters such as sort, filter, map, and reduce. This bypasses sandbox restrictions and enables arbitrary code execution despite sandboxing being enabled through a source policy rather than globally. Affected versions include 2.16.x and 3.9.0 through 3.25.x. No official remediation or patch is currently documented.
Potential Impact
Successful exploitation allows attackers with template rendering privileges to bypass sandbox restrictions and execute arbitrary PHP code. This can lead to full code execution within the context of the application using Twig, potentially compromising the host system or application data. The vulnerability is rated high severity with a CVSS 4.0 score of 8.7, reflecting network attack vector, low attack complexity, no privileges required beyond template rendering, and high impact on confidentiality, integrity, and availability.
Mitigation Recommendations
Patch status is not yet confirmed — check the vendor advisory for current remediation guidance. Until an official fix is available, avoid enabling sandboxing through a SourcePolicyInterface or restrict template rendering capabilities to trusted users only. Monitor vendor communications for updates and patches addressing this vulnerability.
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.
CVSS v4.0
Score 8.7high
Affected software
Run on your own infrastructure? Check whether these packages are installed with threat-finder — our free open-source scanner.
Weaknesses
AI-Powered Analysis
Machine-generated threat intelligence
Technical Analysis
The vulnerability in Twig (CVE-2026-24425) involves a sandbox bypass when using a SourcePolicyInterface. Attackers who can render templates can exploit the failure in the runtime check that does not correctly reference the current template source, allowing them to pass arbitrary PHP callables to filters such as sort, filter, map, and reduce. This bypasses sandbox restrictions and enables arbitrary code execution despite sandboxing being enabled through a source policy rather than globally. Affected versions include 2.16.x and 3.9.0 through 3.25.x. No official remediation or patch is currently documented.
Potential Impact
Successful exploitation allows attackers with template rendering privileges to bypass sandbox restrictions and execute arbitrary PHP code. This can lead to full code execution within the context of the application using Twig, potentially compromising the host system or application data. The vulnerability is rated high severity with a CVSS 4.0 score of 8.7, reflecting network attack vector, low attack complexity, no privileges required beyond template rendering, and high impact on confidentiality, integrity, and availability.
Mitigation Recommendations
Patch status is not yet confirmed — check the vendor advisory for current remediation guidance. Until an official fix is available, avoid enabling sandboxing through a SourcePolicyInterface or restrict template rendering capabilities to trusted users only. Monitor vendor communications for updates and patches addressing this vulnerability.
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: 05/20/2026, 14:19:19 UTC
Last enriched: 07/15/2026, 11:05:18 UTC
Last updated: 07/31/2026, 19:22:58 UTC
Views: 74
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.