js-yaml: maxTotalMergeKeys does not limit CPU use for empty merge sources
Affects js-yamlSource GCVE Database
CVSS 5.3 Medium : upgrade to 5.4.1 when convenient.
Data as of 29 Sep 2026, 21:22 UTC
- Patch
- Available – fixed in 5.4.1
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:LWhat to do
Upgrade js-yaml to 5.4.1.
Affected software
| Product | Affected | Fixed in |
|---|---|---|
| npmjs-yaml | Affected
| Fixed in
|
Check your own hosts for these packages with threat-finder (opens in a new tab), our free open-source scanner.
AI-suggested
A patch is available for js-yaml that fixes this issue by counting every merge source mapping as one budget unit. Users should upgrade to version 5.4.1 or later to mitigate this vulnerability. Until patched, be cautious when processing untrusted YAML documents with merge keys enabled.
Description
A vulnerability in js-yaml versions 5.0.0 up to but not including 5.4.1 allows an attacker to cause excessive CPU consumption by exploiting how empty merge source mappings are counted. The maxTotalMergeKeys setting does not count empty mappings, enabling an attacker to craft YAML documents that cause the loader to perform O(N*K) work, leading to prolonged CPU usage. This can result in denial of service due to resource exhaustion. A patch is available that adjusts the counting method to include every merge source mapping as one budget unit.