Skip to content
Low 2.1

Sandboxed templates can rewrite application-owned `Markup` objects through their constructor

CVE-2026-133770 First seen on SecPulse

Affected packages

PackageAffected → Fixed
Twigtwig/twig
< 3.31.1→ 3.31.1

Fix status by distribution

Records published by each distribution for this CVE. Fixed versions differ by release; check each link.

Original description The description as published by the source.

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('alert(1)', '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.

Source: CVE.org (CVE Program・cvelistV5) NVD GitHub Advisory

References

We use cookies for analytics and ad measurement. This setting applies to all Game co., Ltd. sites. Details