CVE-2026-133770
Sandboxed templates can rewrite application-owned `Markup` objects through their constructor
- CVSS
- 2.1
- EPSS
- 0.55% (p40)
- Published
- 2026-11-24
- Age
- 5d old
- Modified
- 2026-11-27
- Product
- Twig twig/twig
- Aliases
- GHSA-r34x-hh9h-9q9c
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
Description
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: {% do banner.__construct('<script>alert(1)</script>', 'UTF-8') %} A 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. The sandbox no longer allows calling the constructor of Markup objects.
Fixed in
3.31.1
Affected packages
| Ecosystem | Package | Range | Fixed |
|---|---|---|---|
| unknown | twig/twig | >=0, <3.31.1 | 3.31.1 |
Sources
- NVD · first seen 5d ago · NVD terms of use
- OSV · first seen 5d ago · CC-BY 4.0
- CVE List · first seen 5d ago · CVE Terms of Use
References
- https://symfony.com/cve-2026-133770 vendor-advisory
- https://github.com/twigphp/Twig/security/advisories/GHSA-r34x-hh9h-9q9c vendor-advisory
- https://github.com/twigphp/Twig/commit/97b2e40b1165e6a42a197843f96ccb0a55f46f34 patch
- https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/133xxx/CVE-2026-133770.json advisory
- https://github.com/twigphp/Twig package
- https://nvd.nist.gov/vuln/detail/CVE-2026-133770 advisory
- https://packagist.org web