Skip to content

fix: increase default query parameterLimit to prevent silent truncation#7386

Closed
hanu-14 wants to merge 1 commit into
expressjs:masterfrom
hanu-14:fix/query-parameter-limit
Closed

fix: increase default query parameterLimit to prevent silent truncation#7386
hanu-14 wants to merge 1 commit into
expressjs:masterfrom
hanu-14:fix/query-parameter-limit

Conversation

@hanu-14

@hanu-14 hanu-14 commented Jul 18, 2026

Copy link
Copy Markdown

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.

@krzysdz

krzysdz commented Jul 18, 2026

Copy link
Copy Markdown
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 peoplebots (e.g. #7117 (review)). Finally, please don't open AI slop PRs with no human review.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Query Param Silently Remove param query value if it is over 1000

2 participants