You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The test: if (params.limit > config.MAX_LIMIT) params.limit = config.MAX_LIMIT; can be bypassed if a programming error or edge case exists resulting in params.limit = NaN.
An example is when parsing a query param using params.limit = parseInt(ctx.query.limit, 10).
In this case, params.limit will remain as NaN because NaN > 300 === false.
MongoDB will treat that as an infinite limit and fetch all documents, bypassing the limit value.
The text was updated successfully, but these errors were encountered:
Tested using the Mongoose Plugin.
The test:
if (params.limit > config.MAX_LIMIT) params.limit = config.MAX_LIMIT;
can be bypassed if a programming error or edge case exists resulting inparams.limit = NaN
.An example is when parsing a query param using
params.limit = parseInt(ctx.query.limit, 10)
.In this case,
params.limit
will remain asNaN
becauseNaN > 300 === false
.MongoDB will treat that as an infinite limit and fetch all documents, bypassing the limit value.
The text was updated successfully, but these errors were encountered: