chore(deps): update dependency qs to v6.14.2 [security]#741
chore(deps): update dependency qs to v6.14.2 [security]#741renovate[bot] wants to merge 1 commit intomasterfrom
Conversation
b17e6ed to
cb65216
Compare
cb65216 to
be59942
Compare
be59942 to
9b8bcc7
Compare
|
Warning Review the following alerts detected in dependencies. According to your organization's Security Policy, it is recommended to resolve "Warn" alerts. Learn more about Socket for GitHub.
|
9b8bcc7 to
ead3037
Compare
ead3037 to
1d6e959
Compare
1d6e959 to
21d0127
Compare
This PR contains the following updates:
6.14.0→6.14.2GitHub Vulnerability Alerts
CVE-2025-15284
Summary
The
arrayLimitoption in qs did not enforce limits for bracket notation (a[]=1&a[]=2), only for indexed notation (a[0]=1). This is a consistency bug;arrayLimitshould apply uniformly across all array notations.Note: The default
parameterLimitof 1000 effectively mitigates the DoS scenario originally described. With default options, bracket notation cannot produce arrays larger thanparameterLimitregardless ofarrayLimit, because eacha[]=valueconsumes one parameter slot. The severity has been reduced accordingly.Details
The
arrayLimitoption only checked limits for indexed notation (a[0]=1&a[1]=2) but did not enforce 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
Note on parameterLimit interaction: The original advisory's "DoS demonstration" claimed a length of 10,000, but
parameterLimit(default: 1000) caps parsing to 1,000 parameters. With default options, the actual output is 1,000, not 10,000.Impact
Consistency bug in
arrayLimitenforcement. With defaultparameterLimit, the practical DoS risk is negligible sinceparameterLimitalready caps the total number of parsed parameters (and thus array elements from bracket notation). The risk increases only whenparameterLimitis explicitly set to a very high value.CVE-2026-2391
Summary
The
arrayLimitoption in qs does not enforce limits for comma-separated values whencomma: trueis 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
commaoption is set totrue(not the default, but configurable in applications), qs allows parsing comma-separated strings as arrays (e.g.,?param=a,b,cbecomes['a', 'b', 'c']). However, the limit check forarrayLimit(default: 20) and the optional throwOnLimitExceeded occur after the comma-handling logic inparseArrayValue, 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):
The
split(',')returns the array immediately, skipping the subsequent limit check. Downstream merging viautils.combinedoes 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 ofarrayLimit, 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:
Configuration:
comma: truearrayLimit: 5throwOnLimitExceeded: trueExpected: 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
arrayLimitcheck before the comma split inparseArrayValue, and enforce it on the resulting array length. UsecurrentArrayLength(already calculated upstream) for consistency with bracket notation fixes.Current code (lib/parse.js: lines ~40-50):
Fixed code:
This aligns behavior with indexed and bracket notations, reuses
currentArrayLength, and respectsthrowOnLimitExceeded. Update README to note the consistent enforcement.Release Notes
ljharb/qs (qs)
v6.14.2Compare Source
parse: mark overflow objects for indexed notation exceedingarrayLimit(#546)arrayLimitmeans max count, not max index, incombine/merge/parseArrayValueparse: throw onarrayLimitexceeded with indexed notation whenthrowOnLimitExceededis true (#529)parse: enforcearrayLimitoncomma-parsed valuesparse: fix error message to reflect arrayLimit as max index; remove extraneous comments (#545).push, usevoidaddQueryPrefixdoes not add?to empty output (#418)parseArraysandarrayLimitdocumentation (#543)arrayLength→arrayLimit)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-inspectConfiguration
📅 Schedule: Branch creation - "" (UTC), Automerge - At any time (no schedule defined).
🚦 Automerge: Enabled.
♻ Rebasing: Whenever PR is behind base branch, 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.