-
-
Notifications
You must be signed in to change notification settings - Fork 20.6k
api: clamp public /api/prompts pagination parameters #1129
Copy link
Copy link
Open
Description
Summary
The public GET /api/prompts endpoint currently parses page and perPage directly from query params without bounding them.
Impact
A client can request arbitrarily large perPage values (or malformed values) and force oversized database reads / response payloads on a public endpoint.
Reproduction
GET /api/prompts?perPage=1000000&page=1
Expected
pageshould be normalized to a sane positive integerperPageshould be clamped to a small public maximum- malformed values should fall back to defaults instead of propagating unexpected
NaN/ oversized values
Proposed fix
Add a small pagination parser for the public endpoint that defaults invalid values and clamps perPage to a public maximum.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels
Projects
Status
In progress