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('', '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.
{
"cna_assigner": "Symfony",
"cwe_ids": [
"CWE-79",
"CWE-863"
],
"osv_generated_from": "https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/133xxx/CVE-2026-133770.json",
"unresolved_ranges": [
{
"extracted_events": [
{
"range": [
{
"fixed": "3.31.1"
}
],
"source": "AFFECTED_FIELD",
"strategy": "StandardRange"
}
]
}
]
}