Description
js-yaml is a JavaScript YAML parser and dumper. From 5.0.0 until 5.2.2, parsing a small YAML document can take exponential time when an application calls load() or loadAll() on untrusted input. In src/parser/parser.ts, readFlowCollection uses restoreState and calls parseNode a second time when a flow-sequence entry is recognized as a key: value pair. If the key is a nested flow sequence of the same shape, every level is parsed twice, causing O(2^n) work and allowing an input under 200 bytes to keep one CPU busy for minutes, block the Node.js event loop, and stall the process. No anchors, aliases, merges, tags, or nondefault options are required. This issue is fixed in version 5.2.2.
Published: 2026-08-13
Score: 7.5 High
EPSS: n/a
KEV: No
Impact: n/a
Action: n/a
AI Analysis

Impact

The flaw lies in js‑yaml's parser where a nested flow‑sequence entry is parsed twice, leading to an exponential O(2^n) workload. When the application calls load() or loadAll() on malicious YAML that contains a nested flow‑sequence under 200 bytes, the parser can keep a CPU core busy for minutes, block the Node.js event loop and stall the entire process. This results in a denial of service to all users of the affected application, without giving the attacker any code execution or data exfiltration capability. The weakness is identified as CWE‑407, a “Resource Exhaustion” flaw.

Affected Systems

The vulnerability affects nodeca’s js‑yaml library in versions 5.0.0 through 5.2.1. Versions 5.2.2 and later contain the fix and are safe to use. Any Node.js application that loads YAML data via load() or loadAll() and depends on a vulnerable js‑yaml release is at risk.

Risk and Exploitability

The CVSS score of 7.5 classifies this as a high‑severity risk. There is currently no EPSS score available and the issue is not listed in the CISA KEV catalog. Because the attack exploits a parsing bug triggered by untrusted YAML input, the most likely vector is an application that accepts user‑supplied YAML files or strings. An attacker can craft a short payload (under 200 bytes) that induces the exponential slowdown; no additional privileges or network access are required beyond the normal ability to deliver YAML content to the application.

Generated by OpenCVE AI on August 13, 2026 at 19:43 UTC.

Remediation

No vendor fix or workaround currently provided.

OpenCVE Recommended Actions

  • Upgrade js‑yaml to version 5.2.2 or later, which contains the parser fix.
  • If an immediate upgrade is not possible, reject or filter any YAML input longer than 200 bytes before passing it to load()/loadAll().
  • Implement rate limiting or enforce a worker‑thread environment for YAML processing to contain the CPU load.
  • Consider switching to a different YAML parsing library that does not exhibit this exponential behaviour.

Generated by OpenCVE AI on August 13, 2026 at 19:43 UTC.

Tracking

Sign in to view the affected projects.

Advisories
Source ID Title
Github GHSA Github GHSA GHSA-pm4m-ph32-ghv5 js-yaml: Exponential parsing time in flow collections leads to denial of service
History

Thu, 13 Aug 2026 20:15:00 +0000

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

Thu, 13 Aug 2026 18:15:00 +0000

Type Values Removed Values Added
Description js-yaml is a JavaScript YAML parser and dumper. From 5.0.0 until 5.2.2, parsing a small YAML document can take exponential time when an application calls load() or loadAll() on untrusted input. In src/parser/parser.ts, readFlowCollection uses restoreState and calls parseNode a second time when a flow-sequence entry is recognized as a key: value pair. If the key is a nested flow sequence of the same shape, every level is parsed twice, causing O(2^n) work and allowing an input under 200 bytes to keep one CPU busy for minutes, block the Node.js event loop, and stall the process. No anchors, aliases, merges, tags, or nondefault options are required. This issue is fixed in version 5.2.2.
Title js-yaml: Exponential parsing time in the flow collections leads to denial of service
Weaknesses CWE-407
References
Metrics 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'}


cve-icon MITRE

Status: PUBLISHED

Assigner: GitHub_M

Published:

Updated: 2026-08-13T17:47:30.404Z

Reserved: 2026-08-13T14:04:09.603Z

Link: CVE-2026-73643

cve-icon Vulnrichment

No data.

cve-icon NVD

Status : Received

Published: 2026-08-13T18:18:19.947

Modified: 2026-08-13T18:18:19.947

Link: CVE-2026-73643

cve-icon Redhat

No data.

cve-icon OpenCVE Enrichment

Updated: 2026-08-13T20:00:03Z

Weaknesses
  • CWE-407

    Inefficient Algorithmic Complexity