Severity by source
AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
Attacker sends a crafted document over the network with no auth or interaction (AV:N/PR:N/UI:N); only availability is hit via CPU exhaustion (A:H, C/I:N), and the merge-key precondition is a deployment setting, not attacker effort, so AC:L.
Primary rating from Vendor (GitHub_M).
CVSS VectorNVD
Lifecycle Timeline
8Blast Radius
ecosystem impact- 9 npm packages depend on js-yaml (7 direct, 2 indirect)
Ecosystem-wide dependent count for version 5.0.0.
DescriptionNVD
js-yaml is a JavaScript YAML parser and dumper. From 5.0.0 before 5.2.0, when merge keys are enabled, js-yaml can spend quadratic CPU time parsing a document whose size grows only linearly when a chain of mappings uses merge keys where each mapping merges the previous one. This issue is fixed in version 5.2.0.
AnalysisAI
Denial of service in the js-yaml Node.js YAML parser (versions 5.0.0 up to but not including 5.2.0) lets a remote attacker consume quadratic CPU time by submitting a small, linearly-sized YAML document that chains merge keys (<<) so each mapping merges the previous one. Because confidentiality and integrity impact are nil and only availability is affected (CVSS 7.5, AV:N/A:H), a single crafted document can stall or hang the parsing thread. SSVC rates this poc / automatable=yes / partial impact; there is no public weaponized exploit and it is not on CISA KEV, with a low EPSS of 0.29%.
Technical ContextAI
js-yaml (published under vendor 'nodeca', CPE cpe:2.3:a:nodeca:js-yaml) is one of the most widely used JavaScript YAML parsers, invoked whenever an application calls load()/loadAll() on YAML input. The flaw is a CWE-407 Inefficient Algorithmic Complexity issue in how the merge key (<<) feature folds one mapping's keys into another: when a chain of mappings each merges the prior mapping (a0 into a1, a1 into a2, and so on), the total number of keys the constructor must process grows quadratically relative to the document's linear source size, producing an algorithmic-complexity DoS. The upstream fix commit (3105455b) confirms the root cause and remedy - the old maxMergeSeqLength cap is replaced with a new maxTotalMergeKeys loader option (default 10000) that bounds the total keys processed by merge across a single load()/loadAll() call and throws a YAMLException once exceeded.
RemediationAI
Vendor-released patch: upgrade js-yaml to 5.2.0 or later, which fixes the quadratic merge-key behavior and adds the maxTotalMergeKeys loader option (default 10000) to bound merge processing (release: https://github.com/nodeca/js-yaml/releases/tag/5.2.0; advisory: https://github.com/nodeca/js-yaml/security/advisories/GHSA-g796-fgmg-93mv). If you cannot upgrade immediately, the most effective compensating control is to avoid enabling merge keys when parsing untrusted YAML - load with the default schema instead of a YAML 1.1 / merge-enabled schema, which removes the attack surface entirely at the cost of losing << merge support. Additional layered controls include enforcing strict input-size limits on YAML from untrusted sources and running parsing under a CPU/time budget (for example a worker thread with a timeout, as the project's own pathological test does) so one document cannot hang the main event loop; the trade-off is added complexity and rejecting legitimately large documents. After upgrading, applications that legitimately use merges can tune maxTotalMergeKeys to a lower value for stricter protection.
The JS-YAML module before 2.0.5 for Node.js parses input without properly considering the unsafe !!js/function tag, whic
Uncontrolled CPU consumption in js-yaml versions 3.0.0-3.15.1 and 4.0.0-4.3.1 allows unauthenticated remote attackers to
Denial of service in js-yaml (a widely-used JavaScript YAML parser) 3.0.0-3.14.x and 4.0.0-4.2.x allows remote attackers
Denial of service in the js-yaml JavaScript YAML parser (versions 5.0.0 up to but not including 5.2.1) allows remote att
js-yaml is a JavaScript YAML parser and dumper. Rated medium severity (CVSS 5.3), this vulnerability is remotely exploit
Same weakness CWE-407 – Inefficient Algorithmic Complexity
View allSame technique Information Disclosure
View allVendor StatusVendor
Share
External POC / Exploit Code
Leaving vuln.today
EUVD-2026-42302
GHSA-g796-fgmg-93mv