{"id":"CVE-2026-133766","aliases":["GHSA-56wp-8m9q-4354"],"title":"Sandbox `__toString()` policy bypass via spread arguments","originalDescription":"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:\n\n{{ tag(...[1, obj]) }}\n\nHere, 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.\n\nA spread argument is now checked unless every parameter that it can fill has a safe type.","severity":{"cvss":2.3,"vector":"CVSS:4.0/AV:N/AC:L/AT:P/PR:L/UI:N/VC:L/VI:N/VA:N/SC:N/SI:N/SA:N","label":"low"},"exploitation":{"kev":null,"epss":{"score":0.00533,"percentile":0.38536},"exploitDb":null},"affected":[{"ecosystem":"unknown","name":"twig/twig","range":">=3.28.0, <3.31.1","fixed":"3.31.1"}],"references":[{"url":"https://symfony.com/cve-2026-133766","type":"vendor-advisory"},{"url":"https://github.com/twigphp/Twig/security/advisories/GHSA-56wp-8m9q-4354","type":"vendor-advisory"},{"url":"https://github.com/twigphp/Twig/commit/7af821c372f52cc9447afeba9e042de44b738222","type":"patch"},{"url":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/133xxx/CVE-2026-133766.json","type":"advisory"},{"url":"https://github.com/twigphp/Twig","type":"package"},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2026-133766","type":"advisory"},{"url":"https://packagist.org","type":"web"}],"sources":[{"name":"nvd","at":"2026-11-24T19:02:21.137Z","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-133766","license":"NVD terms of use","firstSeenAt":"2026-11-24T13:30:19.601Z"},{"name":"osv","at":"2026-11-27T08:12:36.488Z","url":"https://osv.dev/vulnerability/CVE-2026-133766","license":"CC-BY 4.0","firstSeenAt":"2026-11-24T15:09:29.214Z"},{"name":"cvelistV5","at":"2026-11-29T04:45:27.166Z","url":"https://www.cve.org/CVERecord?id=CVE-2026-133766","license":"CVE Terms of Use","firstSeenAt":"2026-11-24T13:27:33.548Z"}],"firstSeenAt":"2026-11-24T13:27:33.548Z","publishedAt":"2026-11-24T13:07:49.491Z","modifiedAt":"2026-11-27T07:00:08.976Z"}