CVE-2026-59869: js-yaml Quadratic CPU Complexity DoS Vulnerability
js-yaml, a widely-used JavaScript library for parsing and dumping YAML, contains a denial-of-service vulnerability affecting versions 3.0.0 through 3.14.x and 4.0.0 through 4.2.x. An attacker can craft a specially formatted YAML document that causes the parser to consume excessive CPU resources—growing quadratically in time while the malicious input size grows only linearly. This means a relatively small payload can trigger disproportionate computational work, potentially exhausting server resources and disrupting service availability.
Source data · NVD / CISA · public domain
- CVSS
- 3.1 · 7.5 HIGH · CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
- Weaknesses (CWE)
- CWE-407
- Affected products
- 1 configuration(s)
- Published / Modified
- 2026-07-08 / 2026-07-13
NVD description (verbatim)
js-yaml is a JavaScript YAML parser and dumper. From 3.0.0 before 3.15.0 and from 4.0.0 before 4.3.0, js-yaml can spend quadratic CPU time parsing a document whose size grows only linearly when a chain of mappings uses merge keys where each mapping merges the previous one. This issue is fixed in versions 3.15.0 and 4.3.0.
6 reference(s) · View on NVD →
SEC.co analysis · AI-assisted, reviewed against source
Technical summary
The vulnerability stems from inefficient algorithmic handling of YAML merge keys in chained mapping structures. When a YAML document contains a series of mappings where each mapping merges the previous one using the merge key operator, the parser's internal processing becomes increasingly expensive. Specifically, the quadratic time complexity emerges because the parser re-processes previously merged keys multiple times rather than efficiently tracking state. The flaw is present in js-yaml versions 3.0.0–3.14.x and 4.0.0–4.2.x. The issue was resolved in versions 3.15.0 and 4.3.0 by optimizing the merge-key handling logic to avoid redundant processing. This is categorized as CWE-407 (Inefficient Algorithmic Complexity).
Business impact
Organizations deploying js-yaml in server-side YAML parsing contexts face resource exhaustion risk. If an attacker sends crafted YAML payloads to an endpoint that parses untrusted input, the targeted service can experience high CPU spikes, slow response times, or complete unavailability. In cloud environments with auto-scaling, repeated attacks could inflate operational costs. Applications that parse YAML from external sources—such as configuration management tools, CI/CD pipelines, or API gateways—are especially at risk. The high CVSS score (7.5) reflects the ease of exploitation and significant availability impact.
Affected systems
Any system running nodeca js-yaml versions 3.0.0 through 3.14.x or 4.0.0 through 4.2.x is vulnerable. This includes Node.js applications, Electron apps, and browser-based tools that bundle js-yaml. Particular concern attaches to services that accept YAML input from untrusted sources without strict resource limits. Check your application dependencies and lock files (package-lock.json, yarn.lock) to identify vulnerable versions in your supply chain.
Exploitability
Exploitation requires only network access and the ability to send a crafted YAML payload to the vulnerable parser—no authentication or user interaction needed. The attack is trivial to execute: an attacker simply needs to construct a YAML document with nested merge keys and send it to a parsing endpoint. Because the vulnerability stems from algorithmic inefficiency rather than memory corruption or code injection, it does not lead to code execution or data breach, but directly impacts availability. The attack surface is broad for any public-facing service parsing YAML.
Remediation
Upgrade js-yaml to version 3.15.0 or later (for the 3.x branch) or version 4.3.0 or later (for the 4.x branch). Verify the upgrade in your lock files and re-run your dependency tests. If immediate patching is not feasible, implement protective measures: (1) enforce strict input size limits on YAML payloads, (2) add request timeouts to parsing operations, (3) use resource quotas or rate limiting on parsing endpoints, and (4) avoid parsing YAML from untrusted sources if possible.
Patch guidance
Consult the nodeca js-yaml repository and official advisory for the exact upgrade path for your version. The fix is available in js-yaml 3.15.0 and 4.3.0+. Use npm or yarn to update: verify against the vendor advisory that your target version resolves CVE-2026-59869. Test your application after upgrade to ensure no breaking changes in YAML parsing behavior, particularly if you rely on merge-key semantics.
Detection guidance
Monitor CPU usage spikes correlated with YAML parsing operations. Log and alert on unusually large or complex YAML payloads sent to parsing endpoints. If available, enable debug logging in js-yaml to observe merge-key processing. Intrusion detection systems can watch for repeated submission of pathological YAML patterns. In application performance monitoring (APM) tools, track parse latency and CPU time per request; anomalous increases warrant investigation. Combine with network-level rate limiting to catch brute-force DoS attempts.
Why prioritize this
This vulnerability merits prompt attention due to its high CVSS score (7.5), ease of exploitation, and broad applicability across Node.js ecosystems. Although it does not enable code execution, availability attacks can be as damaging as data breaches in cloud-native and SaaS environments. js-yaml is a foundational library in many dependency chains, making widespread exposure likely. Organizations should prioritize patches for externally-facing services first, then move to internal tools that parse untrusted YAML.
Risk score, explained
The CVSS 3.1 score of 7.5 (HIGH) reflects: (1) network-accessible attack vector (AV:N) with no privileges required (PR:N) and no user interaction (UI:N), (2) complete availability impact (A:H) on the affected service, and (3) no confidentiality or integrity compromise. The attack complexity is low (AC:L), meaning the payload is straightforward to craft. This score appropriately captures the severity for availability-critical systems, though the lack of code execution potential keeps it below critical thresholds.
Frequently asked questions
If we're running js-yaml in a sandboxed or offline environment, do we need to patch?
No, offline use or fully isolated environments eliminate network attack surface. However, if there's any possibility of untrusted YAML input—even from internal tools or CI/CD—the patch is still recommended as a best practice.
Can we mitigate this without upgrading if we restrict YAML file size?
Size limits reduce attack feasibility but do not eliminate the risk entirely, because an attacker can still craft a small, highly nested merge-key structure that triggers quadratic behavior. Patching remains the definitive fix; limits are a temporary supplementary measure.
Does this vulnerability affect YAML parsing in other languages or libraries?
This specific CVE affects only nodeca's js-yaml library. Other YAML parsers (Python's PyYAML, Go libraries, etc.) may have similar issues but are separately tracked. Check each library's advisories independently.
What if we cannot upgrade immediately due to compatibility concerns?
Implement strict input validation and size limits, add parsing timeouts, and monitor CPU usage closely. Contact the js-yaml maintainers if you have concerns about breaking changes in the target version. Plan an upgrade window as soon as feasible.
This analysis is based on publicly available vulnerability data as of the publication date. No guarantee is made regarding the completeness or accuracy of threat intelligence sourced externally. Readers are advised to verify patch availability and compatibility with their specific js-yaml versions and application stack before implementing changes. SEC.co does not warrant that the information herein eliminates all risk; organizations must conduct their own risk assessments and testing. Always consult official vendor advisories and changelogs before patching production systems. Source: NVD (public-domain), retrieved 2026-08-17. Analysis generated by SEC.co (claude-haiku-4-5).
Related vulnerabilities
- CVE-2026-53550MEDIUMjs-yaml Merge-Key CPU Exhaustion Denial of Service
- CVE-2026-59868MEDIUMjs-yaml Denial-of-Service via Merge Key Complexity
- CVE-2026-59870MEDIUMjs-yaml Denial-of-Service via Ordered-Map Parsing
- CVE-2026-13311HIGHshell-quote Algorithmic Denial of Service Vulnerability
- CVE-2026-41850HIGHSpring Framework SpEL Denial of Service Vulnerability (CVSS 7.5)
- CVE-2026-42504HIGHMIME Header CPU Exhaustion Denial of Service – Patch Guidance
- CVE-2026-48502HIGHMessagePack for C# Stack Overflow in Timestamp Parsing
- CVE-2026-48511HIGHMessagePack for C# ExpandoObject Denial of Service