CVE-2026-13311
Received Received - Intake
Denial of Service in shell-quote via parse() O(n^2) Complexity

Publication date: 2026-06-25

Last updated on: 2026-06-25

Assigner: harborist

Description
shell-quote prior to 1.8.5 finalizes parsed tokens in parse() using Array.prototype.concat as a reduce accumulator, which reallocates and copies the entire growing array on every iteration. As a result parse() runs in O(n^2) time relative to the number of input tokens. An attacker who can supply an attacker-controlled string to any code path that calls parse() (no shell metacharacters are required; plain space-separated words suffice) can block the single-threaded Node.js event loop for an extended period with a small input, resulting in a denial of service. There is no code execution or data disclosure; impact is to availability only. Fixed in 1.8.5.
CVSS Scores
EPSS Scores
Probability:
Percentile:
Meta Information
Published
2026-06-25
Last Modified
2026-06-25
Generated
2026-06-25
AI Q&A
2026-06-25
EPSS Evaluated
N/A
NVD
EUVD
Affected Vendors & Products
Showing 1 associated CPE
Vendor Product Version / Range
ljharb shell-quote to 1.8.5 (exc)
Helpful Resources
Exploitability
CWE
CWE Icon
KEV
KEV Icon
CWE ID Description
CWE-407 An algorithm in a product has an inefficient worst-case computational complexity that may be detrimental to system performance and can be triggered by an attacker, typically using crafted manipulations that ensure that the worst case is being reached.
Attack-Flow Graph
AI Quick Actions
Instant insights powered by AI
Executive Summary

CVE-2026-13311 is a high-severity Denial of Service (DoS) vulnerability in the shell-quote npm package, affecting versions 1.8.4 and below.

The vulnerability arises because the parse() function uses Array.prototype.concat repeatedly within a reduce operation, causing the function to run in quadratic time (O(nΒ²)) relative to the number of input tokens.

An attacker can supply a specially crafted string of space-separated words (no shell metacharacters needed) to any code path that calls parse(), which blocks the single-threaded Node.js event loop for an extended period.

This results in a denial of service by freezing the application, but there is no code execution or data disclosure involved.

Detection Guidance

This vulnerability can be detected by monitoring for unusually high CPU usage or event loop blocking in Node.js applications that use the shell-quote package version 1.8.4 or below. Since the issue arises when the parse() function processes attacker-controlled input strings, detecting unusually long processing times or delays in the event loop can indicate exploitation attempts.

There are no specific built-in commands mentioned to detect this vulnerability directly, but you can use Node.js profiling tools or monitoring commands such as:

  • Using Node.js built-in diagnostics: `node --inspect` or `node --trace-events` to monitor event loop delays.
  • Using system monitoring tools like `top` or `htop` to observe high CPU usage by Node.js processes.
  • Using Node.js event loop delay monitoring libraries such as `event-loop-lag` or `clinic` to detect blocking.

Additionally, reviewing application logs for unusually long request processing times or timeouts when handling inputs that include many space-separated tokens may help identify attempts to exploit this vulnerability.

Mitigation Strategies

The immediate and recommended mitigation is to upgrade the shell-quote package to version 1.8.5 or later, where the vulnerability has been fixed by replacing the inefficient reduce-based concat operation with a linear flattening approach.

If upgrading is not immediately possible, consider implementing input validation or rate limiting on any inputs that reach the parse() function to reduce the risk of denial of service, although filtering based on shell metacharacters is ineffective since the attack requires only space-separated words.

Monitoring and alerting on high CPU usage or event loop blocking can also help detect and respond to exploitation attempts in real time.

Compliance Impact

This vulnerability causes a denial of service (DoS) by blocking the Node.js event loop, impacting availability only.

There is no code execution or data disclosure involved, so confidentiality and integrity are not affected.

Since availability is impacted, organizations relying on affected versions of shell-quote may face challenges in meeting availability requirements under standards like GDPR and HIPAA, which mandate ensuring system availability and reliability.

However, the CVE description and resources do not explicitly discuss compliance implications with these standards.

Impact Analysis

This vulnerability can cause a denial of service by blocking the Node.js event loop for extended periods.

An attacker can freeze the application with a relatively small input, causing the application to become unresponsive.

This impacts the availability of the affected system or service, potentially causing outages or degraded performance.

There is no impact on confidentiality or integrity, and no code execution or data leakage occurs.

Chat Assistant
Ask questions about this CVE
Hi! I’m here to help you understand CVE-2026-13311. Ask me anything about the vulnerability, its impact, or mitigation strategies.
0/70
EPSS Chart