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

> Archived entry. Full-text search covers entries since 2026-11-10; exact IDs work for all years.

- **Severity:** MEDIUM 6.3
- **CVSS:** 6.3 (v4.0, CNA) `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`
- **CVSS metrics:** Attack vector: Network; Attack complexity: Low; Attack requirements: Present; Privileges required: None; User interaction: None; Confidentiality impact: None; Integrity impact: None; Availability impact: Low; Confidentiality impact on other systems: None; Integrity impact on other systems: None; Availability impact on other systems: None
- **Exploited in the wild:** Not in CISA KEV
- **Public exploit / PoC:** None known
- **Remote exploitation:** Remote, no login needed
- **EPSS:** 0.65% (percentile 46, 2026-11-26)
- **CWE:** CWE-20
- **Aliases:** GHSA-w7fw-mjwx-w883
- **Published:** 2026-02-12T04:39:42.914Z
- **Modified:** 2026-09-10T03:50:35.973Z

## Who should check

- Projects that depend on npm package qs (\>= 6.7.0, \< 6.14.2)
- Anyone running qs \>= 6.7.0, \<= 6.14.1

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

## Affected and fixed versions

- npm `qs`: affected \>= 6.7.0, \< 6.14.2; fixed 6.14.2 (osv)
- qs: \>= 6.7.0, \<= 6.14.1 (cvelist)

## Mitigation

- Upgrade qs to 6.14.2 or later.

## Check your systems with an agent

Paste this into a coding agent:

```text
Check whether anything I run is affected by CVE-2026-2391. Work read-only: do not install, upgrade, delete or change anything.

Details: https://flawdb.com/CVE-2026-2391.md
Affected: qs >= 6.7.0, < 6.14.2
Fixed in: 6.14.2

Steps:
1. Search this machine and project for qs (npm), qs: dependency manifests and lockfiles, installed packages, container images and running services.
2. For each match, note the installed version and whether it is inside the affected range.
3. Report a table: location, installed version, affected (yes / no / unsure), evidence. If affected, say which fixed version or mitigation from the details link applies, but don't apply it.
```

## FAQ

### Is CVE-2026-2391 being exploited?

There is no confirmed exploitation: CVE-2026-2391 is not in the CISA Known Exploited Vulnerabilities catalog. No public exploit code is known. EPSS estimates a 0.65% chance of exploitation in the next 30 days (as of 2026-11-26).

### How serious is CVE-2026-2391?

Medium: CVSS 6.3 (v4.0, scored by CNA). Remote, no login needed.

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

qs \>= 6.7.0, \< 6.14.2.

### Is there a fix for CVE-2026-2391?

Yes. Fixed in 6.14.2. Upgrade qs to 6.14.2 or later.

### How do I check if I'm affected by CVE-2026-2391?

Find where you use the affected software (dependency lockfiles, installed packages, container images, servers) and compare the installed version with the affected range above. The agent prompt on this page does this read-only.

## References

- vendor: <https://github.com/ljharb/qs/security/advisories/GHSA-w7fw-mjwx-w883>
- vendor: <https://nvd.nist.gov/vuln/detail/CVE-2026-2391>
- patch: <https://github.com/ljharb/qs/commit/f6a7abff1f13d644db9b05fe4f2c98ada6bf8482>
- other: <https://github.com/ljharb/qs>

## Attribution

- CVE Program: CVE® is a registered trademark of The MITRE Corporation. CVE records © 1999–2026 The MITRE Corporation. <https://www.cve.org/Legal/TermsOfUse>
- NVD: This product uses data from the NVD API but is not endorsed or certified by the NVD. <https://nvd.nist.gov/vuln/detail/CVE-2026-2391>
- OSV: CC-BY 4.0 <https://osv.dev/vulnerability/GHSA-w7fw-mjwx-w883> (license: <https://creativecommons.org/licenses/by/4.0/>)

HTML: <https://flawdb.com/CVE-2026-2391> · JSON: <https://flawdb.com/api/v1/entries/CVE-2026-2391>
