Protection Mechanism Failure in Twig - CVE-2026-24425

 

Protection Mechanism Failure in Twig - CVE-2026-24425

Published: May 20, 2026


Vulnerability identifier: #VU132002
CSH Severity: Medium
CVSS v4: 8.7 [CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N]
CVE-ID: CVE-2026-24425
CWE-ID: CWE-693
Exploitation vector: Remote access
Exploit availability: No public exploit available

Vulnerability details

The vulnerability allows a remote user to execute arbitrary code.

The vulnerability exists due to protection mechanism failure in callback-accepting filters when processing user-controlled templates in sandbox mode enabled through a source policy. A remote user can supply a non-Closure callback to execute arbitrary code.

The issue affects the sort, filter, map, and reduce filters only when the sandbox is not enabled globally and a SourcePolicyInterface enables sandboxing for the rendered template.


Affected software

Twig
Ubuntu
php-twig (Ubuntu package)

How to mitigate CVE-2026-24425

Install security update from vendor's website.

Twig - update to 3.26.0
php-twig (Ubuntu package) - update to 3.23.0-2ubuntu0.1~esm1

External References

Related Security Bulletins