CVE-2026-71436: Mermaid infinite loop in XY Charts axis processing

CVE-2026-71436 · Severity: medium · CVSS 4 · Published 2026-08-06

Mermaid is a popular JavaScript library for generating diagrams from text. Its XY Chart feature is vulnerable to a denial-of-service attack when processing malformed axis configuration. An attacker can craft a specially-formatted diagram that causes the application to enter an infinite loop, consuming memory until the process crashes or becomes unresponsive, disrupting service availability for all users.

Technologies: mermaid (npm). Vendors: npm.

Quick answers

Is CVE-2026-71436 exploited in the wild?
No. Junglewise Threat Intelligence has no report of CVE-2026-71436 being exploited in the wild.
How severe is CVE-2026-71436?
Medium severity, with a CVSS score of 4, published 6 August 2026.
Which products and versions are affected?
mermaid (npm) SEMVER:introduced=10.6.0,fixed=10.9.8.
Is there a fix for CVE-2026-71436?
Yes. mermaid (npm): upgrade to 10.9.8 or later. Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.
How is CVE-2026-71436 attacked?
It is attacked over the network, in a software library.
Am I affected by CVE-2026-71436?
Check whether you run mermaid (npm) at an affected version. Junglewise does that check for you around the clock: connect your code, cloud and domains, and it matches new vulnerabilities like this one against what you actually run and tells you when one reaches you.

How to fix

  • mermaid (npm): upgrade to 10.9.8 or later
    npm install mermaid@10.9.8

Technical details

The vulnerability exists in Mermaid's XY Chart rendering component, specifically in the setXAxisRangeData() function. When an X-axis is configured with invalid parameters (e.g., a zero-width range such as "1 --> 1"), the function enters an infinite loop that continuously appends elements to an array without a valid exit condition (CWE-835). Each iteration allocates memory, eventually causing a RangeError: Invalid array length or triggering garbage collection failures, leading to out-of-memory crashes. The vulnerability is triggered client-side when a user views a malicious diagram, requiring only passive user interaction (viewing a page). No authentication or elevated privileges are required. The attack vector is network-based; an attacker can embed the malicious diagram syntax in a web application or document. Patches have been released in Mermaid v11.16.1 (main branch) and v10.9.8 (v10 branch), implementing proper bounds checking and support for zero-width x-axis ranges.

Affected products

  • mermaid-js mermaid >=10.6.0, <=10.9.7; >=11.0.0-alpha.1, <=11.16.0

Identifiers

  • CVE-2026-71436
  • GHSA-2v8p-3f2j-5mp7

Timeline

  • 2026-08-06: disclosed
  • 2026-08-06: patched: Patched in v11.16.1 and v10.9.8

References

This page as Markdown. Free to reuse under CC BY 4.0 with a link back.