# nodeca js-yaml Denial of Service via complex map keys

Source: https://junglewise.ai/threats/nodeca-js-yaml-denial-of-service-via-complex-map-keys-ebc6e7f3  
Publisher: Junglewise Threat Intelligence, https://junglewise.ai/threats  
Published: 2019-06-05. Updated: 2026-05-14  
License: CC BY 4.0 with a link back

Severity: low · CVSS 3.1 · Published 2019-06-05

The js-yaml library, a popular tool for parsing YAML data in Node.js applications, is vulnerable to a denial-of-service attack. An attacker can provide a specially crafted YAML file that causes the application to consume excessive system resources or stop responding. This can lead to service outages and prevent legitimate users from accessing the application.

Technologies: [js-yaml (npm)](https://junglewise.ai/threats/technologies/js-yaml). Vendors: [npm](https://junglewise.ai/threats/vendors/npm).

## Quick answers

**Is This vulnerability exploited in the wild?** No. Junglewise Threat Intelligence has no report of This vulnerability being exploited in the wild.

**How severe is This vulnerability?** Low severity, with a CVSS score of 3.1, published 5 June 2019.

**Which products and versions are affected?** js-yaml (npm) SEMVER:introduced=0,fixed=3.13.0.

**Is there a fix for This vulnerability?** Yes. js-yaml (npm): upgrade to 3.13.0 or later. Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.

**How is This vulnerability attacked?** It is attacked over the network, in a software library.

**Am I affected?** Check whether you run js-yaml (npm) at an affected version. Junglewise does that check for you around the clock: connect your code, cloud and domains, and it matches new vulnerabilities like this one against what you actually run and tells you when one reaches you.

## How to fix

- js-yaml (npm): upgrade to 3.13.0 or later

  ```sh
  npm install js-yaml@3.13.0
  ```


## Technical details

Versions of js-yaml prior to 3.13.0 are vulnerable to a Denial of Service (DoS) via resource exhaustion. The vulnerability occurs when the parser processes complex arrays used as map keys. By utilizing YAML aliases and anchors to create deeply nested structures, an attacker can cause the output string representation of a key to grow exponentially relative to a linear input (similar to a 'Billion Laughs' attack). This results in the Node.js process stalling or exhausting memory. The issue was addressed by restricting the data types allowed for object keys in the `storeMappingPair` function.

## Affected products

- nodeca js-yaml < 3.13.0

## Timeline

- 2019-03-18: disclosed: Vulnerability disclosed by researchers
- 2019-03-20: patched: Fix committed to repository
- 2019-06-05: advisory: GitHub advisory published

## References

- [https://github.com/nodeca/js-yaml/issues/475](https://github.com/nodeca/js-yaml/issues/475)
- [https://github.com/nodeca/js-yaml/commit/a567ef3c6e61eb319f0bfc2671d91061afb01235](https://github.com/nodeca/js-yaml/commit/a567ef3c6e61eb319f0bfc2671d91061afb01235)
- [https://snyk.io/vuln/SNYK-JS-JSYAML-173999](https://snyk.io/vuln/SNYK-JS-JSYAML-173999)
- [https://www.npmjs.com/advisories/788](https://www.npmjs.com/advisories/788)
- [https://www.npmjs.com/advisories/788/versions](https://www.npmjs.com/advisories/788/versions)

## Related threats

- [js-yaml CPU exhaustion via merge keys with empty mappings](https://junglewise.ai/threats/js-yaml-maxtotalmergekeys-does-not-limit-cpu-use-for-empty-merge-e18172a3)
- [js-yaml YAML merge CPU consumption DoS](https://junglewise.ai/threats/cve-2026-84375-js-yaml-denial-of-service-via-empty-merge-sources)
- [js-yaml exponential parsing time in flow collections denial of service](https://junglewise.ai/threats/cve-2026-73643-js-yaml-exponential-parsing-time-in-flow-collections-denial-of)
- [JS-YAML quadratic CPU consumption in !!omap resolution](https://junglewise.ai/threats/js-yaml-quadratic-cpu-consumption-in-omap-resolution-f21ac1bd)
- [nodeca js-yaml denial of service in YAML11_SCHEMA omap parsing](https://junglewise.ai/threats/cve-2026-59870-nodeca-js-yaml-denial-of-service-in-yaml11-schema-omap-parsing)
