CVE-2026-24425

Twig 2.16.x & 3.9.0-3.25.x Sandbox Bypass via SourcePolicyInterface

State
Published
Severity
8.7 High
Published
May 20, 2026
Updated
Oct 8, 2026
Reserved
Jan 22, 2026

Read the record on cve.org

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.

Scores

CVSSScoreVectorSource
4.08.7 HighCVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:NVulnCheck
3.18.8 HighCVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:HVulnCheck

Weaknesses

  • CWE-693 Protection Mechanism Failure

Affected Products

ProductVersions
Twigtwigphp
  • 3.9.0 to before 3.26.0Affected
  • 2.16.*Affected

References

Every record here comes from the CVE Program’s CVE List. © 1999–2026 The MITRE Corporation. CVE is a registered trademark of The MITRE Corporation. The records are reproduced under the CVE Program terms of use.