CVE-2025-54881
JavaScript vulnerability analysis and mitigation

Overview

Mermaid, a JavaScript based diagramming and charting tool that uses Markdown-inspired text definitions and a renderer to create and modify complex diagrams, was found to have a critical security vulnerability in versions 10.9.0-rc.1 to 11.9.0. The vulnerability (CVE-2025-54881) was discovered on August 19, 2025, affecting the default configuration where user-supplied input for sequence diagram labels is passed to innerHTML during calculation of element size, leading to potential Cross-site Scripting (XSS) attacks (GitHub Advisory).

Technical details

The vulnerability exists in the calculateMathMLDimensions method, which was introduced in commit 5c69e5f. The issue occurs when sequence diagram node labels with KaTeX delimiters are processed. The method passes the full label to innerHTML without proper sanitization, allowing malicious users to inject arbitrary HTML when mermaid-js is used in its default configuration with KaTeX support enabled. The vulnerability has been assigned a CVSS v4.0 score of 5.3 MEDIUM with the vector string CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:P/VC:N/VI:N/VA:N/SC:L/SI:L/SA:N (NVD).

Impact

The vulnerability enables XSS attacks on all sites that use Mermaid and render user-supplied diagrams without additional sanitization. This could allow attackers to inject and execute malicious JavaScript code in the context of other users' browsers who view the affected diagrams (GitHub Advisory).

Mitigation and workarounds

The vulnerability has been patched in versions 10.9.4 and 11.10.0. The fix involves implementing proper sanitization of the text argument in the calculateMathMLDimensions method before it is passed to innerHTML. Users are strongly advised to upgrade to these patched versions to prevent potential XSS attacks (GitHub Advisory).

Additional resources


SourceThis report was generated using AI

Related JavaScript vulnerabilities:

CVE ID

Severity

Score

Technologies

Component name

CISA KEV exploit

Has fix

Published date

CVE-2025-67731HIGH8.7
  • JavaScriptJavaScript
  • servify-express
NoYesDec 12, 2025
CVE-2025-67718HIGH8.7
  • JavaScriptJavaScript
  • formio
NoYesDec 11, 2025
CVE-2025-65513HIGH7.5
  • JavaScriptJavaScript
  • mcp-fetch-server
NoNoDec 09, 2025
CVE-2025-67716MEDIUM5.7
  • JavaScriptJavaScript
  • @auth0/nextjs-auth0
NoYesDec 11, 2025
CVE-2025-67490MEDIUM5.4
  • JavaScriptJavaScript
  • @auth0/nextjs-auth0
NoYesDec 10, 2025

Free Vulnerability Assessment

Benchmark your Cloud Security Posture

Evaluate your cloud security practices across 9 security domains to benchmark your risk level and identify gaps in your defenses.

Request assessment

Get a personalized demo

Ready to see Wiz in action?

"Best User Experience I have ever seen, provides full visibility to cloud workloads."
David EstlickCISO
"Wiz provides a single pane of glass to see what is going on in our cloud environments."
Adam FletcherChief Security Officer
"We know that if Wiz identifies something as critical, it actually is."
Greg PoniatowskiHead of Threat and Vulnerability Management