npm
CVE-2026-53550
JS-YAML: Quadratic-complexity DoS in merge key handling via repeated aliases
- Severity
- Medium 5.3
- Published
- 15 Jun 2026
- Last changed
- 10 Sept 2026
- Added to UpHeron
- 22 Oct 2026
- Fixed in
- 3.15.0, 4.2.0
- Exploit chance
- 0.4% in the next 30 daysHigher than 36% of CVEs. EPSS by FIRST, 19 Nov 2026
- Attack
- Over the network · No login needed · No user action needed
- Attacker can
- Slow it down
- CVSS vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L- Also known as
- GHSA-h67p-54hq-rp68
- Sources
- OSV.dev and GitHub
Description
A crafted YAML document can trigger algorithmic CPU exhaustion in js-yaml merge-key processing (<<) by repeating the same alias many times in a merge sequence. This causes quadratic parse-time behavior relative to input size and can block a Node.js worker/event loop for seconds with a relatively small payload (tens of KB), resulting in denial of service.
The issue is in merge handling inside lib/loader.js:
- storeMappingPair(...) iterates every element of a merge sequence when key tag is tag:yaml.org,2002:merge.
- For each element, it calls mergeMappings(...).
- mergeMappings(...) computes Object.keys(source) and performs _hasOwnProperty.call(destination, key) checks for each key.
When input is of the form:
a: &a {k0:0, k1:0, ..., kK:0} b: {<<: [*a, *a, *a, ... repeated M times ...]} all *a entries refer to the same anchored object. After the first merge, subsequent merges are semantically no-ops, but the parser still reprocesses all keys each time.
Affected software
| Software | Affected versions |
|---|---|
js-yamlnpm · osv:npm:js-yaml |
|
About js-yaml
- Weekly downloads (npm)
- 399,660,092npm, 17 Nov 2026
Vulnerabilities in js-yaml
- In our list
- 4
- Published in the last 12 months
- 4
- Critical, last 12 months
- 0
- High, last 12 months
- 3
- Known exploited
- 0
- CVE-2026-84375js-yaml: maxTotalMergeKeys does not limit CPU use for empty merge sourcesHigh 7.5 8 Sept 2026
- GHSA-5p4m-2wfm-xmqjJS-YAML: Quadratic CPU consumption in !!omap resolution (3.x and 4.x) — CVE-2026-59870 fix not backportedHigh 7.5 6 Aug 2026
- CVE-2026-59869js-yaml: YAML merge-key chains can force quadratic CPU consumptionHigh 7.5 20 Jul 2026
References
- CVE.org https://www.cve.org/CVERecord?id=CVE-2026-53550
- GitHub Advisory Database https://github.com/advisories/GHSA-h67p-54hq-rp68