Update dependency qs to v6.14.1 [SECURITY] #16
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR contains the following updates:
6.9.0→6.14.1GitHub Vulnerability Alerts
CVE-2022-24999
qs before 6.10.3 allows attackers to cause a Node process hang because an
__ proto__key can be used. In many typical web framework use cases, an unauthenticated remote attacker can place the attack payload in the query string of the URL that is used to visit the application, such asa[__proto__]=b&a[__proto__]&a[length]=100000000. The fix was backported to qs 6.9.7, 6.8.3, 6.7.3, 6.6.1, 6.5.3, 6.4.1, 6.3.3, and 6.2.4.CVE-2025-15284
Summary
The
arrayLimitoption in qs does not enforce limits for bracket notation (a[]=1&a[]=2), allowing attackers to cause denial-of-service via memory exhaustion. Applications usingarrayLimitfor DoS protection are vulnerable.Details
The
arrayLimitoption only checks limits for indexed notation (a[0]=1&a[1]=2) but completely bypasses it for bracket notation (a[]=1&a[]=2).Vulnerable code (
lib/parse.js:159-162):Working code (
lib/parse.js:175):The bracket notation handler at line 159 uses
utils.combine([], leaf)without validating againstoptions.arrayLimit, while indexed notation at line 175 checksindex <= options.arrayLimitbefore creating arrays.PoC
Test 1 - Basic bypass:
Test 2 - DoS demonstration:
Configuration:
arrayLimit: 5(test 1) orarrayLimit: 100(test 2)a[]=value(not indexeda[0]=value)Impact
Denial of Service via memory exhaustion. Affects applications using
qs.parse()with user-controlled input andarrayLimitfor protection.Attack scenario:
GET /api/search?filters[]=x&filters[]=x&...&filters[]=x(100,000+ times)qs.parse(query, { arrayLimit: 100 })Real-world impact:
Suggested Fix
Add
arrayLimitvalidation to the bracket notation handler. The code already calculatescurrentArrayLengthat line 147-151, but it's not used in the bracket notation handler at line 159.Current code (
lib/parse.js:159-162):Fixed code:
This makes bracket notation behaviour consistent with indexed notation, enforcing
arrayLimitand converting to object when limit is exceeded (per README documentation).Release Notes
ljharb/qs (qs)
v6.14.1Compare Source
[]notation as wellparse: when a custom decoder returnsnullfor a key, ignore that keyparse: extract key segment splitting helperstringify: increase coverageeslint,@ljharb/eslint-config,npmignore,es-value-fixtures,for-each,object-inspectv6.14.0Compare Source
parse: addthrowOnParameterLimitExceededoption (#517)parse: useutils.combinemoreparse: add explicitthrowOnLimitExceededdefaultside-channeles-value-fixtures,has-bigints,has-proto,has-symbolsv6.13.1Compare Source
stringify: avoid a crash when afilterkey isnullutils.merge: functions should not be stringified into keysparse: avoid a crash with interpretNumericEntities: true, comma: true, and iso charsetstringify: ensure a non-stringfilterdoes not crash__proto__syntax instead ofObject.createfor null objectsutils.merge: add some coveragees-value-fixtures,mock-property,object-inspect,tapev6.13.0Compare Source
parse: addstrictDepthoption (#511)npm auditinstead ofaudv6.12.3Compare Source
parse: properly account forstrictNullHandlingwhenallowEmptyArraysv6.12.2Compare Source
parse: parse encoded square brackets (#506)v6.12.1Compare Source
parse: DisabledecodeDotInKeysby default to restore previous behavior (#501)utils: Optimize performance under large data volumes, reduce memory usage, and speed up processing (#502)utils: use+=v6.12.0Compare Source
parse/stringify: adddecodeDotInKeys/encodeDotKeysoptions (#488)parse: addduplicatesoptionparse/stringify: addallowEmptyArraysoption to allow [] in object values (#487)parse/stringify: move allowDots config logic to its own variablestringify: move option-handling code intonormalizeStringifyOptionsstringify: clarify defaultarrayFormatbehaviorside-channelsideEffectsflagparse: remove useless tests; add coveragestringify: increase coveragemock-propertystringify: improve coverage@ljharb/eslint-config,aud,has-override-mistake,has-property-descriptors,mock-property,npmignore,object-inspect,tapeglob, since v10.3.8+ requires a brokenjackspeakjackspeaksince 2.1.2+ depends on npm aliases, which kill the install process in npm < 6v6.11.2Compare Source
parse: Fix parsing when the global Object prototype is frozen (#473)v6.11.1Compare Source
stringify: encode comma values more consistently (#463)filteroption for injecting custom serialization, i.e. of custom types (#447)@ljharb/eslint-config,aud,object-inspect,tapev6.11.0Compare Source
stringify: revert0e903c0; addcommaRoundTripoption (#442)v6.10.5Compare Source
stringify: witharrayFormat: comma, properly include an explicit[]on a single-item array (#434)v6.10.4Compare Source
stringify: witharrayFormat: comma, include an explicit[]on a single-item array (#441)npmignoreto autogenerate an npmignore fileeslint,@ljharb/eslint-config,aud,has-symbol,object-inspect,tapev6.10.3Compare Source
parse: ignore__proto__keys (#428)stringify: avoid relying on a globalundefined(#427)eslint,@ljharb/eslint-config,object-inspect,tapev6.10.2Compare Source
stringify: actually fix cyclic references (#426)stringify: avoid encoding arrayformat comma whenencodeValuesOnly = true(#424)eslint,@ljharb/eslint-config,aud,object-inspect,safe-publish-latest,tapev6.10.1Compare Source
stringify: avoid exception on repeated object values (#402)v6.10.0Compare Source
stringify: throw on cycles, instead of an infinite loop (#395, #394, #393)parse: addallowSparseoption for collapsing arrays with missing indices (#312)npm run distin publish, not installeslint,@ljharb/eslint-config,aud,has-symbols,tapeljharb/actions/node/installinstead ofljharb/actions/node/runv6.9.7Compare Source
parse: ignore__proto__keys (#428)stringify: avoid encoding arrayformat comma whenencodeValuesOnly = true(#424)stringify: avoid relying on a globalundefined(#427)v6.9.6Compare Source
distdir; mistakenly removed ind4f6c32v6.9.5Compare Source
stringify: do not encode parens for RFC1738stringify: fix arrayFormat comma with empty array/objects (#350)format: removeutil.assigncallpull_request_targeteventstringify: add tests for #378nycon all tests; usetaperunnereslint,@ljharb/eslint-config,browserify,mkdirp,object-inspect,tape; addaudv6.9.4Compare Source
stringify: whenarrayFormatiscomma, respectserializeDate(#364)stringify: reduce branching (part of #350)maybeMaptoutilsbrowserify,tapev6.9.3Compare Source
v6.9.2Compare Source
parse: Fix parsing array from object withcommatrue (#359)parse: throw a TypeError instead of an Error for bad charset (#349)eslint,@ljharb/eslint-config,object-inspect,has-symbols,tape,mkdirp,iconv-litev6.9.1Compare Source
parse: with comma true, handle field that holds an array of arrays (#335)parse: with comma true, do not split non-string values (#334)fundingfieldeslint,@ljharb/eslint-configConfiguration
📅 Schedule: Branch creation - "" (UTC), 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.
This PR was generated by Mend Renovate. View the repository job log.