CVE Catalog

CVE-2026-47732

MediumCVSS 6.5
Published: Updated: Translated: NVD NIST

Exploitation Probability (EPSS)

Low risk
0.36%

28th percentile - higher than 28% of all known CVEs

Summary

A vulnerability in the Twig template engine before version 3.26.0 allows bypassing the sandbox mechanism. Several language constructs (conditional expressions, comparison operators, tests, template-loading tags, dynamic attribute names, spread arguments, the 'do' tag, and the '..' range operator) trigger string coercion on Stringable operands without checking SecurityPolicy::checkMethodAllowed().

Risk Assessment

An attacker with template authoring privileges in a sandboxed environment can invoke the __toString() method on any object reachable in the render context, potentially leading to sensitive data disclosure or privilege escalation.

Recommendation

Immediately update the Twig library to version 3.26.0 or later. After updating, verify the application's behavior in the sandbox environment.

Other vulnerabilities in Twig

See all
Original NVD description (English source)

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.

Vulnerability data from NVD (NIST) · CISA KEV · EPSS