CVE-2026-13311: shell-quote Package Suffers from Quadratic-complexity Denial of Service Vulnerability

shell-quote Updated 20 Jul 2026

Summary

20/07/2026
Yes i
High
7.5

CVE-2026-13311: shell-quote: Quadratic-complexity Denial of Service in parse() (CWE-407). Affects shell-quote versions < 1.9.0. Fixed in 1.9.0. How to fix ↓

Free scan

Check if this vulnerability affects your application

Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.

Check my app free

No signup required · Results in about 60 seconds

Upload your dependency manifest or SBOM

Drag & drop your file here or

Java Javascript PHP Python Go Rust Ruby Dart C/C++ Elixir CycloneDX SPDX

Upload a supported dependency manifest or SBOM. No installation or source-code access required.

See supported files and SBOM formats
SBOM sbom.json · bom.json · bom.xml · *.spdx.json · *.cdx.json · *.cdx.xml
Java pom.xml · gradle.lockfile · buildscript-gradle.lockfile
Javascript package-lock.json · yarn.lock · pnpm-lock.yaml
PHP composer.lock
Python poetry.lock · requirements.txt · Pipfile.lock
Go go.mod
Rust Cargo.lock
Ruby Gemfile.lock
Dart pubspec.lock
C/C++ conan.lock
Elixir mix.lock
Enter your work email to receive your report link.

Verify your email to view the full report and start 30 days of continuous monitoring. No credit card required.

Sponsored Lume, the Habilume companion Habilume Habit tracker with a companion that grows with you Complete habits, earn Lume Points, and watch your Lume grow as you stay consistent. App Store Google Play

Background

The shell-quote package is a Node.js library that provides functionality for parsing and quoting shell command strings. It is commonly used in applications that require command-line interaction or command parsing. The package is designed to handle various shell metacharacters and arguments, making it a versatile tool for developers. However, it has a vulnerability that can lead to significant performance issues under certain conditions, specifically when processing large input strings.

Vulnerability Detail

The vulnerability in the shell-quote package arises from the parse() function, which uses a quadratic-complexity algorithm due to the way it concatenates arrays. Each call to prev.concat(arg) creates a new array and copies the entire previous array, leading to O(n²) time complexity. This means that as the number of tokens increases, the time taken to process them grows exponentially. An unauthenticated attacker can exploit this by submitting specially crafted input, causing the Node.js event loop to block for extended periods, resulting in a denial of service. This vulnerability does not require shell metacharacters, making it particularly insidious as traditional input filters may not catch it.

How To Fix

Latest published version: 1.12.0 as of 22 Oct 2026

npm install shell-quote@1.12.0

Upgrading to it may include breaking changes; the version below is the minimum fixed release for this vulnerability.

If you need the minimum change

1.9.0

This is the first release that contains the fix.

npm install shell-quote@1.9.0

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Workaround

As a temporary workaround, you can implement an input length cap on the parse() function to prevent excessively large inputs from being processed. This can be done by checking the length of the input string before calling parse(), as shown in the following code snippet:

const { parse } = require('shell-quote');
const MAX_INPUT_LENGTH = 10000; // Set a maximum input length

function safeParse(input) {
  if (input.length > MAX_INPUT_LENGTH) {
    throw new Error('Input exceeds maximum allowed length.');
  }
  return parse(input);
}

Conclusion

The shell-quote package has a significant vulnerability that can lead to denial of service due to its quadratic complexity in the parse() function. It is crucial for developers using this package to update to the patched version to mitigate the risk. Additionally, implementing input length checks can serve as a temporary workaround while transitioning to the fixed version.

See every vulnerability recorded for shell-quote →

Share this vulnerability

FAQ

The CVSS score of this vulnerability is 7.5, indicating a high severity level.

Yes, an unauthenticated attacker can exploit this vulnerability by submitting crafted input to any code path that calls the parse() function.

The primary impact is a denial of service, where the application becomes unresponsive for extended periods, affecting availability.

Yes, updating the shell-quote package to version 1.9.0 or later resolves this vulnerability.

You can use Vulert, which monitors and alerts for open-source vulnerabilities in real-time. You can check your application against this vulnerability using the Vulert playground at Vulert Scanner without requiring signup.

Related vulnerabilities

Recent vulnerabilities recorded for shell-quote.

Sponsored Lume, the Habilume companion Habilume Habit tracker with a companion that grows with you Complete habits, earn Lume Points, and watch your Lume grow as you stay consistent. App Store Google Play

How To Fix

Latest published version: 1.12.0 as of 22 Oct 2026

npm install shell-quote@1.12.0

Upgrading to it may include breaking changes; the version below is the minimum fixed release for this vulnerability.

If you need the minimum change

1.9.0

This is the first release that contains the fix.

npm install shell-quote@1.9.0

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Subscribe to Vulert on Telegram
Daily digest of new CVEs, critical and high severity, affected packages and fixes — plus a weekly roundup.
Join the channel →
Help improve this record
Report an issue or send feedback