PatchSiren

PatchSiren cyber security CVE debrief

CVE-2026-133771 Twig CVE debrief

A vulnerability in Twig, a templating engine for PHP, allows for missing autoescaping of variables named like macro import aliases in certain scopes. This oversight potentially leads to cross-site scripting (XSS) attacks when variable values originate from an attacker. The vulnerability is particularly concerning in applications that utilize user-input data. Defenders and developers using Twig, especially those maintaining applications with user-input data, should assess exposure and prioritize updates to prevent potential XSS attacks. The vulnerability occurs when using macro import aliases in certain scopes, allowing variables to be printed without proper escaping. This issue is

Vendor
Twig
Product
twig/twig
CVSS
LOW 2.3
CISA KEV
Not listed in stored evidence
Original CVE published
2026-11-24
Original CVE updated
2026-11-24
Advisory published
2026-11-24
Advisory updated
2026-11-24

Who should care

Defenders and developers using Twig, especially those maintaining applications with user-input data, should assess exposure and prioritize updates to prevent potential XSS attacks. This includes reviewing and updating templates to ensure proper autoescaping, monitoring applications for potential XSS attacks, and verifying the integrity of user-input data. The vulnerability affects applications that utilize user-input data, making it essential for defenders

Why it matters

Defenders should prioritize verifying and updating Twig installations to prevent potential XSS attacks, especially in applications using affected versions and processing user-input data.

  • Potential for cross-site scripting (XSS) attacks when variable values come from an attacker
  • Need for verification and updates to Twig installations to prevent exploitation
  • Importance of reviewing and updating templates to ensure proper autoescaping

Technical summary

The vulnerability occurs when using macro import aliases in certain scopes, allowing variables to be printed without proper escaping, potentially leading to XSS attacks. This issue arises from the interaction between macro calls and variable names, particularly when the variable name matches an alias imported in another block or macro. The vulnerability has been addressed in Twig version 3.31.0. Defenders should prioritize verifying and updating Twig installations to prevent potential XSS attacks, especially in applications using affected versions and processing user-input data. The technical impact of this vulnerability is significant, as it can lead to XSS attacks when variable values come from an attacker.

Defensive priority

Defenders should prioritize verifying and updating Twig installations to prevent potential XSS attacks, especially in applications using affected versions.

Recommended defensive actions

  • Verify and update Twig installations to version 3.31.0 or later
  • Review and update templates to ensure proper use of autoescaping
  • Monitor applications for potential XSS attacks
  • Confirm whether affected product deployments exist in managed environments and assign an owner for follow-up
  • Review compensating controls for exposed systems while remediation is scheduled and verified
  • Check relevant monitoring, detection, and logs for exposed assets that need extra review
  • Track exceptions, retest remediated assets, and close the item only after evidence is documented

Evidence notes

The CVE record and source item provide details on the vulnerability, including its description, affected versions, and references to vendor advisories and patches. The vulnerability is caused by a missing autoescaping feature for variables named like macro import aliases in certain scopes. This feature omission allows variables to be printed without proper escaping, potentially leading to XSS attacks. The CVE Program record (cve-org) and the NIST NVD detail page (nvd) offer additional information on the vulnerability. The source item

Sources and references

Verified primary and authoritative sources

  • CVE-2026-133771 CVE Program record

    Publisher, destination, and source semantics verified

    URL: https://www.cve.org/CVERecord?id=CVE-2026-133771

    CVE Program - Official CVE Program record with source-provided CVE metadata.

  • CVE-2026-133771 NVD vulnerability detail

    Publisher, destination, and source semantics verified

    URL: https://nvd.nist.gov/vuln/detail/CVE-2026-133771

    NIST National Vulnerability Database - Official NIST NVD detail page and source-specific vulnerability assessment.

Supplemental references

  • Missing autoescaping for a variable named like a macro import alias of another scope

    Unverified legacy reference

    URL: https://raw.githubusercontent.com/CVEProject/cvelistV5/main/cves/2026/133xxx/CVE-2026-133771.json

    cve_program_cvelist_v5

  • Source reference

    Unverified legacy reference

    URL: https://symfony.com/cve-2026-133771

    Supplemental source - vendor-advisory

  • Source reference

    Unverified legacy reference

    URL: https://github.com/twigphp/Twig/security/advisories/GHSA-63v2-9rx5-wjgr

    Supplemental source - vendor-advisory

  • Source reference

    Unverified legacy reference

    URL: https://github.com/twigphp/Twig/commit/3a6745a0d88048474457fa2e69968ebd5267dd5a

    Supplemental source - patch

Methodology and review provenance

AI-assisted synthesis based on stored public vulnerability evidence. System validation, approval state, and publication status do not by themselves establish human review of this revision. PatchSiren helps prioritize defensive review and does not prove exposure or remediation on any system.