Advisory Database
  • Advisories
  • Dependency Scanning
  1. npm
  2. ›
  3. shell-quote
  4. ›
  5. CVE-2026-13311

CVE-2026-13311: shell-quote: Quadratic-complexity Denial of Service in `parse()` (CWE-407)

July 20, 2026

shell-quote’s parse() finalizes its token list with a reduce that uses Array.prototype.concat as the accumulator. Each prev.concat(arg) copies the entire growing array, so parse() runs in O(n²) in the number of tokens. An unauthenticated attacker who can submit a string to any code path that calls parse() on it can block the single-threaded Node.js event loop for tens of seconds with a small input — a denial of service. The trigger needs no shell metacharacters (plain space-separated words suffice), so input filters that only screen for ;, |, $, or backticks do not help.

References

  • github.com/advisories/GHSA-395f-4hp3-45gv
  • github.com/ljharb/shell-quote/commit/7ff5488599d01c323514f02f5efb74088dd134ec
  • github.com/ljharb/shell-quote/releases/tag/v1.9.0
  • github.com/ljharb/shell-quote/security/advisories/GHSA-395f-4hp3-45gv
  • nvd.nist.gov/vuln/detail/CVE-2026-13311
  • www.npmjs.com/package/shell-quote

Code Behaviors & Features

Detect and mitigate CVE-2026-13311 with GitLab Dependency Scanning

Secure your software supply chain by verifying that all open source dependencies used in your projects contain no disclosed vulnerabilities. Learn more about Dependency Scanning →

Affected versions

All versions before 1.9.0

Fixed versions

  • 1.9.0

Solution

Upgrade to version 1.9.0 or above.

Impact 7.5 HIGH

CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H

Learn more about CVSS

Weakness

  • CWE-407: Inefficient Algorithmic Complexity

Source file

npm/shell-quote/CVE-2026-13311.yml

Spotted a mistake? Edit the file on GitLab.

  • Site Repo
  • About GitLab
  • Terms
  • Privacy Statement
  • Contact

Page generated Tue, 21 Jul 2026 12:22:25 +0000.