Back

HIGH

Twig Sandbox: multiple `__toString()` policy bypasses via unguarded string coercion points

Published Jul 14, 2026

Description

Twig is a template language for PHP. Prior to 3.26.0, several Twig language constructs trigger PHP string coercion on a Stringable operand without consulting SecurityPolicy::checkMethodAllowed(), allowing a sandboxed template author to invoke __toString() on objects reachable in the render context through conditional expressions, comparison operators, tests, template-loading tags, dynamic attribute names, spread arguments, the do tag, and the .. range operator. This issue is fixed in version 3.26.0.

Affected products

Remediation

No remediation recorded yet.

References (7)

Change history (0)

No recorded changes yet.

Sources
CVE.org / MITRE
Status PUBLISHED
Assigner GitHub_M
Published Jul 14, 2026
Updated Jul 15, 2026
Reserved May 19, 2026
CISA Vulnrichment
Updated Jul 15, 2026
NVD
Status Analyzed
Modified Jul 16, 2026
Red Hat
Severity n/a
Public date n/a
ENISA EUVD
Assigner GitHub_M
Published Jul 14, 2026
Updated Jul 15, 2026
Exploited since n/a
EUVD-2026-44555 GHSA-PR2W-4GPJ-CPQ4