1. Accueil
  2. Vulnérabilités
  3. CVE-2026-133771

CVE-2026-133771

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

Publiée le 24 nov. 2026 · modifiée le 1 déc. 2026 · Sources : NVD, CNA (éditeur ou attributeur), EPSS (FIRST)

Faible 22/100

Résumé

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.

Aucune traduction française : description d’origine affichée.

Produits et versions affectés

Twig (1 ligne(s))
Twig
ProduitVersionsCorrigé dansSource
twig/twig avant 3.31.0 (exclu) — CNA (éditeur ou attributeur)

Correctif

Non renseigné par l’éditeur.

Contournement

Aucun contournement renseigné.

Savoir si vous êtes touché

Aucune méthode de vérification renseignée.

Chronologie

  1. — Publication de la CVE (cve)

Références

Provenance des données

Statut
NVD
Date de publication
NVD
Description
CNA (éditeur ou attributeur)
Score CVSS
CNA (éditeur ou attributeur)
Faiblesse (CWE)
CNA (éditeur ou attributeur)
Vecteur CVSS
CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:P/VC:N/VI:N/VA:N/SC:L/SI:L/SA:N (CVSS 4.0, CNA:Symfony)
Faiblesse
CWE-79 · Script intersite (XSS)

Comment sont obtenues et calculées ces données