CVE-2026-133771
Last modified
CVE-2026-133771 is a low-severity vulnerability rated 2.3/10 on the CVSS scale. The escaper considered x.attr, x['key'] and x.method() safe whenever {% import ... as x %} appeared anywhere in the template. EPSS estimates a 0.67% chance of exploitation in the next 30 days.
Description
The escaper considered x.attr, x['key'] and x.method() safe whenever {% import ... as x %} appeared anywhere in the template. Macro calls haven't needed this rule since Twig 3.0. It only matched ordinary variables that have the name of an alias imported in another block or macro, and printed them without escaping: {% block header %}{% import _self as item %}{{ item.hello() }}{% endblock %} {% block content %}{% for item in items %}{{ item.body }}{% endfor %}{% endblock %} Here, item.body is printed raw. This leads to XSS when the value comes from an attacker. The same happens with an import in a macro and an argument of the same name in another macro. It also happens with a template-level import placed after the block that uses the name. The rule is removed. Macro calls through an alias are still considered safe.
Metrics
Weakness Enumeration
Affected Software
Source: CNA advisory (CVE.org). NVD analysis pending.
| Vendor | Product | Versions |
|---|---|---|
| Twig | twig/twig | < 3.31.0 |
References
Timeline
- Published
- Last Modified
- Status
- Awaiting Analysis
Frequently Asked Questions
What is CVE-2026-133771?
How severe is CVE-2026-133771?
How do I fix CVE-2026-133771?
How Strix Helps
- How Strix found a critical auth bypass in etcdStrix autonomously discovered a critical authentication bypass in etcd, later designated CVE-2026-33413.
- Autonomous PentestingAI agents that find and validate exploitable vulnerabilities like this one across your applications.
- PR ReviewsPentest every pull request so vulnerable code is caught before it ships to production.
- AI Penetration TestingHow AI-driven penetration testing continuously covers your attack surface.
Related CVEs from 2026
- CVE-2026-133766Since Twig 3.28.0, the sandbox skips the toString() check of…2.3
- CVE-2026-133767When the parent of an embed tag was an expression other than…5.3
- CVE-2026-133768The join filter converted a value that isn't iterable with (…5.3
- CVE-2026-133769Cva::apply() converted the values of variants, default varia…2.3
- CVE-2026-13377Improper Neutralization of Input During Web Page Generation …4.8
- CVE-2026-133770The sandbox allows every method of Twig\Markup objects, incl…2.1
- CVE-2026-133772The guard tag compiles only one of its branches, depending o…2.3
- CVE-2026-133773The html_to_markdown filter of twig/markdown-extra keeps an …2.3
- CVE-2026-133774A live component protected by #[IsGranted], on its class or …6.3
- CVE-2026-133775The fix for CVE-2026-55877 (GHSA-6v8j-33hc-mv84) sanitizes t…5.3
- CVE-2026-133776The fix for CVE-2026-55877 (GHSA-6v8j-33hc-mv84) sanitizes t…5.3
- CVE-2026-133777The fix for CVE-2026-55877 (GHSA-6v8j-33hc-mv84) sanitizes t…5.3
Are you affected by CVE-2026-133771?
Run a free Strix scan to check your systems for this vulnerability.
Scan your code nowSource: NVD / NIST
