pkg: Update qs to v6.14.2 [SECURITY] - autoclosed#3728
pkg: Update qs to v6.14.2 [SECURITY] - autoclosed#3728renovate[bot] wants to merge 1 commit intomasterfrom
qs to v6.14.2 [SECURITY] - autoclosed#3728Conversation
|
|
Size Change: 0 B Total Size: 79.8 kB ℹ️ View Unchanged
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #3728 +/- ##
=======================================
Coverage 98.13% 98.13%
=======================================
Files 150 150
Lines 2736 2736
Branches 537 537
=======================================
Hits 2685 2685
Misses 11 11
Partials 40 40 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
qs to v6.14.2 [SECURITY]qs to v6.14.2 [SECURITY] - autoclosed
This PR contains the following updates:
6.14.1→6.14.2GitHub Vulnerability Alerts
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)Configuration
📅 Schedule: Branch creation - "" in timezone America/Chicago, Automerge - At any time (no schedule defined).
🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻ 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.