@@ -20,6 +20,7 @@ following limits is missing or set inappropriately (i.e. too low/high)
20
20
* Number of processes
21
21
* Request payload size (e.g. uploads)
22
22
* Number of requests per client/resource
23
+ * Number of records per page to return in a single request response
23
24
24
25
## Example Attack Scenarios
25
26
@@ -40,6 +41,18 @@ combinations using a multi-thread script, against the
40
41
` /api/system/verification-codes/{smsToken} ` endpoint to discover the right token
41
42
within a few minutes.
42
43
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
+
43
56
## How To Prevent
44
57
45
58
* Docker makes it easy to limit [ memory] [ 1 ] , [ CPU] [ 2 ] , [ number of restarts] [ 3 ] ,
@@ -48,6 +61,9 @@ within a few minutes.
48
61
timeframe.
49
62
* Notify the client when the limit is exceeded by providing the limit number and
50
63
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.
51
67
52
68
## References
53
69
0 commit comments