{"id":"CVE-2026-2391","published":"2026-02-12T04:39:42Z","modified":"2026-02-12T17:32:05Z","title":"qs's arrayLimit bypass in comma parsing allows denial of service","vendor":null,"product":null,"tier":"tail","description":{"text":"### 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.","provenance":"source","from":"CVE.org"},"cvss":{"score":3.7,"severity":"LOW","version":"3.1","vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:L","provenance":"source","from":"CVE.org CNA"},"epss":{"score":0.00534,"percentile":0.4601,"provenance":"source"},"cwes":[{"id":"CWE-20","name":"Improper Input Validation"}],"references":[{"url":"https://github.com/ljharb/qs/security/advisories/GHSA-w7fw-mjwx-w883","tags":["vendor-advisory"]},{"url":"https://github.com/ljharb/qs/commit/f6a7abff1f13d644db9b05fe4f2c98ada6bf8482","tags":["patch"]}],"priority":{"score":11.8,"factors":[{"name":"EPSS percentile","points":9.2},{"name":"CVSS severity","points":2.59}]},"affectedVersions":[{"vendor":null,"product":null,"versions":[">= 6.7.0, <= 6.14.1"]}],"capec":[{"id":"CAPEC-130","name":"Excessive Allocation"}],"ssvc":{"exploitation":"poc","automatable":"yes","technicalImpact":"partial","timestamp":"2026-02-12T15:00:21.359233Z","from":"CISA ADP","provenance":"source"},"affected":[{"ecosystem":"npm","package":"qs","vulnerableRanges":[">=6.7.0, <6.14.2"],"patched":["6.14.2"],"from":["GHSA-w7fw-mjwx-w883"],"provenance":"source"}],"summary":{"text":"The qs library's comma-parsing path (parseArrayValue in lib/parse.js) returns split comma-separated values before the arrayLimit check runs, so the limit is not enforced when the comma option is enabled. An attacker who can send a crafted query-string parameter to an application that sets comma: true can make it build an arbitrarily large array from one parameter, causing memory exhaustion and denial of service, with no authentication or user interaction required, though the attack needs network access to the affected application and that configuration.","provenance":"ai","model":"claude-haiku-5-5","generatedAt":"2026-11-20T21:58:16Z"},"euvd":{"id":"EUVD-2026-6720","exploited":false,"provenance":"source"},"lineage":{"familyId":"fam-ljharb-qs-cve-2025-15284","parents":[{"from":"CVE-2025-15284","to":"CVE-2026-2391","relation":"successor","confidence":"high","kind":"lineage","evidence":[{"kind":"version-step","provenance":"source","package":"npm:qs","fromFixed":"6.14.1","toFixed":"6.14.2","daysApart":45},{"kind":"same-code","provenance":"machine","files":["lib/parse.js"],"commits":["https://github.com/ljharb/qs/commit/3086902ecf7f088d0d1803887643ac6c03d415b9","https://github.com/ljharb/qs/commit/f6a7abff1f13d644db9b05fe4f2c98ada6bf8482"],"basis":"shared function","functions":["parseQueryStringValues"]}]}],"children":[{"from":"CVE-2026-2391","to":"CVE-2026-82562","relation":"incomplete-fix","confidence":"high","kind":"lineage","evidence":[{"kind":"text","provenance":"source","relation":"incomplete-fix","quote":"This is the `[]=` key form that the fix for CVE-2026-2391 (qs 6.14.2) did not cover.","from":"CVE.org","in":"CVE-2026-82562"},{"kind":"osv-related","provenance":"source","id":"GHSA-w7fw-mjwx-w883","via":"related"},{"kind":"osv-related","provenance":"source","id":"GHSA-x5fp-wj9c-mxmx","via":"reference","url":"https://github.com/ljharb/qs/security/advisories/GHSA-w7fw-mjwx-w883"},{"kind":"same-code","provenance":"machine","files":["lib/parse.js"],"commits":["https://github.com/ljharb/qs/commit/f6a7abff1f13d644db9b05fe4f2c98ada6bf8482","https://github.com/ljharb/qs/commit/8859c37470e11b42b547b275e4e9bd0bc8cc5464"],"basis":"shared function","functions":["parseQueryStringValues"]}]}],"packageHistory":[{"cve":"CVE-2017-1000048","published":"2017-07-13","fixed":"6.3.2","kev":false},{"cve":"CVE-2022-24999","published":"2022-11-26","fixed":"6.10.3","kev":false},{"cve":"CVE-2025-15284","published":"2025-12-29","fixed":"6.14.1","kev":false},{"cve":"CVE-2026-2391","published":"2026-02-12","fixed":"6.14.2","kev":false},{"cve":"CVE-2026-8723","published":"2026-05-16","fixed":"6.15.2","kev":false,"link":{"from":"CVE-2026-2391","to":"CVE-2026-8723","relation":"successor","confidence":"low","kind":"sequence","evidence":[{"kind":"version-step","provenance":"source","package":"npm:qs","fromFixed":"6.14.2","toFixed":"6.15.2","daysApart":93}]}},{"cve":"CVE-2026-82417","published":"2026-08-29","fixed":"6.16.0","kev":false},{"cve":"CVE-2026-82562","published":"2026-08-29","fixed":"6.16.0","kev":false}],"package":"npm:qs"}}