CVE-2026-133770: Sandboxed templates can rewrite application-owned `Markup` objects through their constructor

Published Nov 24, 2026
·
Updated

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 Software

1 affected component
Twig Twig

Event History

Nov 24, 2026
CVE Published
via MITRE·01:07 PM
Data Sourced
via MITRE·01:07 PM
DescriptionWeakness
Data Sourced
via NVD·01:17 PM
DescriptionSeverityWeakness

Frequently Asked Questions

1

Which deployments are realistically exposed to cross-site scripting through this issue?

Deployments are exposed when sandboxed templates can reach application-owned Twig\Markup objects that are later rendered in non-sandboxed, trusted pages. The described risk is especially relevant where such objects are shared or retained, such as globals in long-running workers.

2

What must an attacker be able to do to exploit it?

The attacker needs control over content executed as a sandboxed Twig template and access from that template to an application-owned Markup object. They can invoke that object's public __construct() method to replace its content with attacker-controlled markup.

3

Are templates affected merely by being sandboxed?

No. Rewriting a template's own output does not provide an attacker additional impact. The issue requires a reachable Markup object whose modified content is subsequently rendered elsewhere outside the sandbox.

4

What change addresses the issue?

The sandbox should no longer permit constructor calls on Twig\Markup objects. The provided advisory states that the sandbox has been changed to disallow calling the Markup constructor.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203