Sandbox Bypass Vulnerability in Twig Product by Twig Vendor
CVE-2026-24425

8.7HIGH

Key Information:

Vendor

TwigPHP

Status
Vendor
CVE Published:
20 May 2026

What is CVE-2026-24425?

The vulnerability in Twig affects versions 2.16.x, 3.9.0 through 3.25.x, allowing attackers with template rendering capabilities to exploit a weakness in the SourcePolicyInterface. This weakness enables the passing of arbitrary PHP callables to various filters such as sort, filter, map, and reduce. By leveraging a flaw in the runtime check, attackers can circumvent sandbox restrictions and execute arbitrary code when the sandbox feature is used through a specific source policy setting. This issue could lead to significant security implications, especially in environments where the sandbox feature is enabled.

Affected Version(s)

Twig 3.9.0

Twig 3.9.0 < 3.26.0

Twig 2.16.*

References

CVSS V4

Score:
8.7
Severity:
HIGH
Confidentiality:
High
Integrity:
High
Availability:
High
Attack Vector:
Network
Attack Complexity:
Low
Attack Required:
None
Privileges Required:
Undefined
User Interaction:
None

Timeline

  • Vulnerability published

  • Vulnerability Reserved

Credit

Nicolò Ribaudo
Fabien Potencier
VulnCheck
.