At a glance
- Controls
- CWE-770
What it is
Some list endpoints return every matching record in one response. As the table grows, each call takes more memory, more database time and more bandwidth. Even when page size is offered, a missing upper limit lets a caller ask for everything.
An attacker calls the endpoint in a loop, or sets the page size to a huge number. The database and the application server slow down for everyone. AI tools can read an API description and spot list endpoints with no limit in seconds.
Where it hides
What a reviewer can look for in the code and in the behaviour, before anyone proves it.
- Export and download endpoints for orders, users or transactions
- Admin and reporting lists that were built for small data sets
- Page size or limit parameters that accept any number
- Search endpoints that return all matches
How MATT tests it
The proof runs against the deployed product, on every release, whoever wrote the code.
- 01Sign in with the test login and call each list endpoint with no paging parameters
- 02Call it again with a very large page size and note how many rows come back
- 03Compare response size and time against the documented limit, using only the test account's own data
Every list must be paginated with a maximum page size.
Executable checkas any user: GET /v1/orders expect: no more than the maximum page size of rows as any user: GET /v1/orders?limit=1000000 expect: 400, or a response capped at the maximum page size
Every rule MATT holds →What the fix looks like
- 01
Add pagination to every list endpoint, using cursors where tables are large
- 02
Set a default page size and a hard maximum on the server
- 03
Reject or clamp page sizes above the maximum
- 04
Move bulk exports to a queued job with its own limits
A check that was never written is found by proving the deployed behaviour, fixed with the engineer who shipped it, and kept fixed by running the control on every change. What is ExploitOps? →