Bug 2583223 (CVE-2026-133772) - CVE-2026-133772 twig/twig: Twig: Sandbox policy bypass via uncompiled guard tag branches
Summary: CVE-2026-133772 twig/twig: Twig: Sandbox policy bypass via uncompiled guard t...
Keywords:
Status: NEW
Alias: CVE-2026-133772
Product: Security Response
Classification: Other
Component: vulnerability
Version: unspecified
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Product Security DevOps Team
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2026-11-24 13:21 UTC by OSIDB Bzimport
Modified: 2026-11-24 13:31 UTC (History)
0 users

Fixed In Version:
Clone Of:
Environment:
Last Closed:
Embargoed:


Attachments (Terms of Use)

Description OSIDB Bzimport 2026-11-24 13:21:47 UTC
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.


Note You need to log in before you can comment on or make changes to this bug.