Goal Reached Thanks to every supporter — we hit 100%!

Goal: 1000 CNY · Raised: 1110 CNY

100%

CVE-2026-41148— Mermaid: Improper sanitization of `classDefs` in diagrams leads to CSS injection

AI Predicted 7.5 Difficulty: Easy EPSS 0.06% · P18

Affected Version Matrix 2

VendorProductVersion RangeStatus
mermaid-jsmermaid>= 11.0.0-alpha.1, < 11.15.0affected
< 10.9.6affected
Get alerts for future matching vulnerabilitiesLog in to subscribe

I. Basic Information for CVE-2026-41148

Vulnerability Information

Have questions about the vulnerability? See if Shenlong's analysis helps!
View Shenlong Deep Dive ↗

Although we use advanced large model technology, its output may still contain inaccurate or outdated information.Shenlong tries to ensure data accuracy, but please verify and judge based on the actual situation.

Vulnerability Title
Mermaid: Improper sanitization of `classDefs` in diagrams leads to CSS injection
Source: NVD (National Vulnerability Database)
Vulnerability Description
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>.
Source: NVD (National Vulnerability Database)
CVSS Information
N/A
Source: NVD (National Vulnerability Database)
Vulnerability Type
对生成代码的控制不恰当(代码注入)
Source: NVD (National Vulnerability Database)

Affected Products

VendorProductAffected VersionsCPESubscribe
mermaid-jsmermaid >= 11.0.0-alpha.1, < 11.15.0 -

II. Public POCs for CVE-2026-41148

#POC DescriptionSource LinkShenlong Link
AI-Generated POCPremium

No public POC found.

Login to generate AI POC

III. Intelligence Information for CVE-2026-41148

登录查看更多情报信息。

Patches & Fixes for CVE-2026-41148 (2)

Vendor Advisories for CVE-2026-41148 (1)

Vendor Pages for CVE-2026-41148 (2)

Other References for CVE-2026-41148 (1)

IV. Related Vulnerabilities

V. Comments for CVE-2026-41148

No comments yet


Leave a comment