Skip to content

chore(deps): update dependency qs@<6.14.1 to >=6.15.1 [security]#3847

Open
renovate[bot] wants to merge 1 commit into
mainfrom
renovate-npm-qs-6.14.1-vulnerability
Open

chore(deps): update dependency qs@<6.14.1 to >=6.15.1 [security]#3847
renovate[bot] wants to merge 1 commit into
mainfrom
renovate-npm-qs-6.14.1-vulnerability

Conversation

@renovate
Copy link
Copy Markdown
Contributor

@renovate renovate Bot commented Mar 1, 2026

This PR contains the following updates:

Package Change Age Confidence
qs@<6.14.1 >=6.14.1>=6.15.1 age confidence

qs's arrayLimit bypass in comma parsing allows denial of service

CVE-2026-2391 / GHSA-w7fw-mjwx-w883

More information

Details

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):

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

Suggested Fix

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

Current code (lib/parse.js: lines ~40-50):

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;

Fixed code:

if (val && typeof val === 'string' && options.comma && val.indexOf(',') > -1) {
    const splitArray = val.split(',');
    if (splitArray.length > options.arrayLimit - currentArrayLength) {  // Check against remaining limit
        if (options.throwOnLimitExceeded) {
            throw new RangeError('Array limit exceeded. Only ' + options.arrayLimit + ' element' + (options.arrayLimit === 1 ? '' : 's') + ' allowed in an array.');
        } else {
            // Optionally convert to object or truncate, per README
            return splitArray.slice(0, options.arrayLimit - currentArrayLength);
        }
    }
    return splitArray;
}

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;

This aligns behavior with indexed and bracket notations, reuses currentArrayLength, and respects throwOnLimitExceeded. Update README to note the consistent enforcement.

Severity

  • CVSS Score: 3.7 / 10 (Low)
  • Vector String: CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:L

References

This data is provided by the GitHub Advisory Database (CC-BY 4.0).


Release Notes

ljharb/qs (qs@<6.14.1)

v6.15.1

Compare Source

  • [Fix] parse: parameterLimit: Infinity with throwOnLimitExceeded: true silently drops all parameters
  • [Deps] update @ljharb/eslint-config
  • [Dev Deps] update @ljharb/eslint-config, iconv-lite
  • [Tests] increase coverage

v6.15.0

Compare Source

  • [New] parse: add strictMerge option to wrap object/primitive conflicts in an array (#​425, #​122)
  • [Fix] duplicates option should not apply to bracket notation keys (#​514)

v6.14.2

Compare Source

  • [Fix] parse: mark overflow objects for indexed notation exceeding arrayLimit (#​546)
  • [Fix] arrayLimit means max count, not max index, in combine/merge/parseArrayValue
  • [Fix] parse: throw on arrayLimit exceeded with indexed notation when throwOnLimitExceeded is true (#​529)
  • [Fix] parse: enforce arrayLimit on comma-parsed values
  • [Fix] parse: fix error message to reflect arrayLimit as max index; remove extraneous comments (#​545)
  • [Robustness] avoid .push, use void
  • [readme] document that addQueryPrefix does not add ? to empty output (#​418)
  • [readme] clarify parseArrays and arrayLimit documentation (#​543)
  • [readme] replace runkit CI badge with shields.io check-runs badge
  • [meta] fix changelog typo (arrayLengtharrayLimit)
  • [actions] fix rebase workflow permissions

Configuration

📅 Schedule: (UTC)

  • Branch creation
    • ""
  • Automerge
    • At any time (no schedule defined)

🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 Ignore: Close this PR and you won't be reminded about this update again.


  • If you want to rebase/retry this PR, check this box

This PR was generated by Mend Renovate. View the repository job log.

@renovate renovate Bot added the dependencies Pull requests that update a dependency label Mar 1, 2026
@netlify
Copy link
Copy Markdown

netlify Bot commented Mar 1, 2026

Deploy Preview for brilliant-pasca-3e80ec canceled.

Name Link
🔨 Latest commit 9c74e25
🔍 Latest deploy log https://app.netlify.com/projects/brilliant-pasca-3e80ec/deploys/69ffc7ea1b368c0008a4bbb3

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Mar 1, 2026

🚀 Performance Test Results

Test Configuration:

  • VUs: 4
  • Duration: 1m0s

Test Metrics:

  • Requests/s: 43.25
  • Iterations/s: 14.41
  • Failed Requests: 0.00% (0 of 2602)
📜 Logs

> performance@1.0.0 run-tests:testenv /home/runner/work/rafiki/rafiki/test/performance
> ./scripts/run-tests.sh -e test -k -q --vus 4 --duration 1m

Cloud Nine GraphQL API is up: http://localhost:3101/graphql
Cloud Nine Wallet Address is up: http://localhost:3100/
Happy Life Bank Address is up: http://localhost:4100/
cloud-nine-wallet-test-backend already set
cloud-nine-wallet-test-auth already set
happy-life-bank-test-backend already set
happy-life-bank-test-auth already set
     data_received..................: 939 kB 16 kB/s
     data_sent......................: 2.0 MB 33 kB/s
     http_req_blocked...............: avg=8.45µs   min=1.94µs   med=5.62µs   max=3.06ms   p(90)=6.97µs   p(95)=7.76µs  
     http_req_connecting............: avg=301ns    min=0s       med=0s       max=216.74µs p(90)=0s       p(95)=0s      
     http_req_duration..............: avg=91.8ms   min=7.79ms   med=72.92ms  max=709.41ms p(90)=162.17ms p(95)=182.79ms
       { expected_response:true }...: avg=91.8ms   min=7.79ms   med=72.92ms  max=709.41ms p(90)=162.17ms p(95)=182.79ms
     http_req_failed................: 0.00%  ✓ 0         ✗ 2602
     http_req_receiving.............: avg=91.75µs  min=19.47µs  med=82.97µs  max=1.14ms   p(90)=122.65µs p(95)=153.55µs
     http_req_sending...............: avg=35.82µs  min=8.05µs   med=28.52µs  max=2.02ms   p(90)=39.29µs  p(95)=53.32µs 
     http_req_tls_handshaking.......: avg=0s       min=0s       med=0s       max=0s       p(90)=0s       p(95)=0s      
     http_req_waiting...............: avg=91.68ms  min=7.64ms   med=72.82ms  max=709.29ms p(90)=162.06ms p(95)=182.7ms 
     http_reqs......................: 2602   43.252014/s
     iteration_duration.............: avg=277.11ms min=159.33ms med=266.95ms max=851.87ms p(90)=337.11ms p(95)=363.44ms
     iterations.....................: 867    14.411797/s
     vus............................: 4      min=4       max=4 
     vus_max........................: 4      min=4       max=4 

@renovate renovate Bot changed the title chore(deps): update dependency qs@&lt;6.14.1 to >=6.15.0 [security] chore(deps): update dependency qs@&lt;6.14.1 to >=6.14.2 [security] Mar 1, 2026
@renovate renovate Bot force-pushed the renovate-npm-qs-6.14.1-vulnerability branch from cb07b7a to 99b7163 Compare March 1, 2026 21:08
@renovate renovate Bot changed the title chore(deps): update dependency qs@&lt;6.14.1 to >=6.14.2 [security] chore(deps): update dependency qs@&lt;6.14.1 to >=6.15.0 [security] Mar 5, 2026
@renovate renovate Bot force-pushed the renovate-npm-qs-6.14.1-vulnerability branch 2 times, most recently from e2788d9 to c2f7e09 Compare March 5, 2026 09:57
@renovate renovate Bot changed the title chore(deps): update dependency qs@&lt;6.14.1 to >=6.15.0 [security] chore(deps): update dependency qs@&lt;6.14.1 to >=6.14.2 [security] Mar 5, 2026
@renovate renovate Bot force-pushed the renovate-npm-qs-6.14.1-vulnerability branch from c2f7e09 to 04b8130 Compare March 5, 2026 17:41
@renovate renovate Bot changed the title chore(deps): update dependency qs@&lt;6.14.1 to >=6.14.2 [security] chore(deps): update dependency qs@&lt;6.14.1 to >=6.15.0 [security] Mar 5, 2026
@renovate renovate Bot changed the title chore(deps): update dependency qs@&lt;6.14.1 to >=6.15.0 [security] chore(deps): update dependency qs@<6.14.1 to >=6.15.1 [security] Apr 15, 2026
@renovate renovate Bot force-pushed the renovate-npm-qs-6.14.1-vulnerability branch from 04b8130 to 550a1a3 Compare April 15, 2026 22:05
@renovate renovate Bot force-pushed the renovate-npm-qs-6.14.1-vulnerability branch from 550a1a3 to 9b1d0ec Compare May 3, 2026 19:36
@renovate renovate Bot force-pushed the renovate-npm-qs-6.14.1-vulnerability branch from 9b1d0ec to 9c74e25 Compare May 9, 2026 23:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dependencies Pull requests that update a dependency

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants