# CVE-2026-59868: js-yaml denial of service via quadratic CPU consumption in merge keys

Source: https://junglewise.ai/threats/cve-2026-59868-js-yaml-denial-of-service-via-quadratic-cpu-consumption-in-merge  
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-59868 · Severity: medium · CVSS 5.3 · Published 2026-07-08

A vulnerability in the js-yaml library, which is used to parse YAML configuration files, can allow an attacker to crash or slow down an application. By providing a specially crafted YAML file with complex 'merge key' chains, an attacker can force the system to consume excessive processor power. This can lead to a denial-of-service (DoS) condition, making the affected service unavailable to legitimate users.

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

## Quick answers

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

**How severe is CVE-2026-59868?** 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.1.0, SEMVER:introduced=5.0.0,fixed=5.2.0.

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

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

**Am I affected by CVE-2026-59868?** 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.0 or later

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


## Technical details

The js-yaml library (v5.x) is susceptible to an algorithmic complexity vulnerability (CWE-407) when processing YAML merge keys (<<). When merge keys are enabled, a chain of mappings where each mapping merges the previous one causes the loader to repeatedly enumerate inherited keys. This results in O(N^2) CPU work for an O(N) input size. An attacker can exploit this by submitting a relatively small YAML document (e.g., <100KB) that requires significant processing time, leading to uncontrolled resource consumption (CWE-400). The vulnerability is mitigated in version 5.2.0 by implementing a limit on the total number of merged keys per parse call.

## Affected products

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

## Identifiers

- CVE-2026-59868
- GHSA-g796-fgmg-93mv

## Timeline

- 2026-07-02: disclosed: Vulnerability published to nodeca/js-yaml
- 2026-07-08: advisory: Published to the National Vulnerability Database (NVD)
- 2026-07-20: patched: GitHub Advisory reviewed and updated with patch information

## References

- [https://api.github.com/users/mazze93](https://api.github.com/users/mazze93)
- [https://github.com/mazze93](https://github.com/mazze93)
- [https://api.github.com/users/mazze93/gists%7B/gist_id%7D](https://api.github.com/users/mazze93/gists%7B/gist_id%7D)
- [https://api.github.com/users/mazze93/repos](https://api.github.com/users/mazze93/repos)
- [https://avatars.githubusercontent.com/u/225266999?v=4](https://avatars.githubusercontent.com/u/225266999?v=4)
- [https://api.github.com/users/mazze93/events%7B/privacy%7D](https://api.github.com/users/mazze93/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 in YAML11_SCHEMA omap parsing](https://junglewise.ai/threats/cve-2026-59870-nodeca-js-yaml-denial-of-service-in-yaml11-schema-omap-parsing)
