{"id":"CVE-2026-133770","aliases":["CVE-2026-133770"],"related":[],"kind":"vulnerability","state":"published","title":"Sandboxed templates can rewrite application-owned `Markup` objects through their constructor","summary":"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.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"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.","source":"cvelist"}],"published":"2026-11-24T13:07:53.166Z","modified":"2026-12-01T20:18:25.823Z","severity":{"scorer":"Symfony","scheme":"CVSS:4.0","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","score":2.1,"rating":"LOW"},"severities":[{"scorer":"Symfony","scheme":"CVSS:4.0","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","score":2.1,"rating":"LOW"}],"cwes":["CWE-79","CWE-863"],"affected":[{"ranges":[{"type":"semver","introduced":"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-133770","tags":["vendor-advisory"],"sources":["cvelist","nvd"]},{"url":"https://github.com/twigphp/Twig/security/advisories/GHSA-r34x-hh9h-9q9c","tags":["vendor-advisory"],"sources":["cvelist","nvd"]},{"url":"https://github.com/twigphp/Twig/commit/97b2e40b1165e6a42a197843f96ccb0a55f46f34","tags":["patch"],"sources":["cvelist","nvd"]}],"credits":["Fabien Potencier"],"assigner":"Symfony","ssvc":{"scorer":"CISA-ADP","exploitation":"none","automatable":"no","technicalImpact":"partial","date":"2026-11-30T17:57:03.286Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-133770","url":"https://www.cve.org/CVERecord?id=CVE-2026-133770","licence":"CVE Terms of Use","modified":"2026-12-01T19:38:30.761Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-133770","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-133770","licence":"Public domain","modified":"2026-12-01T20:18:25.823Z"}],"updatedAt":"2026-12-01T20:32:24.524Z","epss":{"score":0.00553,"percentile":0.4758,"date":"2026-12-01T12:00:22.000Z"}}