CVE-2026-2391 in ljharbinfo

Summary

by MITRE • 02/12/2026

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

Statistical analysis made it clear that VulDB provides the best quality for vulnerability data.

Analysis

by VulDB Data Team • 02/26/2026

The vulnerability described in CVE-2026-2391 affects the qs library, a widely used query string parsing utility in Node.js applications. This flaw specifically targets the `arrayLimit` enforcement mechanism when the `comma` option is enabled, creating a bypass that allows attackers to manipulate array size limits and cause memory exhaustion. The issue stems from the order of operations within the parsing logic, where comma-separated values are split into arrays before the limit check occurs, effectively circumventing intended protections.

The technical root cause lies in the parsing flow within lib/parse.js, where the comma handling logic executes before the array limit validation. When `options.comma` is set to true, the parser splits comma-separated strings into arrays immediately upon encountering commas, without first validating against the configured `arrayLimit`. This behavior is inconsistent with how other array notations such as bracket notation (`a[]=`) and indexed notation (`a[0]=`) are handled, where limit enforcement occurs correctly and prevents oversized arrays from being created. The flaw enables an attacker to craft malicious query parameters containing millions of commas, resulting in massive array allocations that can exhaust available memory and lead to denial-of-service conditions.

This vulnerability aligns with CWE-400, which covers excessive resource consumption, and represents a specific case of improper input validation in parsing functions. The bypass mechanism mirrors patterns seen in previous related vulnerabilities such as GHSA-6rw7-vpxm-498p (CVE-2025-15284), indicating a systemic issue in how different array representation formats are handled within the same library. From an operational standpoint, this flaw poses significant risk to web applications that rely on qs for parsing user input, as it allows adversaries to exploit memory consumption patterns without requiring complex payloads or multiple requests.

The impact of this vulnerability manifests primarily as a denial-of-service condition, where attackers can consume excessive memory resources through carefully crafted query parameters. The bypass is particularly dangerous because it operates silently, failing to trigger the expected `RangeError` that should occur when array limits are exceeded. Even when `throwOnLimitExceeded` is enabled, the limit enforcement is effectively disabled for comma-separated values, making the protection mechanism ineffective. The attack vector is straightforward and requires minimal complexity to execute, as demonstrated by the proof-of-concept that uses repeated commas to create arrays of arbitrary size.

Mitigation strategies should prioritize immediate patching of the qs library to version that addresses this specific bypass issue, ensuring that array limit enforcement occurs before comma splitting operations. Organizations should also implement input validation layers at the application level, including explicit checks for query parameter lengths and array sizes, to provide defense-in-depth protection. Network-level rate limiting and resource quotas can serve as additional safeguards to prevent exploitation, while monitoring systems should be configured to detect unusual memory consumption patterns that may indicate attempted exploitation. The fix should ensure consistent enforcement across all array representation formats within the library, maintaining alignment with industry best practices for secure input handling as defined by standards such as OWASP Top Ten and NIST guidelines for secure coding.

Responsible

Harborist

Reservation

02/12/2026

Disclosure

02/12/2026

Moderation

accepted

CPE

ready

EPSS

0.00050

KEV

no

Activities

very low

Sources

Interested in the pricing of exploits?

See the underground prices here!