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

Source: https://junglewise.ai/threats/cve-2026-71436-mermaid-infinite-loop-in-xy-charts-axis-processing  
Publisher: Junglewise Threat Intelligence, https://junglewise.ai/threats  
Published: 2026-08-06. Updated: 2026-09-25  
License: CC BY 4.0 with a link back

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)](https://junglewise.ai/threats/technologies/mermaid). Vendors: [npm](https://junglewise.ai/threats/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

  ```sh
  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

- [https://github.com/mermaid-js/mermaid/security/advisories/GHSA-2v8p-3f2j-5mp7](https://github.com/mermaid-js/mermaid/security/advisories/GHSA-2v8p-3f2j-5mp7)
- [https://github.com/mermaid-js/mermaid/pull/8022](https://github.com/mermaid-js/mermaid/pull/8022)
- [https://github.com/mermaid-js/mermaid/commit/630aa7e5dd417e1f56bff2a1ce8df2c5ad08d289](https://github.com/mermaid-js/mermaid/commit/630aa7e5dd417e1f56bff2a1ce8df2c5ad08d289)
- [https://github.com/mermaid-js/mermaid/commit/ef60adc837d9d5107af21285f01e83dea309bd0a](https://github.com/mermaid-js/mermaid/commit/ef60adc837d9d5107af21285f01e83dea309bd0a)
- [https://github.com/mermaid-js/mermaid](https://github.com/mermaid-js/mermaid)
- [https://github.com/mermaid-js/mermaid/releases/tag/mermaid@11.16.1](https://github.com/mermaid-js/mermaid/releases/tag/mermaid@11.16.1)
- [https://github.com/mermaid-js/mermaid/releases/tag/v10.9.8](https://github.com/mermaid-js/mermaid/releases/tag/v10.9.8)

## Related threats

- [Mermaid radar diagrams denial of service via unchecked ticks input](https://junglewise.ai/threats/cve-2026-71439-mermaid-radar-diagrams-denial-of-service-via-unchecked-ticks)
- [Mermaid prototype pollution in configuration APIs](https://junglewise.ai/threats/cve-2026-71438-mermaid-prototype-pollution-in-configuration-apis)
- [Mermaid prototype pollution in architecture-beta diagrams](https://junglewise.ai/threats/cve-2026-71437-mermaid-prototype-pollution-in-architecture-beta-diagrams)
- [Mermaid CSS injection via sibling combinators](https://junglewise.ai/threats/cve-2026-50159-mermaid-css-injection-via-sibling-combinators)
- [Mermaid CSS injection via configuration options](https://junglewise.ai/threats/cve-2026-41159-mermaid-css-injection-via-configuration-options)
