Skip to main content

Boteraser | Website and Server Security Solutions

🛡️ CVE-2026-2391 — qs

🟢 CVSS 2.0 — Low ⚠️ Exploit Public CWE-20 OSV
2.0
CVSS Score
0 Low4 Medium7 High9 Critical10

Description

qs's arrayLimit bypass in comma parsing allows denial of service

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.

Suggested Fix

Move the arrayLimit check before the comma split in parseArrayValue, and enforce it on the resulting array length. Use currentArrayLength (already calculated upstream) for consistency with bracket notation fixes.

Current 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;

```

Fixed code:

```js

if (val && typeof val === 'string' && options.comma && val.indexOf(',') > -1) {

const splitArray = val.split(',');

if (splitArray.length > options.arrayLimit - currentArrayLength) { // Check against remaining limit

if (options.throwOnLimitExceeded) {

throw new RangeError('Array limit exceeded. Only ' + options.arrayLimit + ' element' + (options.arrayLimit === 1 ? '' : 's') + ' allowed in an array.');

} else {

// Optionally convert to object or truncate, per README

return splitArray.slice(0, options.arrayLimit - currentArrayLength);

}

}

return splitArray;

}

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;

```

This aligns behavior with indexed and bracket notations, reuses currentArrayLength, and respects throwOnLimitExceeded. Update README to note the consistent enforcement.

How this vulnerability can be exploited

This issue can be reached over the network, attack complexity is high, an attacker needs no privileges on the target. No user interaction is required. The scope is unchanged, so the impact stays within the vulnerable component. Rated impact: confidentiality none, integrity none, availability low.

CVSS metrics in full

The score comes from this vector: CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:L

  • Attack vector: Network — reachable from anywhere that can route to the service.
  • Attack complexity: High — the attacker first has to win a race, learn a secret or otherwise prepare the target.
  • Privileges required: None — an unauthenticated stranger can try it.
  • User interaction: None — nobody has to be tricked into anything.
  • Scope: Unchanged — the damage stays inside the vulnerable component.
  • Confidentiality impact: None.
  • Integrity impact: None.
  • Availability impact: Low — limited, and the attacker does not choose what is affected.

Weakness class

CVE-2026-2391 is classified as CWE-20: Improper Input Validation. The application accepts input without checking that it has the expected form, so malformed values reach code that assumes they are well formed.

Affected software

CVE-2026-2391 is recorded against 1 package.

  • qs

Timeline and source

Published on 12 February 2026 and last revised on 8 July 2026. A public exploit is known to exist, which raises the urgency of patching considerably. A vendor advisory or fix has been published. Record sourced from OSV.

References

github.com (Web)
nvd.nist.gov (Advisory)
github.com (Web)
github.com (Package)

Other advisories for this package

qs has other advisories on record. If you are patching this one, these are worth checking on the same host:

Same weakness in other software

These advisories are the same class of weakness (CWE-20: Improper Input Validation) in other software:

CVE-2026-2391 on other distributions

Each distribution ships its own build and its own fixed version. Pick the one you run:

Details

Severity LOW
CVSS Score 2.0
CVSS Vector CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:L
CWE CWE-20
Public Exploit ⚠️ Yes
Source OSV
Published 2026-02-12
Updated 2026-08-20
Modified 2026-07-08

Affected Packages

Software From version Fixed in
qs — —

Exploit Protection

Are you running qs?

CVE-2026-2391 carries CVSS 2.0 Low rating and a public exploit already exists. BotEraser checks your installation against this and other known CVE records, and blocks IPs associated with exploit activity.

Check My Site For CVE-2026-2391 →

No credit card required  ·  Results in minutes

ⓘ Data Notice: The information presented above has been compiled from publicly available internet sources. Boteraser aggregates this data solely for informational purposes and does not independently classify, evaluate, or endorse any findings about the vulnerabilities listed. The accuracy and completeness of this information is the sole responsibility of the original publishers. Boteraser and its operators accept no liability for any decisions made based on this data.

Browse related advisories

All advisoriesCVECVE 2026
✓