CVE-2026-133770
2.1low
Sandboxed templates can rewrite application-owned `Markup` objects through their constructor
- Severity
- 2.1low CVSS:4.0 by Symfony
- Exploit likelihood
- 0.55% (higher than 47% of CVEs; EPSS, by FIRST)
- Published
- Last changed
- Assigned by
- Symfony
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.
Affected
| Product or package | Versions | Reported by |
|---|---|---|
| twig/twig | before 3.31.1 | CVE List |
Classification
References
Sources
| Source | Record | Licence |
|---|---|---|
| CVE List | CVE-2026-133770 changed 2026-12-01 | CVE Terms of Use |
| NVD | CVE-2026-133770 changed 2026-12-01 | Public domain |