Description
js-yaml is a JavaScript YAML parser and dumper. Prior to 3.15.1, 4.3.1, and 5.2.1, YAML11_SCHEMA support for the !!omap tag in src/tag/sequence/omap.ts uses omapTag.addItem() to perform a linear duplicate-key scan on every insertion, causing O(n^2) CPU consumption when yaml.load() parses a crafted ordered-map document. In v3 and v4, !!omap is active and exploitable by default. v5 doesn't use !!omap by default, and the chances of activating it are very low.This issue is fixed in 3.15.1, 4.3.1, and 5.2.1.
Published: 2026-07-08
Score: 7.5 High
EPSS: < 1% Very Low
KEV: No
Impact: Denial of Service via quadratic CPU consumption
Action: Patch
AI Analysis

Impact

The vulnerability in js‑yaml arises from how the !!omap tag is parsed under YAML11_SCHEMA. In versions prior to 3.15.1, 4.3.1, and 5.2.1, every insertion of an ordered‑map item triggers a linear duplicate‑key scan, which results in an overall O(n^2) CPU cost when yaml.load() processes a crafted document. In v5 the !!omap tag is not enabled by default, and the chances of activating it are very low, but if it is enabled the same quadratic complexity can be triggered. An attacker can supply a YAML file with many ordered‑map entries to exhaust CPU resources, leading to a denial‑of‑service condition. The flaw is characterized by CWE‑407 and CWE‑770, and no remote code execution or information disclosure paths are exposed.

Affected Systems

The flaw affects the nodeca js‑yaml package across multiple major releases: all versions prior to 3.15.1, all versions prior to 4.3.1, and all versions prior to 5.2.1. Any application or service that includes one of these vulnerable versions—directly or through a dependency chain—operating in any JavaScript environment (Node.js, browser, etc.) is vulnerable when it processes YAML input with YAML11_SCHEMA support for the !!omap tag. In v5 the !!omap tag is not enabled by default, but can be activated and would trigger the same quadratic logic; thus it is considered lower risk but still exploitable if enabled.

Risk and Exploitability

The CVSS score of 7.5 reflects a high severity, and the EPSS score, currently less than 1%, indicates a very low but non‑zero exploitation probability. The vulnerability is not listed in CISA KEV. Exploitation requires the attacker to supply a crafted YAML document to any code path that invokes yaml.load(); therefore the attack vector is likely local or through an application that accepts user‑supplied YAML. Although no publicly disclosed exploit code exists, the DoS impact could degrade service availability in production deployments if a high‑volume ordered‑map payload is delivered.

Generated by OpenCVE AI on October 7, 2026 at 08:49 UTC.

Remediation

No solution or workaround provided in the CVE record.

OpenCVE Recommended Actions

  • Upgrade js‑yaml to version 5.2.1 or later, which removes the quadratic duplicate‑key disable YAML11_SCHEMA support or configures the parser to skip !!omap tag processing so the expensive path is avoided.
  • Sanitize all user‑supplied YAML documents before calling yaml.load(), rejecting input that exceeds a safe size or complexity threshold.
  • If upgrading is not immediately possible, configure the parser to use a safer schema (e.g., BASELINE_SCHEMA) or disable YAML11_SCHEMA support entirely, preventing the !!omap tag from invoking the quadratic logic.

Generated by OpenCVE AI on October 7, 2026 at 08:49 UTC.

Tracking

Sign in to view the affected projects.

Advisories
Source ID Title
Github GHSA Github GHSA GHSA-724g-mxrg-4qvm js-yaml: Quadratic-complexity (O(n^2)) DoS via !!omap tag in YAML11_SCHEMA
History

Tue, 06 Oct 2026 15:30:00 +0000

Type Values Removed Values Added
Description js-yaml is a JavaScript YAML parser and dumper. From 5.0.0 before 5.2.1, YAML11_SCHEMA support for the !!omap tag in src/tag/sequence/omap.ts uses omapTag.addItem() to perform a linear duplicate-key scan on every insertion, causing O(n^2) CPU consumption when yaml.load() parses a crafted ordered-map document. This issue is fixed in version 5.2.1. js-yaml is a JavaScript YAML parser and dumper. Prior to 3.15.1, 4.3.1, and 5.2.1, YAML11_SCHEMA support for the !!omap tag in src/tag/sequence/omap.ts uses omapTag.addItem() to perform a linear duplicate-key scan on every insertion, causing O(n^2) CPU consumption when yaml.load() parses a crafted ordered-map document. In v3 and v4, !!omap is active and exploitable by default. v5 doesn't use !!omap by default, and the chances of activating it are very low.This issue is fixed in 3.15.1, 4.3.1, and 5.2.1.
References
Metrics cvssV3_1

{'score': 5.3, 'vector': 'CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L'}

cvssV3_1

{'score': 7.5, 'vector': 'CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H'}


Thu, 09 Jul 2026 12:15:00 +0000

Type Values Removed Values Added
Weaknesses CWE-770
References
Metrics threat_severity

None

threat_severity

Important


Wed, 08 Jul 2026 17:30:00 +0000

Type Values Removed Values Added
First Time appeared Nodeca
Nodeca js-yaml
Vendors & Products Nodeca
Nodeca js-yaml
Metrics ssvc

{'options': {'Automatable': 'yes', 'Exploitation': 'poc', 'Technical Impact': 'partial'}, 'version': '2.0.3'}


Wed, 08 Jul 2026 15:45:00 +0000

Type Values Removed Values Added
Description js-yaml is a JavaScript YAML parser and dumper. From 5.0.0 before 5.2.1, YAML11_SCHEMA support for the !!omap tag in src/tag/sequence/omap.ts uses omapTag.addItem() to perform a linear duplicate-key scan on every insertion, causing O(n^2) CPU consumption when yaml.load() parses a crafted ordered-map document. This issue is fixed in version 5.2.1.
Title js-yaml quadratic-complexity denial of service via YAML11_SCHEMA !!omap parsing
Weaknesses CWE-407
References
Metrics cvssV3_1

{'score': 5.3, 'vector': 'CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L'}


cve-icon MITRE

Status: PUBLISHED

Assigner: GitHub_M

Published:

Updated: 2026-10-06T15:07:05.157Z

Reserved: 2026-07-07T15:41:53.607Z

Link: CVE-2026-59870

cve-icon Vulnrichment

Updated: 2026-07-08T15:50:49.707Z

cve-icon NVD

Status : Modified

Published: 2026-07-08T16:16:33.580

Modified: 2026-10-06T16:17:08.490

Link: CVE-2026-59870

cve-icon Redhat

Severity : Important

Publid Date: 2026-07-08T15:13:20Z

Links: CVE-2026-59870 - Bugzilla

cve-icon OpenCVE Enrichment

Updated: 2026-10-07T09:00:16Z

Weaknesses
  • CWE-407

    Inefficient Algorithmic Complexity

  • CWE-770

    Allocation of Resources Without Limits or Throttling