| Name | CVE-2026-133766 |
| Description | Since Twig 3.28.0, the sandbox skips the toString() check of an argument whose PHP parameter can't hold a string, like an int. A spread argument was mapped to a single parameter, although it fills every parameter from its position on. A sandboxed template could therefore call a denied toString() method: {{ tag(...[1, obj]) }} Here, the first parameter of tag() is an int, and a later one accepts strings. Applications are affected when they allow such a function, filter or test in the sandbox. No built-in callable is affected. A spread argument is now checked unless every parameter that it can fill has a safe type. |
| 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) |
The table below lists information on source packages.
| Source Package | Release | Version | Status |
|---|---|---|---|
| php-twig (PTS) | bookworm, bookworm (security) | 3.5.1-1+deb12u3 | fixed |
| trixie (security), trixie | 3.27.0-0+deb13u1 | fixed | |
| forky | 3.30.0-1 | vulnerable | |
| sid | 3.31.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 | bookworm | (not affected) | |||
| php-twig | source | trixie | (not affected) | |||
| php-twig | source | (unstable) | 3.31.1-1 |
[trixie] - php-twig <not-affected> (Vulnerable code not present, introduced in 3.28)
[bookworm] - php-twig <not-affected> (Vulnerable code not present, introduced in 3.28)
https://symfony.com/blog/cve-2026-133766-sandbox-tostring-policy-bypass-via-spread-arguments
https://github.com/twigphp/Twig/security/advisories/GHSA-56wp-8m9q-4354
https://github.com/twigphp/Twig/commit/7af821c372f52cc9447afeba9e042de44b738222 (v3.31.1)