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

Goal: 1000 CNY · Raised: 1359 CNY

100%

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

Quick assessment

Affected
mermaid-js mermaid
Exploitation
No confirmed in-the-wild exploitation; assess based on exposure
Recommended action
Check the vendor advisory and references for a fixed version. If immediate upgrade is impossible, restrict exposure and increase monitoring.

Mermaid是mermaid-js开源的一个应用软件。使用文本和代码创建图表和可视化。 Mermaid 10.9.5及之前版本和11.0.0-alpha.1版本至11.12.0版本存在代码注入漏洞,该漏洞源于清理不当,可能导致CSS注入。

AI Predicted 7.5 Difficulty: Easy EPSS 0.60% · P47

Affected Version Matrix 2

VendorProduct Version RangeStatus
mermaid-js mermaid >= 11.0.0-alpha.1, < 11.15.0 affected
< 10.9.6 affected
Get alerts for future matching vulnerabilities Log 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: CVE Program / CVE List V5
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: CVE Program / CVE List V5
CVSS Information
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
Source: CVE Program / CVE List V5
Vulnerability Type
对生成代码的控制不恰当(代码注入)
Source: CVE Program / CVE List V5
Vulnerability Title
Mermaid 代码注入漏洞
Source: CNNVD (China National Vulnerability Database)
Vulnerability Description
Mermaid是mermaid-js开源的一个应用软件。使用文本和代码创建图表和可视化。 Mermaid 10.9.5及之前版本和11.0.0-alpha.1版本至11.12.0版本存在代码注入漏洞,该漏洞源于清理不当,可能导致CSS注入。
Source: CNNVD (China National Vulnerability Database)
CVSS Information
N/A
Source: CNNVD (China National Vulnerability Database)
Vulnerability Type
N/A
Source: CNNVD (China National Vulnerability Database)

Affected Products

Vendor Product Affected Versions CPE Subscribe
mermaid-js mermaid >= 11.0.0-alpha.1, < 11.15.0 -

II. Public POCs for CVE-2026-41148

# POC Description Source Link Shenlong Link
AI-Generated POC Premium

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