Skip to content

Commit fcca22f

Browse files
committed
Merge branch 'pr-8' into develop
2 parents 3e805b3 + a3015d2 commit fcca22f

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

2019/en/src/0xa4-lack-of-resources-and-rate-limiting.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ following limits is missing or set inappropriately (i.e. too low/high)
2020
* Number of processes
2121
* Request payload size (e.g. uploads)
2222
* Number of requests per client/resource
23+
* Number of records per page to return in a single request response
2324

2425
## Example Attack Scenarios
2526

@@ -40,6 +41,18 @@ combinations using a multi-thread script, against the
4041
`/api/system/verification-codes/{smsToken}` endpoint to discover the right token
4142
within a few minutes.
4243

44+
### Scenario #3
45+
46+
We have an application that contains the users' list on a UI with a limit of
47+
`200` users per page. The users' list is retrieved from the server using the
48+
following query: `/api/users?page=1&size=100`. An attacker changes the `size`
49+
parameter to `200 000`, causing performance issues on the database. Meanwhile,
50+
the API becomes unresponsive and unable to handle further requests from this or
51+
any other clients (aka DoS).
52+
53+
The same scenario might be used to provoke Integer Overflow or Buffer Overflow
54+
errors.
55+
4356
## How To Prevent
4457

4558
* Docker makes it easy to limit [memory][1], [CPU][2], [number of restarts][3],
@@ -48,6 +61,9 @@ within a few minutes.
4861
timeframe.
4962
* Notify the client when the limit is exceeded by providing the limit number and
5063
the time at which the limit will be reset.
64+
* Add proper server side validation for query string and request body
65+
parameters, specifically the one that control the number of records to be
66+
returned in the response.
5167

5268
## References
5369

0 commit comments

Comments
 (0)