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

CVE-2026-59869: js-yaml: YAML merge-key chains can force quadratic CPU consumption

July 20, 2026

js-yaml can spend quadratic CPU time parsing a document whose size grows only linearly. The issue is triggered by a chain of mappings where each mapping merges the previous one:

a0: &a0 { k0: 0 }
a1: &a1 { <<: *a0, k1: 1 }
a2: &a2 { <<: *a1, k2: 2 }
a3: &a3 { <<: *a2, k3: 3 }
...
b: *aN

For each new mapping, the loader has to enumerate the keys inherited from the previous mapping. With N chained mappings, this results in roughly 1 + 2 + … + N merged-key visits, i.e., O(N^2) work for O(N) input size.

References

  • github.com/advisories/GHSA-52cp-r559-cp3m
  • github.com/nodeca/js-yaml/commit/24f13e79ee1343a7e30bd6f6c9d9cdbf0ac9b2b7
  • github.com/nodeca/js-yaml/commit/59423c6f8cdc78742ac00e25a4dd39ef16b702e4
  • github.com/nodeca/js-yaml/releases/tag/3.15.0
  • github.com/nodeca/js-yaml/releases/tag/4.3.0
  • github.com/nodeca/js-yaml/security/advisories/GHSA-52cp-r559-cp3m
  • nvd.nist.gov/vuln/detail/CVE-2026-59869

Code Behaviors & Features

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

Secure your software supply chain by verifying that all open source dependencies used in your projects contain no disclosed vulnerabilities. Dependency Scanning using SBOM also detects vulnerabilities from proprietary advisories that this site does not include. Learn more about Dependency Scanning using SBOM →

Affected versions

All versions starting from 3.0.0 before 3.15.0, all versions starting from 4.0.0 before 4.3.0

Fixed versions

  • 3.15.0
  • 4.3.0

Solution

Upgrade to versions 3.15.0, 4.3.0 or above.

Impact 7.5 HIGH

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

Learn more about CVSS

Weakness

  • CWE-400: Uncontrolled Resource Consumption
  • CWE-407: Inefficient Algorithmic Complexity

Source file

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

Spotted a mistake? Edit the file on GitLab.

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

Page generated Sun, 08 Nov 2026 00:15:46 +0000.