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.
Casky was already ahead
This CVE exploits attack patterns that Casky's 0matched skills already investigate — long before this vulnerability was disclosed. Claude's reasoning model maps these techniques to MITRE ATT&CK, so practitioners who ran these skills have already seen the threat behaviour in their findings.
Twig, a popular PHP templating engine, contains a critical sandbox bypass vulnerability affecting versions 2.16.x and 3.9.0 through 3.25.x. When a SourcePolicyInterface is configured to enforce sandbox restrictions, attackers who can control template rendering can inject arbitrary PHP callables through sort, filter, map, and reduce filters to execute unauthorized code. The vulnerability stems from a runtime check that fails to properly validate the current template source, allowing the sandbox policy to be circumvented. This is particularly dangerous for platforms that allow user-supplied templates or plugin systems, as it transforms a template injection from a restricted operation into full code execution. Any application using Twig with source-level sandbox policies is affected, including content management systems, templating platforms, and applications with plugin architectures.
Detecting exploitation of this vulnerability requires monitoring template processing behavior and callable execution patterns. Practitioners using Casky's extended reasoning capabilities would identify suspicious indicators such as attempts to pass PHP callables to filtering operations, unexpected function references in template contexts, and runtime sandbox policy violations. Security teams should establish detection rules focused on Template Injection (MITRE ATT&CK T1027 - Obfuscated Files or Information) combined with Code Execution patterns, monitoring for anomalous filter usage with callable parameters and mismatches between declared sandbox policies and actual execution scope. Casky's skill mapping would highlight the gap between policy-enforced restrictions and actual template runtime behavior, allowing practitioners to correlate template rendering events with privilege escalation or code execution indicators that suggest sandbox bypass attempts.
Composite risk scoring from EPSS, CISA KEV, Shodan, and GreyNoise — 21 security APIs correlated into a single Casky Risk Score. Coming in Casky Pro. Join early access →
Casky has 0 skills that investigate the attack patterns behind CVE-2026-24425. Run one and get CVSS-scored findings in 3 minutes.
Run the skill that detects this →© 2026 Casky.AI, Inc. · AI Security Investigation