CVE-2026-47732
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.
How to fix
- symfony twig3.26.0 or later
- twig/twig3.26.0 or later
Affected products
| Product | Affected versions | Fixed in |
|---|---|---|
| symfony twig | v < 3.26.0 | 3.26.0 |
| twig/twigPackagist | v < 3.26.0 | 3.26.0 |
Check your version
Choose the product and enter the version you run to see whether it falls in the affected range.
Attack Surface Management
See the assets tied to your domains, the technologies they run and known vulnerabilities in one list.