# CVE-2026-133772 Sandbox Tag Allow-List Bypass via the Branch of a \`guard\` Tag That Isn't Selected

DevFeed: [CVE-2026-133772 Sandbox Tag Allow-List Bypass via the Branch of a \`guard\` Tag That Isn't Selected](<https://devfeed.tech/articles/cve-2026-133772-sandbox-tag-allow-list-bypass-via-the-branch-of-a-guard-tag-that-isn-t-selected-151633.md>)

Original publisher: [Read original article](<https://symfony.com/blog/cve-2026-133772-sandbox-tag-allow-list-bypass-via-the-branch-of-a-guard-tag-that-isn-t-selected>)

Author: Fabien Potencier

Published: 2026-11-24T11:54:00Z

Content type: release

Language: en

Sources: [Symfony](<https://devfeed.tech/sources/symfony-blog.md>)

Topics: [known exploitable vulnerabilities](<https://devfeed.tech/topics/known-exploitable-vulnerabilities.md>)

Tags: [3](<https://devfeed.tech/tags/3.md>), [allowed](<https://devfeed.tech/tags/allowed.md>), [block](<https://devfeed.tech/tags/block.md>), [blocks](<https://devfeed.tech/tags/blocks.md>), [branch](<https://devfeed.tech/tags/branch.md>), [define](<https://devfeed.tech/tags/define.md>), [doesn-t](<https://devfeed.tech/tags/doesn-t.md>), [exists](<https://devfeed.tech/tags/exists.md>), [fixed](<https://devfeed.tech/tags/fixed.md>), [guard](<https://devfeed.tech/tags/guard.md>), [isn-t](<https://devfeed.tech/tags/isn-t.md>), [issue](<https://devfeed.tech/tags/issue.md>), [its](<https://devfeed.tech/tags/its.md>), [one](<https://devfeed.tech/tags/one.md>), [other](<https://devfeed.tech/tags/other.md>), [sandbox](<https://devfeed.tech/tags/sandbox.md>), [security](<https://devfeed.tech/tags/security.md>), [tag](<https://devfeed.tech/tags/tag.md>), [this](<https://devfeed.tech/tags/this.md>), [twig](<https://devfeed.tech/tags/twig.md>)

## AI overview

Twig versions >=3.15.0 and <3.31.0 are affected; the issue is fixed in Twig 3.31.0. When a `guard` tag's callable-dependent branch is not compiled, tags in the other branch are still parsed and can register template effects. A sandbox policy that permits `guard` but disallows `extends`, `use`, `macro`, or `block` may therefore be bypassed to extend a template, import blocks, or define macros. Templates reached through this behavior come from the sandbox's loader and remain sandboxed.

## Source excerpt

Affected versions Twig versions >=3.15.0, <3.31.0 are affected by this security issue. The issue has been fixed in Twig 3.31.0. Description The guard tag compiles only one of its branches, depending on whether a callable exists. The other branch...