CVE-2026-133767: Sandbox allow-list and `__toString()` bypass via a dynamic `embed` parent expression

Published Nov 24, 2026
·
Updated

When the parent of an embed tag was an expression other than a string or a variable, the sandbox didn't see that expression. The functions, filters and tests of the expression weren't checked against the policy, and neither were its conversions to strings. A sandboxed template allowed to use embed could therefore call any function, filter or test, and any toString() method:

{% embed 'leak' ~ appsecret() %}{% endembed %}

Method calls and property reads were not affected, since they're checked at runtime.

The sandbox now checks the parent expression of embed like any other expression of the template.

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

Who is exposed to this issue?

Applications that render sandboxed Twig templates and permit use of the embed tag are exposed. The bypass applies when an embed tag uses a dynamic parent expression rather than a literal string or variable.

2

What could an attacker do through the bypass?

A sandboxed template could invoke functions, filters, and tests that were not allowed by the sandbox policy. It could also trigger __toString() conversions that were not checked by the policy.

3

Are method calls and property reads bypassed as well?

No. Method calls and property reads remain checked at runtime and were not affected by this issue.

4

How can I identify potentially affected templates?

Review sandboxed templates that are allowed to use embed and look for embed parent values built from expressions, such as concatenation or expressions that invoke functions, filters, tests, or string conversions. A literal parent name or a simple variable is not the described bypass condition.

5

What should be done if the fix cannot be applied immediately?

Restrict or disable embed usage in sandboxed templates, especially where the parent template name can be built dynamically. Avoid allowing untrusted template authors to supply dynamic embed parent expressions.

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