CVE-2026-2391: Qs Denial of Service Vulnerability
LOWCVE-2026-2391 is a LOW (CVSS 3.7) denial of service vulnerability (CWE-20: Improper Input Validation) affecting Qs libraries in the npm ecosystem. The issue involves qs's arraylimit bypass in comma parsing allows denial of service. Remediation is available by upgrading affected packages to version 6.14.2.
CVE-2026-2391 at a Glance
Security Impact
CVSS: 3.7
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:L).
How to Fix CVE-2026-2391
To remediate this vulnerability, upgrade all affected Qs dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
npm install qs@6.14.2
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
npm ls qs
How to Check if You Are Affected
To determine whether your Node.js application is affected by CVE-2026-2391, inspect your project dependencies using npm:
npm ls qs
Analyze the terminal output to locate any version of Qs in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 6.14.2), your application is affected.
Note: The npm ls qs command inspects dependencies declared in your package.json and lockfile; it does not perform automated runtime dynamic scanning.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under CWE-20: Improper Input Validation, where the product receives input or data, but it does not validate or incorrectly validates that the input has the properties that are required to process the data safely and correctly. In Qs, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.
Source Advisory Statement
CVE-2026-2391 Affected Qs Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
qs
|
npm |
≥ 6.7.0
< 6.14.2
|
6.14.2
|
References
Frequently Asked Questions
What is CVE-2026-2391?
Which Qs versions are affected?
What version fixes CVE-2026-2391?
Is qs affected?
What is the CVSS score of CVE-2026-2391?
What CWE is associated with CVE-2026-2391?
How can I check npm dependencies for CVE-2026-2391?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-w7fw-mjwx-w883",
"modified" : "2026-02-12T20:07:59Z",
"published" : "2026-02-12T17:04:39Z",
"aliases" : [ "CVE-2026-2391" ],
"summary" : "qs's arrayLimit bypass in comma parsing allows denial of service",
"details" : "### Summary\nThe `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).\n\n### Details\nWhen 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.\n\n**Vulnerable code** (lib/parse.js: lines ~40-50):\n```js\nif (val && typeof val === 'string' && options.comma && val.indexOf(',') > -1) {\n return val.split(',');\n}\n\nif (options.throwOnLimitExceeded && currentArrayLength >= options.arrayLimit) {\n throw new RangeError('Array limit exceeded. Only ' + options.arrayLimit + ' element' + (options.arrayLimit === 1 ? '' : 's') + ' allowed in an array.');\n}\n\nreturn val;\n```\nThe `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).\n\n### PoC\n**Test 1 - Basic bypass:**\n```\nnpm install qs\n```\n\n```js\nconst qs = require('qs');\n\nconst payload = 'a=' + ','.repeat(25); // 26 elements after split (bypasses arrayLimit: 5)\nconst options = { comma: true, arrayLimit: 5, throwOnLimitExceeded: true };\n\ntry {\n const result = qs.parse(payload, options);\n console.log(result.a.length); // Outputs: 26 (bypass successful)\n} catch (e) {\n console.log('Limit enforced:', e.message); // Not thrown\n}\n```\n**Configuration:**\n- `comma: true`\n- `arrayLimit: 5`\n- `throwOnLimitExceeded: true`\n\nExpected: Throws \"Array limit exceeded\" error.\nActual: Parses successfully, creating an array of length 26.\n\n\n### Impact\nDenial of Service (DoS) via memory exhaustion.\n\n### Suggested Fix\nMove 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.\n\n**Current code** (lib/parse.js: lines ~40-50):\n```js\nif (val && typeof val === 'string' && options.comma && val.indexOf(',') > -1) {\n return val.split(',');\n}\n\nif (options.throwOnLimitExceeded && currentArrayLength >= options.arrayLimit) {\n throw new RangeError('Array limit exceeded. Only ' + options.arrayLimit + ' element' + (options.arrayLimit === 1 ? '' : 's') + ' allowed in an array.');\n}\n\nreturn val;\n```\n\n**Fixed code:**\n```js\nif (val && typeof val === 'string' && options.comma && val.indexOf(',') > -1) {\n const splitArray = val.split(',');\n if (splitArray.length > options.arrayLimit - currentArrayLength) { // Check against remaining limit\n if (options.throwOnLimitExceeded) {\n throw new RangeError('Array limit exceeded. Only ' + options.arrayLimit + ' element' + (options.arrayLimit === 1 ? '' : 's') + ' allowed in an array.');\n } else {\n // Optionally convert to object or truncate, per README\n return splitArray.slice(0, options.arrayLimit - currentArrayLength);\n }\n }\n return splitArray;\n}\n\nif (options.throwOnLimitExceeded && currentArrayLength >= options.arrayLimit) {\n throw new RangeError('Array limit exceeded. Only ' + options.arrayLimit + ' element' + (options.arrayLimit === 1 ? '' : 's') + ' allowed in an array.');\n}\n\nreturn val;\n```\nThis aligns behavior with indexed and bracket notations, reuses `currentArrayLength`, and respects `throwOnLimitExceeded`. Update README to note the consistent enforcement.",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:L"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "npm",
"name" : "qs"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "6.7.0"
}, {
"fixed" : "6.14.2"
} ]
} ],
"database_specific" : {
"last_known_affected_version_range" : "<= 6.14.1"
}
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/ljharb/qs/security/advisories/GHSA-w7fw-mjwx-w883"
}, {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2026-2391"
}, {
"type" : "WEB",
"url" : "https://github.com/ljharb/qs/commit/f6a7abff1f13d644db9b05fe4f2c98ada6bf8482"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/ljharb/qs"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-20" ],
"severity" : "LOW",
"github_reviewed" : true,
"github_reviewed_at" : "2026-02-12T17:04:39Z",
"nvd_published_at" : "2026-02-12T05:17:11Z"
}
}