CVE-2026-13311: shell-quote: Quadratic-complexity Denial of Service in `parse()` (CWE-407)
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. Dependency Scanning using SBOM also detects vulnerabilities from proprietary advisories that this site does not include. Learn more about Dependency Scanning using SBOM →