CVE-2026-2391: CWE-20 Improper Input Validation
### 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.
AI Analysis
Technical Summary
CVE-2026-2391 is a vulnerability in the qs JavaScript library version 6.7.0 related to improper input validation (CWE-20). The issue occurs when the qs parser is configured with the comma option set to true, which allows parsing comma-separated strings into arrays. The arrayLimit option is intended to restrict the maximum number of elements in parsed arrays to prevent resource exhaustion. However, the limit enforcement happens after the comma-splitting logic in the parseArrayValue function. Specifically, when a string containing commas is split into an array, the function returns immediately without checking if the resulting array exceeds the configured arrayLimit. This bypasses the limit check, allowing attackers to craft a single query parameter with millions of commas, resulting in the allocation of very large arrays in memory. The downstream merging logic does not prevent this excessive allocation, leading to potential denial-of-service via memory exhaustion. This vulnerability is similar to a previously fixed issue (CVE-2025-15284) involving bracket notation bypasses but affects the comma parsing feature instead. The vulnerability does not require authentication or user interaction and can be triggered remotely by sending maliciously crafted HTTP requests. The default configuration of qs does not enable the comma option, so only applications explicitly enabling it are vulnerable. No official patch was linked at the time of disclosure, but the issue is expected to be fixed in future releases. The CVSS 4.0 base score is 6.3 (medium), reflecting network attack vector, low complexity, no privileges or user interaction required, and limited impact on availability via memory exhaustion.
Potential Impact
The primary impact of CVE-2026-2391 is denial-of-service (DoS) through memory exhaustion. Attackers can send specially crafted HTTP requests with query parameters containing extremely long comma-separated lists, causing the qs parser to allocate large arrays in memory. This can lead to application crashes, degraded performance, or complete service outages. Organizations running web applications or APIs that use the vulnerable qs version with comma parsing enabled are at risk. The vulnerability can be exploited remotely without authentication or user interaction, increasing its risk profile. While it does not directly compromise confidentiality or integrity, the availability impact can disrupt business operations, especially for high-traffic or resource-constrained environments. This may affect cloud services, SaaS platforms, and internal applications relying on qs for query string parsing. The lack of enforcement of array limits also increases the risk of resource exhaustion attacks at scale, potentially amplifying the impact in distributed denial-of-service (DDoS) scenarios. No known exploits in the wild have been reported yet, but the vulnerability is straightforward to trigger, making it a credible threat.
Mitigation Recommendations
1. Upgrade the qs library to a version where this vulnerability is patched once available. Monitor official qs repository and security advisories for updates addressing CVE-2026-2391. 2. If upgrading is not immediately possible, disable the comma option in qs configuration to prevent parsing comma-separated values as arrays. 3. Implement custom input validation and sanitization on query parameters before passing them to qs, limiting the length and format of inputs to prevent excessive commas or large arrays. 4. Employ web application firewalls (WAFs) or API gateways to detect and block suspicious query parameters with abnormally large numbers of commas or excessively long values. 5. Monitor application logs and memory usage for signs of abnormal resource consumption that could indicate exploitation attempts. 6. Consider rate limiting or throttling requests with large query strings to reduce the risk of DoS. 7. Review and test application error handling to ensure graceful degradation in case of parsing failures. 8. Educate development teams about secure configuration of third-party libraries and the risks of enabling non-default options without proper validation.
Affected Countries
United States, Germany, United Kingdom, India, China, Japan, South Korea, France, Canada, Australia
CVE-2026-2391: CWE-20 Improper Input Validation
Description
### 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.
AI-Powered Analysis
Machine-generated threat intelligence
Technical Analysis
CVE-2026-2391 is a vulnerability in the qs JavaScript library version 6.7.0 related to improper input validation (CWE-20). The issue occurs when the qs parser is configured with the comma option set to true, which allows parsing comma-separated strings into arrays. The arrayLimit option is intended to restrict the maximum number of elements in parsed arrays to prevent resource exhaustion. However, the limit enforcement happens after the comma-splitting logic in the parseArrayValue function. Specifically, when a string containing commas is split into an array, the function returns immediately without checking if the resulting array exceeds the configured arrayLimit. This bypasses the limit check, allowing attackers to craft a single query parameter with millions of commas, resulting in the allocation of very large arrays in memory. The downstream merging logic does not prevent this excessive allocation, leading to potential denial-of-service via memory exhaustion. This vulnerability is similar to a previously fixed issue (CVE-2025-15284) involving bracket notation bypasses but affects the comma parsing feature instead. The vulnerability does not require authentication or user interaction and can be triggered remotely by sending maliciously crafted HTTP requests. The default configuration of qs does not enable the comma option, so only applications explicitly enabling it are vulnerable. No official patch was linked at the time of disclosure, but the issue is expected to be fixed in future releases. The CVSS 4.0 base score is 6.3 (medium), reflecting network attack vector, low complexity, no privileges or user interaction required, and limited impact on availability via memory exhaustion.
Potential Impact
The primary impact of CVE-2026-2391 is denial-of-service (DoS) through memory exhaustion. Attackers can send specially crafted HTTP requests with query parameters containing extremely long comma-separated lists, causing the qs parser to allocate large arrays in memory. This can lead to application crashes, degraded performance, or complete service outages. Organizations running web applications or APIs that use the vulnerable qs version with comma parsing enabled are at risk. The vulnerability can be exploited remotely without authentication or user interaction, increasing its risk profile. While it does not directly compromise confidentiality or integrity, the availability impact can disrupt business operations, especially for high-traffic or resource-constrained environments. This may affect cloud services, SaaS platforms, and internal applications relying on qs for query string parsing. The lack of enforcement of array limits also increases the risk of resource exhaustion attacks at scale, potentially amplifying the impact in distributed denial-of-service (DDoS) scenarios. No known exploits in the wild have been reported yet, but the vulnerability is straightforward to trigger, making it a credible threat.
Mitigation Recommendations
1. Upgrade the qs library to a version where this vulnerability is patched once available. Monitor official qs repository and security advisories for updates addressing CVE-2026-2391. 2. If upgrading is not immediately possible, disable the comma option in qs configuration to prevent parsing comma-separated values as arrays. 3. Implement custom input validation and sanitization on query parameters before passing them to qs, limiting the length and format of inputs to prevent excessive commas or large arrays. 4. Employ web application firewalls (WAFs) or API gateways to detect and block suspicious query parameters with abnormally large numbers of commas or excessively long values. 5. Monitor application logs and memory usage for signs of abnormal resource consumption that could indicate exploitation attempts. 6. Consider rate limiting or throttling requests with large query strings to reduce the risk of DoS. 7. Review and test application error handling to ensure graceful degradation in case of parsing failures. 8. Educate development teams about secure configuration of third-party libraries and the risks of enabling non-default options without proper validation.
Technical Details
- Data Version
- 5.2
- Assigner Short Name
- harborist
- Date Reserved
- 2026-02-12T03:52:09.332Z
- Cvss Version
- 4.0
- State
- PUBLISHED
Threat ID: 698d7606c9e1ff5ad87e3c5d
Added to database: 2/12/2026, 6:41:10 AM
Last enriched: 2/19/2026, 2:02:31 PM
Last updated: 3/30/2026, 8:16:12 PM
Views: 193
Community Reviews
0 reviewsCrowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.
Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.
Actions
Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.
Need more coverage?
Upgrade to Pro Console for AI refresh and higher limits.
For incident response and remediation, OffSeq services can help resolve threats faster.
Latest Threats
Check if your credentials are on the dark web
Instant breach scanning across billions of leaked records. Free tier available.