Skip to content

Fix: Allow unlimited query parameters in extended parser#7116

Closed
nmurrell07 wants to merge 1 commit intoexpressjs:masterfrom
nmurrell07:fix-query-param-limit-2
Closed

Fix: Allow unlimited query parameters in extended parser#7116
nmurrell07 wants to merge 1 commit intoexpressjs:masterfrom
nmurrell07:fix-query-param-limit-2

Conversation

@nmurrell07
Copy link

The qs library has a default parameterLimit of 1000, which silently truncates query parameters beyond that limit. This can cause data loss when handling requests with many query parameters.

Fix by setting parameterLimit: Infinity in the parseExtendedQueryString function, allowing all query parameters to be parsed.

Fixes: #5878

The qs library has a default parameterLimit of 1000, which silently
truncates query parameters beyond that limit. This can cause data loss
when handling requests with many query parameters.

Fix by setting parameterLimit: Infinity in the parseExtendedQueryString
function, allowing all query parameters to be parsed.

Fixes: expressjs#5878
Copy link
Contributor

@krzysdz krzysdz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removing the parameter limit potentially enables DOS attacks. I don't think this is a good idea.

By the way, querystring also has its own limit and quietly drops parameters that exceed it.

nmurrell07 pushed a commit to nmurrell07/express that referenced this pull request Mar 21, 2026
- Change default query parser from 'simple' to 'extended'
- Add 'query parser limit' setting with default of 10000
- Pass limit to query parser at parse time (not compile time)
- Fixes issue expressjs#5878 - query params truncated at 1000+ params
- Supersedes PR expressjs#7116 which used Infinity (security concern)
nmurrell07 pushed a commit to nmurrell07/express that referenced this pull request Mar 21, 2026
- Change default query parser from 'simple' to 'extended'
- Add 'query parser limit' setting with default of 10000
- Pass limit to query parser at parse time (not compile time)
- Fixes issue expressjs#5878 - query params truncated at 1000+ params
- Supersedes PR expressjs#7116 which used Infinity (security concern)
@krzysdz
Copy link
Contributor

krzysdz commented Mar 21, 2026

Superseded by #7117

@krzysdz krzysdz closed this Mar 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

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