# CVE-2026-13311: shell-quote parse() is quadratic in token count, enabling denial of service

> An attacker can cause a denial of service by supplying a crafted string to shell-quote's parse function, blocking the Node.js event loop.

- **Severity:** High 8.7 (`CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N`)
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Over the internet
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 25 Jun 2026
- **Updated:** 25 Jun 2026
- **Also known as:** CLEANSTART-2026-AC35633, CLEANSTART-2026-XS33213, CLEANSTART-2026-ZX58029, CLSA-2026-1791584881, DEBIAN-CVE-2026-13311, ECHO-3f83-8535-51d8, GHSA-395f-4hp3-45gv, MINI-2gm8-23c5-9pgp, MINI-3m6j-x6q5-p866, MINI-4r84-m755-cx8j, MINI-5x62-fmr3-4qj6, MINI-7c8p-m6x9-p4wq, MINI-8gpv-rqqp-r73h, MINI-hj9x-286m-hm69, MINI-hwx8-r398-gmqg, MINI-pqhq-cjfg-4wp9, MINI-prvc-vgv8-63w2, MINI-r9xr-vvww-r5pw, ROOT-APP-NPM-CVE-2026-13311, UBUNTU-CVE-2026-13311, openSUSE-SU-2026:11472-1

## What is CVE-2026-13311?

CVE-2026-13311 is a high-severity denial of service vulnerability in ljharb shell-quote, published on 25 Jun 2026. An attacker can exploit it over the internet without logging in, with no action from the victim.

### Official 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.

Weakness: CWE-407 (Inefficient Algorithmic Complexity)

## Which versions are affected by CVE-2026-13311?

2 open source packages ship an affected version, including shell-quote. It affects 1 product.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `shell-quote` | npm | All versions | 1.9.0 |
| `shell-quote` | npm | All versions | 1.9.0 |
| `agama-web-ui` | openSUSE:Tumbleweed | All versions | 23+75.1a877fb50-50.1 |

Products: Shell-Quote Project Shell-Quote.

## How do I fix CVE-2026-13311?

Upgrade shell-quote to 1.9.0 or later.

## Is CVE-2026-13311 being exploited?

It is not confirmed as exploited in the wild, but public exploit code for CVE-2026-13311 exists.

## Other vulnerabilities in ljharb shell-quote

- [CVE-2021-42740](https://insights.sbomify.com/CVE-2021-42740/): Improper Neutralization of Special Elements used in a Command in Shell-quote (critical 9.8)
- [CVE-2016-10541](https://insights.sbomify.com/CVE-2016-10541/): Potential Command Injection in shell-quote (critical 9.8)

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2026-13311 and fix it if it is affected.

What it is: CVE-2026-13311 is a high-severity denial of service vulnerability in ljharb shell-quote, published on 25 Jun 2026. An attacker can exploit it over the internet without logging in, with no action from the victim.
Exploitation: It is not confirmed as exploited in the wild, but public exploit code for CVE-2026-13311 exists.

Affected packages and fixed versions:
- shell-quote (npm): affected all versions; fixed in 1.9.0
- shell-quote (npm): affected all versions; fixed in 1.9.0

Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/CVE-2026-13311/ (Markdown: https://insights.sbomify.com/CVE-2026-13311/index.md)
```

## Sources

- CVE record: https://www.cve.org/CVERecord?id=CVE-2026-13311
- NVD: https://nvd.nist.gov/vuln/detail/CVE-2026-13311
- OSV: https://osv.dev/vulnerability/CVE-2026-13311

---
From sbomify Insights: https://insights.sbomify.com/CVE-2026-13311/
Summaries are generated and may contain mistakes; the official description above is the record.
