CVE-2026-133772twig/twig Incorrect Authorization
NVD
Vulnerability Summary
The guard tag compiles only one of its branches, depending on whether a callable exists. The other branch was still parsed, though. The extends, use, macro and block tags in it registered their effects on the template. The sandbox doesn't see these tags, since that branch isn't compiled. A sandboxed template allowed to use guard could therefore extend a template, import blocks and define macros, while the policy doesn't allow these tags:
{% guard filter upper %}{% else %}{% extends "parent.html" %}{% endguard %}
The templates reached this way come from the loader of the sandbox, and they are sandboxed too.
What the branch that isn't selected registers on the parser is now discarded.
{% guard filter upper %}{% else %}{% extends "parent.html" %}{% endguard %}
The templates reached this way come from the loader of the sandbox, and they are sandboxed too.
What the branch that isn't selected registers on the parser is now discarded.
CVSS v4.0 Base Metrics — Score 2.3 (LOW)
CVSS:4.0/AV:N/AC:L/AT:P/PR:L/UI:N/VC:L/VI:N/VA:N/SC:N/SI:N/SA:NAttack VectorNetwork
Attack ComplexityLow
Attack RequirementsPresent
Privileges RequiredLow
User InteractionNone
Confidentiality (Vulnerable System)Low
Integrity (Vulnerable System)None
Availability (Vulnerable System)None
Confidentiality (Subsequent System)None
Integrity (Subsequent System)None
Availability (Subsequent System)None
Affected & Patched Versions
- twig/twig >= 3.15.0 and < 3.31.0
- twig/twig 3.31.0
What to do
Fix it during your normal patch cycle. No exploitation is confirmed yet.
- Check whether you run twig/twig and which version.
- Update to a patched version listed above, then confirm the new version.
Timeline
- Nov 24, 2026Published
- Nov 24, 2026Record last modified
Score, severity and exploitation changes are tracked from the day Watchtower started logging them.
Get notified about new twig/twig CVEsYou are reading CVE-2026-133772. Get an email when KEV listings, exploits or new CVEs match your stack.
Set up CVE alertsExternal References
Data last checked: Nov 24, 2026 14:13 UTC