# CVE-2026-59870: nodeca js-yaml denial of service in YAML11_SCHEMA omap parsing

Source: https://junglewise.ai/threats/cve-2026-59870-nodeca-js-yaml-denial-of-service-in-yaml11-schema-omap-parsing  
Publisher: Junglewise Threat Intelligence, https://junglewise.ai/threats  
Published: 2026-07-08. Updated: 2026-07-20  
License: CC BY 4.0 with a link back

CVE-2026-59870 · Severity: medium · CVSS 5.3 · Published 2026-07-08

A performance vulnerability in the js-yaml library can allow an attacker to crash or slow down an application by sending a specially crafted YAML file. This library is commonly used to read configuration files and data; an exploit would block the application from processing other requests, leading to a denial of service.

Technologies: [js-yaml (npm)](https://junglewise.ai/threats/technologies/js-yaml). Vendors: [npm](https://junglewise.ai/threats/vendors/npm).

## Quick answers

**Is CVE-2026-59870 exploited in the wild?** No. Junglewise Threat Intelligence has no report of CVE-2026-59870 being exploited in the wild.

**How severe is CVE-2026-59870?** Medium severity, with a CVSS score of 5.3, published 8 July 2026.

**Which products and versions are affected?** js-yaml (npm) >= 5.0.0, <= 5.2.0, SEMVER:introduced=5.0.0,fixed=5.2.1.

**Is there a fix for CVE-2026-59870?** Yes. js-yaml (npm): upgrade to 5.2.1 or later. Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.

**How is CVE-2026-59870 attacked?** It is attacked over the network, in a software library.

**Am I affected by CVE-2026-59870?** Check whether you run js-yaml (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

- js-yaml (npm): upgrade to 5.2.1 or later

  ```sh
  npm install js-yaml@5.2.1
  ```


## Technical details

The vulnerability exists in the `omapTag.addItem()` function within `src/tag/sequence/omap.ts`. When parsing a YAML document using `YAML11_SCHEMA`, the library performs a linear O(n) scan for duplicate keys upon every insertion into an ordered map, resulting in quadratic O(n^2) time complexity. A remote attacker can provide a crafted YAML payload (e.g., 50,000 entries in a 2MB file) to block the Node.js event loop for several seconds, causing a Denial of Service. This issue was introduced in version 5.0.0 and is fixed in version 5.2.1 by implementing a Set-based lookup for duplicate detection.

## Affected products

- nodeca js-yaml >= 5.0.0, <= 5.2.0

## Identifiers

- CVE-2026-59870
- GHSA-724g-mxrg-4qvm

## Timeline

- 2026-06-20: other: Vulnerable 5.x series first published
- 2026-07-02: patched: Fix released in version 5.2.1
- 2026-07-08: advisory: NVD publication date
- 2026-07-20: advisory: GitHub Advisory published

## References

- [https://api.github.com/users/usama0x01](https://api.github.com/users/usama0x01)
- [https://github.com/usama0x01](https://github.com/usama0x01)
- [https://api.github.com/users/usama0x01/gists%7B/gist_id%7D](https://api.github.com/users/usama0x01/gists%7B/gist_id%7D)
- [https://api.github.com/users/usama0x01/repos](https://api.github.com/users/usama0x01/repos)
- [https://avatars.githubusercontent.com/u/58225989?v=4](https://avatars.githubusercontent.com/u/58225989?v=4)
- [https://api.github.com/users/usama0x01/events%7B/privacy%7D](https://api.github.com/users/usama0x01/events%7B/privacy%7D)

## Related threats

- [js-yaml CPU exhaustion via merge keys with empty mappings](https://junglewise.ai/threats/js-yaml-maxtotalmergekeys-does-not-limit-cpu-use-for-empty-merge-e18172a3)
- [js-yaml YAML merge CPU consumption DoS](https://junglewise.ai/threats/cve-2026-84375-js-yaml-denial-of-service-via-empty-merge-sources)
- [js-yaml exponential parsing time in flow collections denial of service](https://junglewise.ai/threats/cve-2026-73643-js-yaml-exponential-parsing-time-in-flow-collections-denial-of)
- [JS-YAML quadratic CPU consumption in !!omap resolution](https://junglewise.ai/threats/js-yaml-quadratic-cpu-consumption-in-omap-resolution-f21ac1bd)
- [nodeca js-yaml denial of service via merge key chains](https://junglewise.ai/threats/cve-2026-59869-nodeca-js-yaml-denial-of-service-via-merge-key-chains)
