CVE-2026-133772
Published:November 24, 2026
Updated:November 26, 2026
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.
Affected Packages
https://github.com/twigphp/Twig.git (GITHUB):
Affected version(s) =v4.0.0-alpha1 <v4.0.0-beta1Fix Suggestion:
Update to version v4.0.0-beta1https://github.com/twigphp/Twig.git (GITHUB):
Affected version(s) >=v3.15.0 <v3.31.0Fix Suggestion:
Update to version v3.31.0twig/twig (PHP):
Affected version(s) >=v3.15.0 <v3.31.0Fix Suggestion:
Update to version v3.31.0twig/twig (PHP):
Affected version(s) =v4.0.0-alpha1 <v4.0.0-beta1Fix Suggestion:
Update to version v4.0.0-beta1Related ResourcesĀ (7)
Do you need more information?
Contact UsCVSS v4
Base Score:
2.3
Attack Vector
NETWORK
Attack Complexity
LOW
Attack Requirements
PRESENT
Privileges Required
LOW
User Interaction
NONE
Vulnerable System Confidentiality
LOW
Vulnerable System Integrity
NONE
Vulnerable System Availability
NONE
Subsequent System Confidentiality
NONE
Subsequent System Integrity
NONE
Subsequent System Availability
NONE
CVSS v3
Base Score:
4.3
Attack Vector
NETWORK
Attack Complexity
LOW
Privileges Required
LOW
User Interaction
NONE
Scope
UNCHANGED
Confidentiality
LOW
Integrity
NONE
Availability
NONE
Weakness Type (CWE)
Incorrect Authorization
EPSS
Base Score:
0.53