CVE-2026-47732CWE-863

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

High · published July 14, 2026

CVSS v4.0
7.1
EPSS
0%
Percentile
33.3
In the wild
Unconfirmed
What it is

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.

The record
Technical detail
CVSS v4.0
7.1 · HIGH
Vector
CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:N/VC:H/VI:L/VA:N/SC:N/SI:N/SA:N
EPSS
0.00402 · 33.3th percentile
Weakness
CWE-863 · Incorrect Authorization
Published
2026-07-14T21:12Z
EPSS history
Timeline
  • 14 JUL 21:12Z
    Twig Sandbox: multiple `__toString()` policy bypasses via unguarded string coercion points
    cvelistv5