Vulnérabilité dans twig/twig (CVE-2026-48807)
Résumé
Vulnérabilité dans twig/twig (CVE-2026-48807). Des informations confidentielles peuvent être exposées. Exploitable via Traversable. 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
This is a residual bypass of CVE-2026-47732 / GHSA-pr2w-4gpj-cpq4 left after the initial fix for unguarded __toString() calls. It covers two related coercion points that were not caught by the original patch.
Traversable in join and replace filters. SandboxExtension::ensureToStringAllowed() recurses into PHP arrays so that a Stringable object hidden inside an array argument cannot be string-coerced without consulting the security policy. The recursion stops at PHP arrays: a Traversable value passed at the same position is not materialised, so its contents are not policy-checked. CoreExtension::join() and CoreExtension::replace() later materialise such Traversable inputs through self::toArray() and feed them to implode() / strtr(), both of which implicitly call __toString() on contained Stringable objects. The bypass also reproduces when the container implements both Stringable and Traversable: the container's own __toString() is policy-checked, but the elements yielded by getIterator() are not, and the consuming filters still coerce them to string.
in and not in operators. InBinary and NotInBinary compile to CoreExtension::inFilter(), which falls through to PHP's <=> operator when comparing a string with a Stringable object. PHP coerces the object to string via __toString() without the sandbox policy being consulted. Beyond the direct side effect, in can also be used as a content-leak oracle: e…
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-48807 a été découverte dans twig/twig.
Des attaquants peuvent cibler un point d'entrée spécifique comme Traversable à distance pour détourner le produit.
Des informations confidentielles peuvent être exposées. Score CVSS : 9.1/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-48807 » sur le site de l'éditeur.
CVE-2026-48807 (twig/twig) — CWE-693 / CVSS v3 9.1
Vecteur d'attaque : distant (réseau) / non authentifié / sans interaction utilisateur
Surface d'attaque : Traversable / join / replace / Stringable
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 Traversable sans authentification.
Consultez l'avis de l'éditeur pour les versions affectées de twig/twig. Surface d'attaque : Traversable / join / replace / Stringable.
Gravité : Critique (CVSS 9.1/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
- Debian DEBIAN-CVE-2026-48807 php-twig Corrigé dans: 3.27.0-1
- Ubuntu UBUNTU-CVE-2026-48807 php-twig
Références
- package github.com
- web github.com
- web github.com
- web github.com
- web symfony.com
- web github.com