Skip to content

Commit 992d65a

Browse files
committed
Merge branch 'release/0.1.2'
2 parents 8aaaa80 + 382d4bd commit 992d65a

12 files changed

+30
-7
lines changed
1.42 KB
Binary file not shown.
1.68 KB
Binary file not shown.

2019/en/src/0xa3-excessive-data-exposure.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,12 @@ the site.
4242
* Never rely on the client side to perform sensitive data filtering.
4343
* Review the responses from the API to make sure they contain only legitimate
4444
data.
45+
* Explicitly define and enforce data returned by all API methods, including
46+
errors. Whenever possible: use schemas for responses, patterns for all strings
47+
and clear field names.
48+
* Define all sensitive and personally identifiable information (PII) that your
49+
application stores and works with and review all API calls returning such
50+
information to see if these responses can be a security issue.
4551

4652
## References
4753

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

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,11 +49,19 @@ errors.
4949
[file descriptors, and processes][4].
5050
* Implement a limit on how often a client can call the API within a defined
5151
timeframe.
52+
* For sensitive operations such as login or password reset, consider rate limits
53+
by API method (e.g., authentication), client (e.g., IP address), property
54+
(e.g., username).
5255
* Notify the client when the limit is exceeded by providing the limit number and
5356
the time at which the limit will be reset.
5457
* Add proper server-side validation for query string and request body
5558
parameters, specifically the one that controls the number of records to be
5659
returned in the response.
60+
* Define and enforce maximum size of data on all incoming parameters and
61+
payloads such as maximum length for strings and maximum number of elements in
62+
arrays.
63+
* If your API accepts compressed files check compression ratios before expanding
64+
the files to protect yourself against "zip bombs".
5765

5866
## References
5967

2019/en/src/0xa5-broken-function-level-authorization.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ A5:2019 Broken Function Level Authorization
44
| Threat agents/Attack vectors | Security Weakness | Impacts |
55
| - | - | - |
66
| API Specific : Exploitability **3** | Prevalence **2** : Detectability **1** | Technical **2** : Business Specific |
7-
| Exploitation requires the attacker to send legitimate API calls to the API endpoint that they should not have access to. These endpoints might be exposed to anonymous users or regular, non-privileged users. It’s easier to discover these flaws in APIs since APIs are more structured, and the way to access certain functions is more predictable (e.g., replacing the HTTP method from GET to PUT, or changing the “users” string in the URL to "admins"). | Authorization checks for a function or resource are usually managed via configuration, and sometimes at the code level. Implementing proper checks can be a confusing task, since modern applications can contain many types of roles or groups and complex user hierarchy (e.g., sub-users, users with more than one role). | Such flaws allow attackers to access unauthorized functionality. Administrative functions are key targets for this type of attack. |
7+
| Exploitation requires the attacker to send legitimate API calls to the API endpoint that they should not have access to. These endpoints might be exposed to anonymous users or regular, non-privileged users. It’s easier to discover these flaws in APIs since APIs are more structured, and the way to access certain functions is more predictable (e.g., replacing the HTTP method from GET to PUT, or changing the “users” string in the URL to "admins", or changing the value of a parameter like "is_admin" from "false" to "true"). | Authorization checks for a function or resource are usually managed via configuration, and sometimes at the code level. Implementing proper checks can be a confusing task, since modern applications can contain many types of roles or groups and complex user hierarchy (e.g., sub-users, users with more than one role). | Such flaws allow attackers to access unauthorized functionality. Administrative functions are key targets for this type of attack. |
88

99
## Is the API Vulnerable?
1010

2019/en/src/0xa6-mass-assignment.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,8 @@ shell command injection once the attacker downloads the video as MP4.
7575
* Whitelist only the properties that should be updated by the client.
7676
* Use built-in features to blacklist properties that should not be accessed by
7777
clients.
78+
* If applicable, explicitly define and enforce schemas for the input data
79+
payloads.
7880

7981
## References
8082

2019/en/src/0xa7-security-misconfiguration.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ A7:2019 Security Misconfiguration
44
| Threat agents/Attack vectors | Security Weakness | Impacts |
55
| - | - | - |
66
| API Specific : Exploitability **3** | Prevalence **3** : Detectability **3** | Technical **2** : Business Specific |
7-
| Attackers will often attempt to find unpatched flaws, common endpoints, or unprotected files and directories to gain unauthorized access or knowledge of the system. | Security misconfiguration can happen at any level of the API stack, from the network level to the application level. Automated tools are available to detect and exploit misconfigurations such as unnecessary services or legacy options. | Security misconfigurations can no only expose sensitive user data, but also system details that may lead to full server compromise. |
7+
| Attackers will often attempt to find unpatched flaws, common endpoints, or unprotected files and directories to gain unauthorized access or knowledge of the system. | Security misconfiguration can happen at any level of the API stack, from the network level to the application level. Automated tools are available to detect and exploit misconfigurations such as unnecessary services or legacy options. | Security misconfigurations can not only expose sensitive user data, but also system details that may lead to full server compromise. |
88

99
## Is the API Vulnerable?
1010

@@ -65,6 +65,9 @@ The API life cycle should include:
6565
assets (e.g., images).
6666
* An automated process to continuously assess the effectiveness of the
6767
configuration and settings in all environments.
68+
* To prevent exception traces and other valuable information from being sent
69+
back to attackers, if applicable, define and enforce all API response payload
70+
schemas including error responses.
6871

6972
## References
7073

2019/en/src/0xa8-injection.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ The attacker replays the request with a different payload
3333

3434
```
3535
POST /api/account/recovery
36-
{"email": "[email protected]';WAITFOR DELAY '0:0:5'--"}
36+
{"username": "[email protected]';WAITFOR DELAY '0:0:5'--"}
3737
```
3838

3939
This time, the response took ~5 seconds confirming the API is vulnerable to SQL
@@ -103,6 +103,8 @@ Preventing injection requires keeping data separate from commands and queries.
103103
of injection.
104104
* Validate incoming data using sufficient filters to only allow valid values for
105105
each input parameter.
106+
* To prevent data leaks, define and enforce schemas for all API responses.
107+
* Define data types and strict patterns for all string parameters.
106108

107109
## References
108110

@@ -117,12 +119,10 @@ Preventing injection requires keeping data separate from commands and queries.
117119

118120
* [CWE-77: Command Injection][5]
119121
* [CWE-89: SQL Injection][6]
120-
* [HOW TO: Command Injection, HackerOne][7]
121122

122123
[1]: https://www.owasp.org/index.php/Injection_Flaws
123124
[2]: https://www.owasp.org/index.php/SQL_Injection
124125
[3]: https://www.owasp.org/images/e/ed/GOD16-NOSQL.pdf
125126
[4]: https://www.owasp.org/index.php/Command_Injection
126127
[5]: https://cwe.mitre.org/data/definitions/77.html
127128
[6]: https://cwe.mitre.org/data/definitions/89.html
128-
[7]: https://www.hackerone.com/blog/how-to-command-injections

2019/en/src/0xa9-improper-assets-management.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,9 @@ user by using a simple brute-force to guess the 6 digits token.
6161
* Generate documentation automatically by adopting open standards. Include the
6262
documentation build in your CI/CD pipeline.
6363
* Make API documentation available to those authorized to use the API.
64+
* Use external protection measures such as API security firewalls for all exposed versions of your APIs, not just for the current production version.
65+
* Avoid using production data with non-production API deployments. If this is unavoidable, these endpoints should get the same security treatment as the production ones.
66+
* When newer versions of APIs include security improvements, perform risk analysis to make the decision of the mitigation actions required for the older version: for example, whether it is possible to backport the improvements without breaking API compatibility or you need to take the older version out quickly and force all clients to move to the latest version.
6467

6568
## References
6669

2019/en/src/0xd1-acknowledgments.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ or via other means:
1111
* caseysoftware
1212
* Chris Westphal
1313
* dsopas
14+
* DSotnikov
1415
* emilva
1516
* ErezYalon
1617
* flascelles

0 commit comments

Comments
 (0)