Injection de code dans mermaid (CVE-2026-41148)
Résumé
Injection de code dans mermaid (CVE-2026-41148). Risque d'opérations non autorisées ou de divulgation. Exploitable via classDef. Atténuation : mise à jour vers 10.9.6 ou plus.
Description d'origine
La description telle que publiée par la source (souvent en anglais).
Mermaid is a JavaScript tool that uses Markdown-inspired text to create and modify diagrams and charts. Versions 10.9.5 and prior, in addition to 11.0.0-alpha.1 through 11.12.0 are vulnerable to CSS injection through improper sanitization. The state diagram (and any other diagram type that routes user-controlled style strings through the createCssStyles parser) captures classDef values using an unrestricted regex that matches everything up to a newline. That value then flows unsanitized through addStyleClass() into createCssStyles() and is assigned to style.innerHTML, so a closing brace (}) in the value terminates the generated CSS selector and turns everything after it into a new CSS rule on the page. This enables page defacement, user tracking via url() callbacks, and DOM attribute exfiltration. This issue has been fixed in versions 10.9.6 and 11.15.0. If developers are unable to immediately upgrade, they can work around this issue by setting "securityLevel": "sandbox", which prevents the issue by rendering the mermaid diagram in a sandboxed .
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-41148 a été découverte dans mermaid.
Des attaquants peuvent cibler un point d'entrée spécifique comme classDef à distance pour détourner le produit.
Risque d'opérations non autorisées ou de divulgation.
Action : mettez à jour mermaid vers 10.9.6 ou supérieur.
En cas de doute, contactez votre service informatique ou cherchez « mermaid CVE-2026-41148 » sur le site de l'éditeur.
CVE-2026-41148 (mermaid) — CWE-94
Surface d'attaque : classDef / style.innerHTML
Correctif : 10.9.6 — appliquer immédiatement
Contournement : Setting "securityLevel": "sandbox" will prevent this, by rendering the mermaid diagram in a sandboxed <iframe>.
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 exécution de code arbitraire (CWE-94) affecte mermaid. Les attaquants atteignent le code vulnérable via classDef.
Consultez l'avis de l'éditeur pour les versions affectées de mermaid. Surface d'attaque : classDef / style.innerHTML.
Gravité : ?. Risque d'opérations non autorisées ou de divulgation.
Mettre à jour vers 10.9.6.
Contournement : Setting "securityLevel": "sandbox" will prevent this, by rendering the mermaid diagram in a sandboxed <iframe>.
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 'mermaid' . | grep -v node_modulesリポジトリと本番環境の依存ファイル (package-lock.json / requirements.txt / go.sum / Gemfile.lock 等) で
mermaidを grep し、稼働しているサービス・バージョンを把握する。 -
2Apply temporary workaround mitigate
Setting [`"securityLevel": "sandbox"`](https://mermaid.js.org/config/schema-docs/config.html#securitylevel) will prevent this, by rendering the mermaid diagram in a sandboxed `<iframe>`.パッチが適用されるまでの応急処置として、Setting
"securityLevel": "sandbox"will prevent this, by rendering the mermaid diagram in a sandboxed<iframe>. を実施。回避策の副作用 (機能低下) を確認した上で。 -
3Apply patch patch
Upgrade mermaid to 10.9.6ステージング環境で 10.9.6 に上げて回帰テスト → 本番反映。回帰テストはアプリの主要ハッピーパスを含めること。
-
4Post-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-41148 node-mermaid
- Ubuntu UBUNTU-CVE-2026-41148 node-mermaid
Références
- advisory github.com
- advisory nvd.nist.gov
- advisory github.com
- package github.com
- patch github.com
- patch github.com
- web github.com
- web github.com
- web mermaid.js.org
- web github.com