# CVE-2026-2391: qs's arrayLimit bypass in comma parsing allows denial of service

> Attackers can cause denial of service via memory exhaustion by bypassing array limits in comma-separated parsing when the comma option is enabled.

- **Severity:** Medium 6.3 (`CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:N/VI:N/VA:L/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:** 12 Feb 2026
- **Updated:** 12 Feb 2026
- **Also known as:** AZL-77594, AZL-77597, AZL-77601, AZL-77616, CLEANSTART-2026-BV94239, CLEANSTART-2026-FY63723, CLSA-2026-1791374489, CLSA-2026-1793098678, DEBIAN-CVE-2026-2391, ECHO-3167-7a3b-863d, GHSA-w7fw-mjwx-w883, MINI-328j-w6pw-p8vv, MINI-3x2m-w9jg-3p65, MINI-455c-7f3j-r6jq, MINI-45g4-3jj6-967c, MINI-59hw-w574-3cwq, MINI-5pqp-mvfc-fmhh, MINI-66cp-jv38-h2wm, MINI-73j9-q3f7-wx3m, MINI-7m5m-c7w3-hm3q, MINI-8v5m-49mj-6j9j, MINI-gmv8-pmjx-4x6f, MINI-hpqw-72x2-g6jv, MINI-j45g-8hf7-hrv8, MINI-j5hm-qmmq-p58m, MINI-j65h-9mw7-778r, MINI-j6hw-hmg9-wm6h, MINI-jhqp-q5rh-3vgw, MINI-r352-xwwv-7w5h, MINI-rc9g-46wh-49ff, MINI-w649-pj67-v4mf, MINI-wmrq-5gh2-vf66, MINI-x9h4-xwhm-98rj, ROOT-APP-NPM-CVE-2026-2391, UBUNTU-CVE-2026-2391

## What is CVE-2026-2391?

CVE-2026-2391 is a medium-severity denial of service vulnerability in qs_project:qs, published on 12 Feb 2026. An attacker can exploit it over the internet without logging in, with no action from the victim.

### Official description

### Summary
The `arrayLimit` option in qs does not enforce limits for comma-separated values when `comma: true` is enabled, allowing attackers to cause denial-of-service via memory exhaustion. This is a bypass of the array limit enforcement, similar to the bracket notation bypass addressed in GHSA-6rw7-vpxm-498p (CVE-2025-15284).

### Details
When the `comma` option is set to `true` (not the default, but configurable in applications), qs allows parsing comma-separated strings as arrays (e.g., `?param=a,b,c` becomes `['a', 'b', 'c']`). However, the limit check for `arrayLimit` (default: 20) and the optional throwOnLimitExceeded occur after the comma-handling logic in `parseArrayValue`, enabling a bypass. This permits creation of arbitrarily large arrays from a single parameter, leading to excessive memory allocation.

**Vulnerable code** (lib/parse.js: lines ~40-50):
```js
if (val && typeof val === 'string' && options.comma && val.indexOf(',') > -1) {
    return val.split(',');
}

if (options.throwOnLimitExceeded && currentArrayLength >= options.arrayLimit) {
    throw new RangeError('Array limit exceeded. Only ' + options.arrayLimit + ' element' + (options.arrayLimit === 1 ? '' : 's') + ' allowed in an array.');
}

return val;
```
The `split(',')` returns the array immediately, skipping the subsequent limit check. Downstream merging via `utils.combine` does not prevent allocation, even if it marks overflows for sparse arrays.This discrepancy allows attackers to send a single parameter with millions of commas (e.g., `?param=,,,,,,,,...`), allocating massive arrays in memory without triggering limits. It bypasses the intent of `arrayLimit`, which is enforced correctly for indexed (`a[0]=`) and bracket (`a[]=`) notations (the latter fixed in v6.14.1 per GHSA-6rw7-vpxm-498p).

### PoC
**Test 1 - Basic bypass:**
```
npm install qs
```

```js
const qs = require('qs');

const payload = 'a=' + ','.repeat(25);  // 26 elements after split (bypasses arrayLimit: 5)
const options = { comma: true, arrayLimit: 5, throwOnLimitExceeded: true };

try {
  const result = qs.parse(payload, options);
  console.log(result.a.length);  // Outputs: 26 (bypass successful)
} catch (e) {
  console.log('Limit enforced:', e.message);  // Not thrown
}
```
**Configuration:**
- `comma: true`
- `arrayLimit: 5`
- `throwOnLimitExceeded: true`

Expected: Throws "Array limit exceeded" error.
Actual: Parses successfully, creating an array of length 26.

### Impact
Denial of Service (DoS) via memory exhaustion.

Weakness: CWE-20 (Improper Input Validation)

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

2 open source packages ship an affected version, including qs. It affects 1 product.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `qs` | npm | From 6.7.0 | 6.14.2 |
| `qs` | npm | From 6.7.0 | 6.14.2 |

Products: Qs Project Qs.

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

Upgrade qs to 6.14.2 or later.

## Is CVE-2026-2391 being exploited?

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

## Other vulnerabilities in qs_project:qs

- [CVE-2014-10064](https://insights.sbomify.com/CVE-2014-10064/): Denial-of-Service Extended Event Loop Blocking in qs (high 7.5)
- [CVE-2017-1000048](https://insights.sbomify.com/CVE-2017-1000048/): Prototype Pollution Protection Bypass in qs (high 7.5)
- [CVE-2025-15284](https://insights.sbomify.com/CVE-2025-15284/): arrayLimit bypass in bracket notation allows DoS via memory exhaustion (medium 6.3)

## Fix prompt for AI coding agents

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

What it is: CVE-2026-2391 is a medium-severity denial of service vulnerability in qs_project:qs, published on 12 Feb 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-2391 exists.

Affected packages and fixed versions:
- qs (npm): affected from 6.7.0; fixed in 6.14.2
- qs (npm): affected from 6.7.0; fixed in 6.14.2

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-2391/ (Markdown: https://insights.sbomify.com/CVE-2026-2391/index.md)
```

## Sources

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

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