All vulnerabilities

npm

GHSA-5p4m-2wfm-xmqj

JS-YAML: Quadratic CPU consumption in !!omap resolution (3.x and 4.x) — CVE-2026-59870 fix not backported

Severity
High 7.5
Published
6 Aug 2026
Last changed
10 Sept 2026
Added to UpHeron
22 Oct 2026
Fixed in
3.15.1, 4.3.1
Weakness
Inefficient algorithmic complexity (CWE-407)
Attack
Over the network · No login needed · No user action needed
Attacker can
Take it down
CVSS vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
Sources
OSV.dev and GitHub

Description

resolveYamlOmap() enforces key uniqueness for !!omap sequences with a linear scan (objectKeys.indexOf(...)) inside the per-element loop, making resolution O(n²) in the number of entries. A modestly sized YAML document therefore consumes disproportionate CPU inside yaml.load(), giving a denial of service against any consumer that parses untrusted YAML.

!!omap is registered in the default schema (lib/schema/default.js → require('../type/omap')), so a plain yaml.load(untrustedInput) with no options is affected — no custom schema or non-default configuration is required.

This is the same weakness as CVE-2026-59870 / GHSA-724g-mxrg-4qvm, which was fixed in the 5.x line in 5.2.1. That fix was never backported: both currently maintained legacy lines still carry the original implementation.

lib/type/omap.js (js-yaml 4.3.0):

objectKeys grows by one element per entry, and Array.prototype.indexOf is a linear scan, so resolving an n-entry !!omap performs roughly 1 + 2 + … + n comparisons —…

From the GitHub Advisory Database, CC BY 4.0. Shortened; the full text is there.

Affected software

SoftwareAffected versions
js-yamlnpm · osv:npm:js-yaml
  • From 3.0.0 before 3.15.1
  • From 4.0.0 before 4.3.1

About js-yaml

Weekly downloads (npm)
399,660,092npm, 17 Nov 2026

Vulnerabilities in js-yaml

In our list
4
Published in the last 12 months
4
Critical, last 12 months
0
High, last 12 months
3
Known exploited
0
Search the list for js-yaml

References