Advisory Database
  • Advisories
  • Dependency Scanning
  1. npm
  2. ›
  3. js-yaml
  4. ›
  5. CVE-2026-59870

CVE-2026-59870: js-yaml: Quadratic-complexity (O(n^2)) DoS via !!omap tag in YAML11_SCHEMA

July 20, 2026

js-yaml v5.x introduces YAML11_SCHEMA support with the !!omap (ordered map) tag. The omapTag.addItem() function performs a linear O(n) scan for duplicate key detection on every insertion, resulting in O(n^2) total time to parse a document with n omap entries. An attacker can send a small crafted YAML document to trigger a multi-second CPU stall in any application that uses yaml.load() with { schema: yaml.YAML11_SCHEMA }.

References

  • github.com/advisories/GHSA-724g-mxrg-4qvm
  • github.com/nodeca/js-yaml/commit/39f3211a2f01b3c6982710cf21434ab7060acefe
  • github.com/nodeca/js-yaml/releases/tag/5.2.1
  • github.com/nodeca/js-yaml/security/advisories/GHSA-724g-mxrg-4qvm
  • nvd.nist.gov/vuln/detail/CVE-2026-59870

Code Behaviors & Features

Detect and mitigate CVE-2026-59870 with GitLab Dependency Scanning

Secure your software supply chain by verifying that all open source dependencies used in your projects contain no disclosed vulnerabilities. Learn more about Dependency Scanning →

Affected versions

All versions starting from 5.0.0 before 5.2.1

Fixed versions

  • 5.2.1

Solution

Upgrade to version 5.2.1 or above.

Impact 5.3 MEDIUM

CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L

Learn more about CVSS

Weakness

  • CWE-407: Inefficient Algorithmic Complexity
  • CWE-770: Allocation of Resources Without Limits or Throttling

Source file

npm/js-yaml/CVE-2026-59870.yml

Spotted a mistake? Edit the file on GitLab.

  • Site Repo
  • About GitLab
  • Terms
  • Privacy Statement
  • Contact

Page generated Sat, 08 Aug 2026 00:17:36 +0000.