Vulnérabilité dans twig/twig (CVE-2026-49981)
Résumé
Vulnérabilité dans twig/twig (CVE-2026-49981). Des informations confidentielles peuvent être exposées. Exploitable via Template. Atténuation : mise à jour vers 3.27.0 ou plus.
Description d'origine
La description telle que publiée par la source (souvent en anglais).
Description
The per-template filter, tag and function allow-list check is compiled into the checkSecurity() method of each Template subclass and was invoked once from the constructor, gated by SandboxExtension::isSandboxed($source). Template instances are then cached on the Environment in $loadedTemplates, so the verdict computed at construction time was sticky for the rest of the process.
Any later change of sandbox state on the same Environment left that cached verdict in place: toggling SandboxExtension::enableSandbox()/disableSandbox(), swapping the policy via setSecurityPolicy(), a SourcePolicyInterface decision flip, or simply having a parent, macro or included template pre-instantiated outside the sandbox before a sandboxed render reached it. In all of these cases, the filters, tags and functions used by the affected template kept running with the original (typically empty) check, bypassing the SecurityPolicy allow-list.
Method, property and __toString allow-lists are not affected: they are enforced at every call site at runtime through SandboxExtension::checkMethodAllowed(), checkPropertyAllowed() and ensureToStringAllowed(), which re-read the current state on every call.
Long-lived workers (FrankenPHP, RoadRunner, Symfony Messenger consumers, FPM with hot autoloading) that share a single Environment between sandboxed and non-sandboxed renders are the most exposed: a single non-sandboxed render of a shared layout pre-warms its…
Source: GitHub Security Advisories (Global) NVD GitHub Advisory
Résumé généré automatiquement
Assemblé par SecPulse à partir des données sources (CVSS, CWE, versions affectées) à l'aide de modèles, sans IA. Vérifiez la description d'origine et les références ci-dessous.
Une vulnérabilité référencée CVE-2026-49981 a été découverte dans twig/twig.
Des attaquants peuvent cibler un point d'entrée spécifique comme Template à distance pour détourner le produit.
Des informations confidentielles peuvent être exposées. Score CVSS : 8.2/10.
Action : mettez à jour twig/twig vers 3.27.0 ou supérieur.
En cas de doute, contactez votre service informatique ou cherchez « twig/twig CVE-2026-49981 » sur le site de l'éditeur.
CVE-2026-49981 (twig/twig) — CWE-693 / CVSS v3 8.2
Vecteur d'attaque : distant (réseau) / non authentifié / sans interaction utilisateur
Surface d'attaque : Template / Environment / SourcePolicyInterface / SecurityPolicy
Correctif : 3.27.0 — appliquer immédiatement
Plan : 1) Audit SBOM, 2) Mise à jour staging→prod, 3) Surveillance WAF/proxy sur les endpoints affectés, 4) Recherche d'IOC dans les logs.
Réfs : voir GHSA / avis éditeur / version corrigée liés sur cette page.
Une vulnérabilité (CWE-693) affecte twig/twig. Les attaquants atteignent le code vulnérable via Template sans authentification.
Consultez l'avis de l'éditeur pour les versions affectées de twig/twig. Surface d'attaque : Template / Environment / SourcePolicyInterface / SecurityPolicy.
Gravité : Élevée (CVSS 8.2/10). Des informations confidentielles peuvent être exposées.
Mettre à jour vers 3.27.0.
En attendant le correctif : désactivez la fonctionnalité concernée, appliquez des règles WAF, ou restreignez l'accès par ACL réseau.
Recherchez dans les logs des requêtes correspondant aux IOC connus de cette CVE. Auditez les SBOM/dépendances.
Actions de réponse
Étapes concrètes et exemples de commandes que les équipes SOC/SRE doivent exécuter dans l'ordre
-
1Identify exposure identify
grep -r 'twig/twig' . | grep -v node_modulesリポジトリと本番環境の依存ファイル (package-lock.json / requirements.txt / go.sum / Gemfile.lock 等) で
twig/twigを grep し、稼働しているサービス・バージョンを把握する。 -
2Apply patch patch
Upgrade twig/twig to 3.27.0ステージング環境で 3.27.0 に上げて回帰テスト → 本番反映。回帰テストはアプリの主要ハッピーパスを含めること。
-
3Post-deployment verification verify
Confirm patched version is live in productionパッチ適用後、ステージングで PoC または同等の悪用パターンを再現して脆弱性が閉じたことを確認。本番ではアクセスログ・WAF でアラート再発が無いか継続監視。
Paquets affectés
État des correctifs par distribution
Paquets corrigés publiés par chaque distribution pour cette CVE
- Ubuntu UBUNTU-CVE-2026-49981 twig
Références
- package github.com
- patch security-advisories@github.com
- web github.com
- web github.com
- web github.com