{"id":"CVE-2026-133770","aliases":["GHSA-r34x-hh9h-9q9c"],"title":"Sandboxed templates can rewrite application-owned `Markup` objects through their constructor","originalDescription":"The sandbox allows every method of Twig\\Markup objects, including their public constructor. A sandboxed template can therefore call __construct() on any Markup object that it reaches, and replace its content:\n\n{% do banner.__construct('<script>alert(1)</script>', 'UTF-8') %}\n\nA template gains nothing by rewriting its own output. The impact is on the Markup objects that come from the application and are also rendered elsewhere, like a global in a long-running worker. Their new content then ends up in trusted pages that aren't sandboxed.\n\nThe sandbox no longer allows calling the constructor of Markup objects.","severity":{"cvss":2.1,"vector":"CVSS:4.0/AV:N/AC:L/AT:P/PR:L/UI:P/VC:N/VI:L/VA:N/SC:L/SI:L/SA:N","label":"low"},"exploitation":{"kev":null,"epss":{"score":0.00553,"percentile":0.39876},"exploitDb":null},"affected":[{"ecosystem":"unknown","name":"twig/twig","range":">=0, <3.31.1","fixed":"3.31.1"}],"references":[{"url":"https://symfony.com/cve-2026-133770","type":"vendor-advisory"},{"url":"https://github.com/twigphp/Twig/security/advisories/GHSA-r34x-hh9h-9q9c","type":"vendor-advisory"},{"url":"https://github.com/twigphp/Twig/commit/97b2e40b1165e6a42a197843f96ccb0a55f46f34","type":"patch"},{"url":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/133xxx/CVE-2026-133770.json","type":"advisory"},{"url":"https://github.com/twigphp/Twig","type":"package"},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2026-133770","type":"advisory"},{"url":"https://packagist.org","type":"web"}],"sources":[{"name":"nvd","at":"2026-11-24T19:02:21.149Z","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-133770","license":"NVD terms of use","firstSeenAt":"2026-11-24T13:30:19.613Z"},{"name":"osv","at":"2026-11-27T08:12:35.123Z","url":"https://osv.dev/vulnerability/CVE-2026-133770","license":"CC-BY 4.0","firstSeenAt":"2026-11-24T15:09:28.644Z"},{"name":"cvelistV5","at":"2026-11-29T04:45:27.244Z","url":"https://www.cve.org/CVERecord?id=CVE-2026-133770","license":"CVE Terms of Use","firstSeenAt":"2026-11-24T13:27:33.572Z"}],"firstSeenAt":"2026-11-24T13:27:33.572Z","publishedAt":"2026-11-24T13:07:53.166Z","modifiedAt":"2026-11-27T07:00:11.479Z"}