Skip to content

Commit a3015d2

Browse files
committed
chore: review @IgorSasovets contribution
* Make "Is the API Vulnerable" addition, a single bullet paragraph * Simplify "Scenario #3" removing unnecessary details * Make "How to Prevent" recommendation specific to parameters that contol the response size Closes #3
1 parent 55eb86a commit a3015d2

File tree

1 file changed

+13
-17
lines changed

1 file changed

+13
-17
lines changed

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

Lines changed: 13 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +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-
24-
One more issue is Improper Query String Parameters validation. It could lead to
25-
DDoS attacks against the server. Widely spread problem is validation of such
26-
query string parameters as `size`, `page`, .etc. Absence of limitation for max,
27-
min values of these parameters might cause performance issues, Internal Server
28-
Errors.
23+
* Number of records per page to return in a single request response
2924

3025
## Example Attack Scenarios
3126

@@ -48,15 +43,15 @@ within a few minutes.
4843

4944
### Scenario #3
5045

51-
We have a MEAN stack application that contains the users list on a UI. List of
52-
users can be retrieved from the server using a following query:
53-
`/dashboard/users?page=1&size=100`. There are limitation on maximum number of
54-
users per page (on UI side) - 200 users. An attacker changes the size parameter
55-
in order to retrieve large number of users, for example 200 000 or more and it
56-
causes performance issues. For example, load on database increases and it isn't
57-
able to handle other requests; on UI side all functionality take more time to
58-
proceed because server doesn't return required information from the DB. The same
59-
scenario might be used to provoke `Integer Overflow` or `Buffer Overflow` errors.
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.
6055

6156
## How To Prevent
6257

@@ -66,8 +61,9 @@ scenario might be used to provoke `Integer Overflow` or `Buffer Overflow` errors
6661
timeframe.
6762
* Notify the client when the limit is exceeded by providing the limit number and
6863
the time at which the limit will be reset.
69-
* Add proper validation for query string parameters and request body on the server
70-
side.
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.
7167

7268
## References
7369

0 commit comments

Comments
 (0)