Vulnerability
CVE-2026-2391
### 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.
299 advisories report this vulnerability, across 7 ecosystems.
Advisories in Wolfi
- CGA-22vm-jx44-x8p5
- CGA-25c3-v438-5769
- CGA-29xr-h626-2mww
- CGA-2cvv-57g4-2wjj
- CGA-2vv5-xp8q-2qxf
- CGA-2xqc-hmp4-jjr8
- CGA-35g7-pj9c-8rhw
- CGA-39pv-8q59-mw97
- CGA-3gq4-67mr-f9pp
- CGA-3pf6-jgfw-4hjx
- CGA-3q36-rcpx-27pv
- CGA-468m-8rx3-589j
- CGA-53qq-6p62-hjv7
- CGA-56pj-68cj-j7ww
- CGA-5fjj-5mgp-42f5
- CGA-5j57-m97g-rgc9
- CGA-5pwv-6264-845g
- CGA-5v5g-8994-8cxp
- CGA-69j6-g7r7-pjmp
- CGA-6p23-5qgm-6j6g
- CGA-6v7x-j6jf-4v8r
- CGA-6w32-pxm4-w273
- CGA-76hf-hg7p-v792
- CGA-76rm-m4r7-87m3
- CGA-76wq-7m9g-rmrx
- CGA-78wp-h489-87qw
- CGA-795c-9wv8-2cq4
- CGA-7ch7-23qp-hh56
- CGA-7hgc-3m7f-wj5v
- CGA-7p32-52jr-gcpj
- CGA-86g6-m997-cvv7
- CGA-8grw-2g29-f7mp
- CGA-8h5f-fv28-9ff2
- CGA-8mhj-322m-487p
- CGA-8qmj-vjvc-p85c
- CGA-93w8-cwqq-xw9m
- CGA-9747-ghc6-mc5p
- CGA-9ccg-fvj7-rpgm
- CGA-9h3m-hrwm-326f
- CGA-9hcc-qh8v-v553
- CGA-9p2h-rjq2-r9j9
- CGA-9vgg-fc8m-87qv
- CGA-c3mc-277x-7h8p
- CGA-chff-ghgx-c2c9
- CGA-cjqq-xf4w-m22f
- CGA-cwm5-cwjm-3j8v
- CGA-cxfr-pxp9-6v92
- CGA-f8x8-2vxm-88j4
- CGA-fgcc-p9ph-wcxw
- CGA-fj5h-2xp5-6wjf
- CGA-fp4m-vh5c-cvw7
- CGA-frm9-xcrh-4p49
- CGA-g2gq-3mp4-h69p
- CGA-g42g-x8p2-5v48
- CGA-g673-j2xv-9q9w
- CGA-g6cc-gj5r-mg8r
- CGA-g728-9fgx-4gmw
- CGA-g78w-xvm7-58cj
- CGA-g9f3-3335-vjgq
- CGA-gcqj-v6v9-jv36
- CGA-ggvp-8wc4-fjf5
- CGA-grcw-crhw-v72w
- CGA-gvw9-vx4c-2pxm
- CGA-h4wx-5j32-7jwh
- CGA-h525-7vmh-mv24
- CGA-h5h5-hf4q-cf75
- CGA-h5pr-pjh9-hrq4
- CGA-hj3c-5qjh-xp9f
- CGA-hq54-xq52-73r2
- CGA-hv43-m49r-hf7m
- CGA-j2f9-jh5v-9g28
- CGA-jfm2-mv4q-v464
- CGA-m393-8w85-2gcv
- CGA-m8hm-cx9r-2r99
- CGA-mgm2-ffcp-5cr2
- CGA-mw4c-47qf-2q5c
- CGA-p3x7-96hc-mr7g
- CGA-pgj4-qhq9-8hgw
- CGA-phhm-jvfr-g6r2
- CGA-pjx7-8hhw-35pq
- CGA-pmqf-p39c-3q7j
- CGA-pp32-m98f-94p6
- CGA-pr4r-q5vc-r48r
- CGA-prjp-xvp6-3v9f
- CGA-pwc3-g6mf-fmpg
- CGA-q2x5-g2wh-3wj7
- CGA-q39w-653f-v54w
- CGA-q45v-33c5-3pcx
- CGA-q8fh-h6mm-v96v
- CGA-r3xr-f434-qhqp
- CGA-r8p6-ppph-p2jx
- CGA-rf4c-jq4m-gj8w
- CGA-rq43-2r4x-fvhr
- CGA-rr9q-rrx3-24fx
- CGA-v6fh-p379-3cpp
- CGA-v7q7-q742-5fcc
- CGA-v8mx-vcvc-8fpj
- CGA-vfp9-75c2-mfq7
- CGA-vg83-8mrc-vg24
- CGA-w6f7-pxp3-9q7j
Showing the first 100. The API lists them all: /api/v1/vulnerabilities/CVE-2026-2391.