GHSA-x5fp-wj9c-mxmx: Low severity npm/qs vulnerability

Published Sep 2, 2026
·
Updated

Summary

qs v6.15.3 allows bracket-key input to bypass arrayLimit and throwOnLimitExceeded when comma: true. The input a[]=1,2,3,4 succeeds with arrayLimit: 3, while the equivalent plain-key input is rejected.

Affected version tested:

text qs v6.15.3 commit 18d085e919dae70c8f1b200ab99323058edab2c2

Details

parseArrayValue() enforces the comma limit only for flat values. The a[] form is marked non-flat, so its comma-separated value is wrapped after parsing and the inner array is not checked. A single parameter can therefore materialize arbitrarily large arrays.

PoC

js const qs = require('qs') const options = { comma: true, arrayLimit: 3, throwOnLimitExceeded: true }

const result = qs.parse('a[]=1,2,3,4', options) console.log(result.a[0].length) // 4; expected RangeError

const big = qs.parse('a[]=' + '1,'.repeat(1000000) + '1', { comma: true, arrayLimit: 20 }) console.log(big.a[0].length) // 1000001

On v6.15.3, the first input parses successfully and the second creates an array with 1,000,001 elements. The equivalent a=1,2,3,4 input throws RangeError as expected.

Impact

An attacker who can supply a query string or form body can bypass configured array limits and force excessive memory allocation, causing denial of service. The limit must be applied after comma splitting and before the resulting array is wrapped.

Affected Software

1 affected componentFixes available
npm/qs>=6.14.2<=6.15.3
6.16.0

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade npm/qs to a version that resolves this vulnerability.

    Fixed in 6.16.0

Event History

Sep 2, 2026
Advisory Published
via GitHub·02:46 PM
Data Sourced
via GitHub·02:46 PM
DescriptionSeverityWeaknessAffected Software

Frequently Asked Questions

1

Which deployments are exposed to this behavior?

Deployments using qs with comma parsing enabled (comma: true) are exposed when they parse attacker-controlled query strings or form bodies. The bypass specifically uses bracket-key syntax such as a[]=1,2,3,4.

2

What does an attacker need to exploit it?

An attacker needs only the ability to supply a parsed query string or form body. No authentication or user interaction is indicated by the provided vector.

3

Why do existing array limits not prevent the issue?

With comma: true, qs applies the comma limit to flat values but not to bracket-key values. As a result, a[] values are wrapped after parsing and the inner comma-separated array is not checked against arrayLimit or throwOnLimitExceeded.

4

How can I check for the vulnerable parsing path?

Test parsing a[]=1,2,3,4 with comma: true, arrayLimit: 3, and throwOnLimitExceeded: true. On the tested qs v6.15.3 version, this succeeds and produces four elements, whereas a=1,2,3,4 throws a RangeError.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203