{"id":"CVE-2026-133764","aliases":["GHSA-rc9g-xwx4-rmfh"],"title":"Sandbox `__toString()` policy bypass via the input of custom tests","originalDescription":"The sandbox checks that a template may call toString() on an object before converting it to a string. It didn't check the input of tests. The PHP callable of a test may convert this input to a string, for example when its parameter is typed as string. PHP then calls toString() on an object without the sandbox checking it first:\n\n{{ obj is upperish }}\n\nApplications are affected when they register such a test and allow it in the sandbox. No built-in test is affected.\n\nThe sandbox now checks the input of tests like the input of filters. The built-in tests that never convert their input to a string still skip the check.","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":">=0, <3.31.1","fixed":"3.31.1"}],"references":[{"url":"https://symfony.com/cve-2026-133764","type":"vendor-advisory"},{"url":"https://github.com/twigphp/Twig/security/advisories/GHSA-rc9g-xwx4-rmfh","type":"vendor-advisory"},{"url":"https://github.com/twigphp/Twig/commit/978c60be74fc62a0f2c3af11ca5bc3609ae8b69a","type":"patch"},{"url":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/133xxx/CVE-2026-133764.json","type":"advisory"},{"url":"https://github.com/twigphp/Twig","type":"package"},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2026-133764","type":"advisory"},{"url":"https://packagist.org","type":"web"}],"sources":[{"name":"nvd","at":"2026-11-24T19:02:21.131Z","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-133764","license":"NVD terms of use","firstSeenAt":"2026-11-24T13:30:19.596Z"},{"name":"osv","at":"2026-11-27T08:12:36.571Z","url":"https://osv.dev/vulnerability/CVE-2026-133764","license":"CC-BY 4.0","firstSeenAt":"2026-11-24T15:09:29.190Z"},{"name":"cvelistV5","at":"2026-11-29T04:45:27.133Z","url":"https://www.cve.org/CVERecord?id=CVE-2026-133764","license":"CVE Terms of Use","firstSeenAt":"2026-11-24T13:27:33.494Z"}],"firstSeenAt":"2026-11-24T13:27:33.494Z","publishedAt":"2026-11-24T13:07:47.621Z","modifiedAt":"2026-11-27T07:00:08.941Z"}