CVE-2026-133766

NameCVE-2026-133766
DescriptionSince 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.
SourceCVE (at NVD; CERT, ENISA, LWN, oss-sec, fulldisc, Debian ELTS, Red Hat, Ubuntu, Gentoo, SUSE bugzilla/CVE, GitHub advisories/code/issues, web search, more)

Vulnerable and fixed packages

The table below lists information on source packages.

Source PackageReleaseVersionStatus
php-twig (PTS)bookworm, bookworm (security)3.5.1-1+deb12u3fixed
trixie (security), trixie3.27.0-0+deb13u1fixed
forky3.30.0-1vulnerable
sid3.31.1-1fixed

The information below is based on the following data on fixed versions.

PackageTypeReleaseFixed VersionUrgencyOriginDebian Bugs
php-twigsourcebookworm(not affected)
php-twigsourcetrixie(not affected)
php-twigsource(unstable)3.31.1-1

Notes

[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)

Search for package or bug name: Reporting problems