| Name | 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. |
| Source | CVE (at NVD; CERT, ENISA, LWN, oss-sec, fulldisc, Debian ELTS, Red Hat, Ubuntu, Gentoo, SUSE bugzilla/CVE, GitHub advisories/code/issues, web search, more) |
| References | DSA-6311-1 |
The table below lists information on source packages.
| Source Package | Release | Version | Status |
|---|---|---|---|
| php-twig (PTS) | bullseye | 2.14.3-1+deb11u2 | vulnerable |
| bullseye (security) | 2.14.3-1+deb11u4 | vulnerable | |
| bookworm, bookworm (security) | 3.5.1-1+deb12u3 | vulnerable | |
| trixie (security), trixie | 3.27.0-0+deb13u1 | fixed | |
| forky, sid | 3.27.1-1 | fixed |
The information below is based on the following data on fixed versions.
| Package | Type | Release | Fixed Version | Urgency | Origin | Debian Bugs |
|---|---|---|---|---|---|---|
| php-twig | source | trixie | 3.27.0-0+deb13u1 | DSA-6311-1 | ||
| php-twig | source | (unstable) | 3.26.0-1 |
[bookworm] - php-twig <ignored> (Too intrusive to backport)
https://github.com/twigphp/Twig/security/advisories/GHSA-pr2w-4gpj-cpq4
https://symfony.com/blog/cve-2026-47732-sandbox-multiple-tostring-policy-bypasses-via-unguarded-string-coercion-points