CVE-2026-41148: Mermaid: Improper sanitization of `classDefs` in diagrams leads to CSS injection
Noroxi assessment
Priority: Monitor (action score 21/100)
- The sources we track (CISA KEV, Exploit-DB, Metasploit, Nuclei, GitHub) show no public exploit code or exploitation in the wild.
- Probability of exploitation in the next 30 days: 0.33% (FIRST EPSS).
- Anyone who can reach it over the internet can trigger it. No account or password is required. No special conditions are required; it is repeatable.
- Fixed version: mermaid (npm) 11.15.0, 10.9.6.
Low priority for now. Upgrade to mermaid (npm) 11.15.0, 10.9.6 or later.
Generated automatically from the record's data: CVSS (NVD and CNA), CISA KEV and SSVC, FIRST EPSS, exploit sources, fixed versions. How we calculate it
Primary sources: NVD · CVE.org · FIRST EPSS
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>.
- Published
- May 22, 2026
- Updated
- Jul 23, 2026
- EPSS
- 0.3% · 27th percentile
- CWE
- CWE-94
Report tools
Action score
21
Monitor
Low priority for now.
- CVSS
- 21 / 40 · 5.3 / 10
- CISA KEV
- 0 / 30 · Not listed
- EPSS
- 0 / 30 · 0.3%
CISA SSVC decision
- Exploitation
- none
- Automatable
- no
- Technical impact
- partial
Vulnrichment: CISA's decision-tree inputs.
CNA vs NVD score
- NVD
- —
- CNA · GitHub_M
- 5.3
- NVD has not scored this yet; the score shown is the CNA’s.
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
The score given by the assigning authority versus NVD’s independent score. A gap means the severity is contested.
Get told when this record changes
- Not in KEV: no record of exploitation in the wild
- No public exploit code on record
- A fix has been released
If any of these changes, we'll tell you in the daily email digest.
Running WordPress? Scan your site free with WP Lens
Noroxi analysis
What does it mean in your environment?
The assessment above is generated automatically from the record's data; it doesn't know your environment. Our team verifies on your systems whether this vulnerability is actually exploitable and which mitigation is enough.
We use this product, ask for helpAffected systems
Is your version affected?
Pick the product and type the version you run. It's compared with this record's version ranges in your browser; the version isn't sent anywhere.
—
Versions reported by the vendor
Affected version ranges reported by the assigning authority (GitHub_M). Independent of NVD's CPE analysis and usually ahead of it.
mermaid-js mermaid
- >= 11.0.0-alpha.1, < 11.15.0, < 10.9.6affected
Package-level exposure
OSV and GitHub Advisory data: ecosystem, package and range. SBOM matching uses this table.
| Ecosystem | Package | Affected range | Fix |
|---|---|---|---|
| Debian:14 | node-mermaid | from 0 | — |
| npm | mermaid | from 11.0.0-alpha.1 · before 11.15.0 | 11.15.0 |
| npm | mermaid | before 10.9.6 | 10.9.6 |
Same product
mermaid-js: all recordsOther highest-scoring records for the same primary product.
- CVE-2026-71437Mermaid Architecture diagrams are vulnerable to prototype pollution26Monitor
- CVE-2026-71439Mermaid radar diagrams are vulnerable to DoS21Monitor
- CVE-2026-71436Mermaid XY Charts are vulnerable to an infinite loop DoS21Monitor
Published before and after this one in the same product
- ← EarlierCVE-2025-54881Aug 19, 2025 · Mermaid improperly sanitizes of sequence diagram labels leading to XSS21Monitor
- Later →CVE-2026-41149May 22, 2026 · Mermaid: Improper sanitization of `classDef` in state diagrams leads to HTML injection21Monitor
- Later →CVE-2026-50159Aug 6, 2026 · Mermaid allows CSS injection applying to sibling elements of the diagram21Monitor
Remediation
Which version to upgrade to
Fix versions compiled from the vendor, package registries and Microsoft. Verify the vendor's note before upgrading.
| Product / package | Fixed version | Source |
|---|---|---|
| npm:mermaid | 10.9.6 | Package registry (OSV) |
| npm:mermaid | 11.15.0 | Package registry (OSV) |
Exploit status
No known public exploit
No public exploit has been observed yet. That doesn't mean you're safe, only that the bar is a little higher.
Research context
For pentesters and researchers: attack profile, score disagreement, timeline, patch commits, credits, variant and chain candidates, bug bounty scope. All derived from existing data; no exploit code.
Timeline
From publication to today: proof of concept, Metasploit module, CISA KEV and fix record. Dates are as reported by the sources.
No dated events beyond publication.
No history yet (it accumulates with the daily EPSS job).
Patch and commit links
Commit, PR and diff links among the references. A starting point for patch-diffing and variant hunting; fixes, not exploits.
Credits
All researchersFinders, reporters and analysts named in the CNA record. Click a name for that researcher’s other records.
No credits in the CNA record.
Variant candidates
Same product, same weakness class, within 18 months. If the patch missed the root cause, the sibling bug is here.
- CVE-2026-411490 days apartMermaid: Improper sanitization of `classDef` in state diagrams leads to HTML injection21Monitor
- CVE-2026-5015976 days apartMermaid allows CSS injection applying to sibling elements of the diagram21Monitor
Chain candidates
An authentication bypass and a privilege-requiring bug in the same product, published close together: combined they may become an unauthenticated path.
—
Bug bounty scope
No known public program.
Source: bounty-targets-data (public HackerOne, Bugcrowd, Intigriti, YesWeHack listings).
Technical details
Attack conditions
- Anyone who can reach it over the internet can trigger it.
- No account or password is required.
- No special conditions are required; it is repeatable.
If successful
- Confidentiality
- Integrity
- Availability
- Attack vector
- Network
- Attack complexity
- Low
- Privileges required
- None
- User interaction
- P
- Scope
- X
Weakness class (CWE)
CWE-94 · Improper Control of Generation of Code ('Code Injection')CVSS vector
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/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X
nvd-secondary
Attack context
MITRE CAPEC attack patterns and ATT&CK techniques for this weakness class (CWE). A starting point for detection rules and threat hunting.
Attack patterns (CAPEC)
Change log
- Fix✗ → ✓
For records you follow, these changes also arrive as notifications. →
References
Show all references (5 more)Show less
- github.com/mermaid-js/mermaid/commit/e9b0f34d8d82a6260077764ee45e1d7d90957a0f
- github.com/mermaid-js/mermaid/releases/tag/mermaid%4011.15.0
- github.com/mermaid-js/mermaid/releases/tag/v10.9.6
- github.com/mermaid-js/mermaid/security/advisories/GHSA-xcj9-5m2h-648r
- mermaid.js.org/config/schema-docs/config.html#securitylevel
Vendor advisories and official records. Exploit/PoC links are deliberately left out.