{"id":"CVE-2026-133765","aliases":["CVE-2026-133765"],"related":[],"kind":"vulnerability","state":"published","title":"Sandbox `__toString()` policy bypass via assignment and destructuring expressions","summary":"The sandbox checks that a template may call toString() on an object before converting it to a string. Since Twig 3.23.0, assignments like x = obj, and the destructuring forms [a] = list and {a} = obj, evaluate to the value that they assign. The sandbox didn't check that value, so a sandboxed template could call a denied toString() method:\n\n{{ (x = obj) }}\n{{ ({secret: s} = obj)|join }}\n\nNo tag needs to be allowed.\n\nThe sandbox now checks the result of assignments like the result of filters and functions. {% do x = obj %} and {% if (x = obj) %} still work, since they don't convert the value to a string.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"The sandbox checks that a template may call toString() on an object before converting it to a string. Since Twig 3.23.0, assignments like x = obj, and the destructuring forms [a] = list and {a} = obj, evaluate to the value that they assign. The sandbox didn't check that value, so a sandboxed template could call a denied toString() method:\n\n{{ (x = obj) }}\n{{ ({secret: s} = obj)|join }}\n\nNo tag needs to be allowed.\n\nThe sandbox now checks the result of assignments like the result of filters and functions. {% do x = obj %} and {% if (x = obj) %} still work, since they don't convert the value to a string.","source":"cvelist"}],"published":"2026-11-24T13:07:48.546Z","modified":"2026-12-01T20:18:25.247Z","severity":{"scorer":"Symfony","scheme":"CVSS:4.0","vector":"CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:N/VC:L/VI:N/VA:N/SC:N/SI:N/SA:N","score":5.3,"rating":"MEDIUM"},"severities":[{"scorer":"Symfony","scheme":"CVSS:4.0","vector":"CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:N/VC:L/VI:N/VA:N/SC:N/SI:N/SA:N","score":5.3,"rating":"MEDIUM"}],"cwes":["CWE-693","CWE-863"],"affected":[{"ranges":[{"type":"semver","introduced":"3.23.0","fixed":"3.31.1","status":"affected"}],"vendor":"Twig","product":"twig/twig","package":"twig/twig","repo":"https://github.com/twigphp/Twig","source":"cvelist"}],"references":[{"url":"https://symfony.com/cve-2026-133765","tags":["vendor-advisory"],"sources":["cvelist","nvd"]},{"url":"https://github.com/twigphp/Twig/security/advisories/GHSA-ccrc-gqhf-3cxc","tags":["vendor-advisory"],"sources":["cvelist","nvd"]},{"url":"https://github.com/twigphp/Twig/commit/6bcdbc3d4470dde23e3e2636e7053e0512387edd","tags":["patch"],"sources":["cvelist","nvd"]}],"credits":["Fabien Potencier","Jacko","Inanna Malick","Tudor-Andrei Oprea"],"assigner":"Symfony","ssvc":{"scorer":"CISA-ADP","exploitation":"none","automatable":"no","technicalImpact":"partial","date":"2026-11-30T17:56:22.128Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-133765","url":"https://www.cve.org/CVERecord?id=CVE-2026-133765","licence":"CVE Terms of Use","modified":"2026-12-01T19:38:31.538Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-133765","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-133765","licence":"Public domain","modified":"2026-12-01T20:18:25.247Z"}],"updatedAt":"2026-12-01T20:32:22.509Z","epss":{"score":0.00533,"percentile":0.46466,"date":"2026-12-01T12:00:22.000Z"}}