Junglewise Threat Intelligence

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

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

Technologies: js-yaml (npm). Vendors: npm.

Executive brief

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.

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

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

Related threats