PT-2026-47218 · Twig · Twig

CVE-2026-48805

·

Published

2026-05-27

·

Updated

2026-07-15

CVSS v3.1

9.1

Critical

VectorAV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:N
Name of the Vulnerable Software and Affected Versions Twig versions prior to 3.26.0
Description Deprecated internal wrappers in src/Resources/core.php for legacy third-party code fail to correctly handle sandbox state. Specifically, the functions twig array some() and twig array every() call CoreExtension::arraySome() and CoreExtension::arrayEvery() without forwarding the sandbox state. Because the underlying methods default the isSandboxed variable to false, the restriction requiring callables to be closures is bypassed in sandbox mode, allowing string callables like 'strcmp' to be accepted. Additionally, twig check arrow in sandbox() passes an Environment object to CoreExtension::checkArrow() instead of the expected boolean, resulting in a TypeError on PHP 8+.
Recommendations Update to version 3.26.0 or later. As a temporary workaround, avoid using the deprecated twig array some(), twig array every(), and twig check arrow in sandbox() helper functions when using a sandboxed environment.

Exploit

Fix

Protection Mechanism Failure

Found an issue in the description? Have something to add? Feel free to write us 👾

Weakness Enumeration

Related Identifiers

CVE-2026-48805
GHSA-P42Q-9PRX-Q5WQ

Affected Products

Twig