Skip to content

Commit ef9d311

Browse files
committed
fix: moved query string scenario to lack of resources section
1 parent 139114b commit ef9d311

File tree

2 files changed

+21
-18
lines changed

2 files changed

+21
-18
lines changed

2019/en/src/0xa3-improper-data-filtering.md

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,6 @@ There are two types of Improper Data Filtering:
1818
based on filters from the client. An attacker can send malicious filters
1919
causing the API to return sensitive data they should not be exposed to.
2020

21-
One more issue is Improper Query String Parameters validation. It could lead to
22-
DDoS attacks against the server. Widely spread problem is validation of such
23-
query string parameters as `size`, `page`, .etc. Absence of limitation for max,
24-
min values of these parameters might cause performance issues, Internal Server
25-
Errors
26-
2721
## Example Attack Scenarios
2822

2923
### Scenario #1
@@ -44,24 +38,12 @@ accounts, exposing sensitive information such as the password reset token:
4438
`GET /api/v1/users.list?query={“roles”:{$in:“admin”}}&fields={“services.password.reset”:1, “username”:1”, “email.0”:1}`.
4539
Via password reset, the attacker can takeover one of the admin accounts.
4640

47-
### Scenario #3
48-
49-
We have a MEAN stack application that contains the users list on a UI. List of
50-
users can be retrieved from the server using a following query:
51-
`/dashboard/users?page=1&size=100`. There are limitation on maximum number of
52-
users per page (on UI side) - 200 users. An attacker changes the size parameter
53-
in order to retrieve large number of users, for example 200 000 or more and it
54-
causes performance issues. The same scenario might be used to provoke `Integer Overflow`
55-
or `Buffer Overflow` errors.
56-
5741
## How To Prevent
5842

5943
* Never rely on the client side to perform sensitive data filtering.
6044
* Review the responses from the API to make sure they contain only legitimate
6145
data.
6246
* Be careful when performing data filtering based on filters from the client.
63-
* Add proper validation for query string parameters and request body on the server
64-
side.
6547

6648
## References
6749

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

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,13 @@ following limits is missing or set inappropriately (i.e. too low/high)
2121
* Request payload size (e.g. uploads)
2222
* Number of requests per client/resource
2323

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.
29+
30+
2431
## Example Attack Scenarios
2532

2633
### Scenario #1
@@ -40,6 +47,18 @@ combinations using a multi-thread script, against the
4047
`/api/system/verification-codes/{smsToken}` endpoint to discover the right token
4148
within a few minutes.
4249

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

4564
* Docker makes it easy to limit [memory][1], [CPU][2], [number of restarts][3],
@@ -48,6 +67,8 @@ within a few minutes.
4867
timeframe.
4968
* Notify the client when the limit is exceeded by providing the limit number and
5069
the time at which the limit will be reset.
70+
* Add proper validation for query string parameters and request body on the server
71+
side.
5172

5273
## References
5374

0 commit comments

Comments
 (0)