cve.bz

CVE-2026-41148 mermaid-js mermaid: Code Injection

5.3 mediumEPSS 0.3%Fix available

Medium (5.3) in mermaid-js mermaid. EPSS 0.3% estimated probability of exploitation activity in the next 30 days. Fixed in mermaid 10.9.6, 11.15.0.

On this page
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 <iframe>.

Severity

CVSS 4.0

5.3 medium
CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:P/VC:N/VI:L/VA:N/SC:L/SI:L/SA:L
EPSS
0.3% (unchanged from 0.3% a week ago; 0.6% 30 days ago) estimated probability of exploitation activity in the next 30 days; 28th percentile. Scored 2026-11-22. A forecast for this CVE across the internet, not for your own systems.
CISA's assessment (SSVC)
Exploitation: none · Automatable: no · Technical impact: partial, assessed 2026-05-27. From CISA's Vulnrichment in the CVE List: whether it is exploited, whether exploiting it can be automated, and how much control it gives.
CWE
CWE-94 Improper Control of Generation of Code (Code Injection)
OWASP Top 10
A05:2025 Injection
Published
Modified
NVD analysis
Deferred: the NVD does not plan to analyze it
Record from
the NVD, synced

Fix and patched versions

  • mermaid (npm): fixed in 11.15.0, 10.9.6

Ask an AI about this CVE

Show the promptExplain CVE-2026-41148 for an engineer deciding whether to act. Use https://cve.bz/api/public/cves/CVE-2026-41148?via=ask-ai-copy and https://cve.bz/cve/CVE-2026-41148?via=ask-ai-copy as the source of truth: what is affected and which versions fix it, whether it is in CISA KEV, public exploits, and its EPSS (an internet-wide 30-day estimate of exploitation activity, not a forecast for my systems). If they give no fixed versions, use the CVE record https://cveawg.mitre.org/api/cve/CVE-2026-41148 or the vendor advisory, not third-party mirrors. Tell me how to check whether I am affected and how to verify a fix. Cite the sources and say where they are uncertain.

Opens a third-party assistant; its answer is its own, not cve.bz's. The prompt holds only this CVE's id and public links.

Affected

Versions

From the CNA's record in the CVE List.

ProductAffected
mermaid-js mermaid>= 11.0.0-alpha.1, < 11.15.0
mermaid-js mermaid< 10.9.6

Packages (OSV)

AdvisoryEcosystemPackageAffectedFixed in
GHSA-xcj9-5m2h-648rnpmmermaid>=11.0.0-alpha.1 <11.15.011.15.0
GHSA-xcj9-5m2h-648rnpmmermaid<10.9.610.9.6

Linux distributions

DistributionReleasePackageFixed inAdvisory
Debian14node-mermaidno fix listedDEBIAN-CVE-2026-41148
Ubuntu22.04:LTS, 26.10node-mermaidno fix listedUBUNTU-CVE-2026-41148

From the distributions' data via OSV.dev: the Debian Security Tracker; Ubuntu Security Notices © Canonical Ltd., CC BY-SA 4.0. Modified: reformatted and linked to CVE records. Credits. On the distributions' own pages: Debian · Ubuntu.

Red Hat

Red Hat rates this Moderate.

Red Hat's statement

This Moderate flaw in Mermaid, a JavaScript diagramming tool, allows for CSS injection due to insufficient sanitization of user-controlled style strings. An attacker could exploit this by crafting malicious input, leading to page defacement, user tracking, or exfiltration of DOM attributes. Successful exploitation requires user interaction with a specially crafted diagram. Red Hat products utilizing Mermaid, such as Red Hat Build of Podman Desktop and Red Hat OpenShift AI, are affected.

Red Hat's mitigation

To mitigate this issue, developers using Mermaid can configure the `securityLevel` option to `sandbox`. This setting renders Mermaid diagrams within a sandboxed iframe, preventing CSS injection attacks. Consult the Mermaid documentation for specific implementation details on setting configuration options.

ProductPackageStateAdvisory
Red Hat Build of Podman Desktoprh-podman-desktop.gitFix deferred
Red Hat OpenShift AI (RHOAI)rhoai/odh-workbench-codeserver-datascience-cpu-py312-rhel9Fix deferred

Contains Red Hat Security Data © Red Hat, Inc., licensed under CC BY 4.0. Source: https://access.redhat.com/security/data. Modified: reformatted. Red Hat's page for CVE-2026-41148.

Attack patterns (CAPEC)

  • CAPEC-35 Leverage Executable Code in Non-Executable Files Likelihood: High · Severity: Very High
  • CAPEC-77 Manipulating User-Controlled Variables Likelihood: High · Severity: Very High
  • CAPEC-242 Code Injection Likelihood: High · Severity: High

The attack patterns MITRE's CAPEC relates to this record's weaknesses, as MITRE names them. Credits.

References

Check your stackJSON