Skip to content
DayZeroHub
Medium Not yet writtenCVSS 5.3CVE-2026-133767

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

Twig twig/twig

Preliminary notice: published right away from the original source data, without editorial write-up. It will shortly be replaced by a written and reviewed version.

Summary

CVE-2026-133767: medium-severity vulnerability (CVSS 5.3) in Twig twig/twig.

What happened

Original description from the source: 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_' ~ app_secret() %}{% 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.

Why it matters

Medium severity, CVSS 5.3.

Affected products and versions

Twig twig/twig < 3.31.1

ProductVersionsFixed in
Twig twig/twig< 3.31.1—

Action recommended by the source

See the official references for the fix or mitigation.

Information taken from the source or the vendor. Verify it at the original link before acting.

Sources and references

Weaknesses (CWE): CWE-693, CWE-863

Relevant change history

  1. Published

    Preliminary advisory published.