Impact
js-yaml is a JavaScript library that parses and emits YAML. Between releases 3.0.0 and 3.15.2, 4.3.2, and 5.4.1, the maxTotalMergeKeys counter in lib/js-yaml/loader.js and lib/loader.js fails to count empty mapping sources during merge-key processing. An attacker can alias a large sequence of empty mappings into many merge targets, leading to an O(N × K) workload even though totalMergeKeys never hits the configured limit. As a result, a relatively small YAML document can provoke sustained CPU consumption in any application that parses untrusted YAML, because merge processing is enabled by default on these releases. The flaw is fixed in the mentioned newer versions.
Affected Systems
The vulnerability affects the Nodeca js‑yaml library. All releases from 3.0.0 through 3.15.1, from 4.0.0 through 4.3.1, and version 5.4.1 have the bug. The issue was addressed in releases 3.15.2, 4.3.2, and 5.4.1.
Risk and Exploitability
The CVSS score of 7.5 indicates high severity. The EPSS score of 0.00529 (0.53%) shows a low probability of exploitation, and the flaw is not listed in the CISA KEV catalog. An attacker can exploit this by supplying a malicious YAML document to any application that parses YAML with js‑yaml, which is plausible for both local data ingestion and remote input if the application accepts untrusted YAML. The likely attack vector is via crafted YAML input that triggers the merge processing overhead, producing prolonged CPU consumption.
OpenCVE Enrichment
Github GHSA