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.
Published: 2026-07-08
Score: 5.3 Medium
EPSS: < 1% Very Low
KEV: No
Impact: n/a
Action: n/a
AI Analysis

Impact

The vulnerability in js‑yaml arises from how the !!omap tag is parsed under YAML11_SCHEMA. Each insertion of an ordered‑map item triggers a linear duplicate‑key scan, leading to an overall O(n^2) CPU cost when yaml.load() processes a crafted document. An attacker can supply a YAML file with many ordered‑map entries to exhaust CPU resources, resulting in a denial‑of‑service condition. The flaw is characterized by CWE‑407 (Repetitive Processing) and CWE‑770 (Increased Resource Consumption), and no remote code execution or information disclosure paths are exposed.

Affected Systems

The flaw affects the nodeca js‑yaml package, specifically versions beginning with 5.0.0 up to, but not including, 5.2.1. Any application or service that includes one of these versions—directly or through a dependency chain—operating in any JavaScript environment (Node.js, browser, etc.) is vulnerable if it processes YAML input with YAML11_SCHEMA support for the !!omap tag.

Risk and Exploitability

The CVSS score of 5.3 reflects a moderate 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 July 29, 2026 at 14:02 UTC.

Remediation

No vendor fix or workaround currently provided.

OpenCVE Recommended Actions

  • Upgrade js‑yaml to version 5.2.1 or later, which removes the quadratic duplicate‑key scan.
  • If upgrading is not possible immediately, disable YAML11_SCHEMA support or configure 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.

Generated by OpenCVE AI on July 29, 2026 at 14:02 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

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-07-08T15:50:55.378Z

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

Link: CVE-2026-59870

cve-icon Vulnrichment

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

cve-icon NVD

No data.

cve-icon Redhat

Severity : Important

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

Links: CVE-2026-59870 - Bugzilla

cve-icon OpenCVE Enrichment

Updated: 2026-07-29T14:15:03Z

Weaknesses
  • CWE-407

    Inefficient Algorithmic Complexity

  • CWE-770

    Allocation of Resources Without Limits or Throttling