fix: increase default query parameterLimit to prevent silent truncation#7386
Closed
hanu-14 wants to merge 1 commit into
Closed
fix: increase default query parameterLimit to prevent silent truncation#7386hanu-14 wants to merge 1 commit into
hanu-14 wants to merge 1 commit into
Conversation
Contributor
|
Increasing the limit does not solve the problem of silent truncation - only moves the point at which it will occur. Raising it too much may expose applications to DoS attacks. It looks like LLMs still don't understand the real problem described in #5878. Make sure to read the issue that you're trying to solve and look at the comments and other PRs - this one repeats mistakes made by multiple other |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Fixes #5878
The qs library has a default parameterLimit of 1000, causing query strings with more than 1000 parameters to be silently truncated. This is especially dangerous in Express since there's no warning or error when data is lost.
Changed the default parameterLimit from 1000 to 100000 in the extended query parser to match user expectations and prevent silent data loss. Users can still override this by providing their own query parser function.
This aligns with how �ody-parser handles the same issue (returns an error when limit is exceeded). While body-parser throws, this change takes a softer approach by just raising the limit significantly.