You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
| API Specific : Exploitability **3**| Prevalence **3** : Detectability **2**| Technical **2** : Business Specific |
7
-
| Old API versions are usually unpatched and are an easy way to compromise systems without having to fight state of the art security mechanisms that might be in place to protect the most recent API versions. | Outdated documentation makes it more difficult to find and/or fix vulnerabilities. Lack of assets inventory and retire strategies leads to running unpatched systems and leakage of sensitive data. | Attackers may gain access to sensitive data or even takeover the server through old, unpatched API versions connected to the same database. |
7
+
| Old API versions are usually unpatched and are an easy way to compromise systems without having to fight state of the art security mechanisms that might be in place to protect the most recent API versions. | Outdated documentation makes it more difficult to find and/or fix vulnerabilities. Lack of assets inventory and retire strategies leads to running unpatched systems and leakage of sensitive data. It’s common to find unnecessarily exposed API hosts because of modern concepts like microservices, which make applications easy to deploy and independent (e.g. cloud computing, k8s) | Attackers may gain access to sensitive data or even takeover the server through old, unpatched API versions connected to the same database. |
8
8
9
9
## Is the API Vulnerable?
10
10
11
-
The API is vulnerable if:
11
+
An API is vulnerable if:
12
12
13
+
* The purpose of an API host is unclear, and there are no explicit answers to
14
+
the following questions:
15
+
* Which environment is the API running in (e.g. production, staging, test,
16
+
development)?
17
+
* Who should have network access to the API (e.g. public, internal, partners)?
18
+
* Which API version is running?
13
19
* There is no documentation or the existing documentation is not updated.
14
20
* There is no retirement plan for each API version.
15
21
* Hosts inventory is missing or outdated.
@@ -22,19 +28,33 @@ The API is vulnerable if:
22
28
After redesigning their applications, a local search service left an old API
23
29
version (`api.someservice.com/v1`) running, unprotected and with access to the
24
30
user database. While targeting one of the latest released applications an
25
-
attacker got the API address (`api.someservice.com/v2`). Replacing `v2` with
26
-
`v1` in the URL gave the attacker access to the old and unprotected API,
31
+
attacker found the API address (`api.someservice.com/v2`). Replacing `v2` with
32
+
`v1` in the URL gave the attacker access to the old, unprotected API,
27
33
exposing the personal identifiable information (PII) of over 100 Million user.
28
34
35
+
### Scenario #2
36
+
37
+
A social network implemented a rate-limiting mechanism that blocks attackers
38
+
from using brute-force to guess reset password tokens. This mechanism wasn’t
39
+
implemented as part of the API code itself, but in a separate component between
40
+
the client and the and the official API (`www.socialnetwork.com`).
41
+
A researcher found a beta API host (`www.mbasic.beta.socialnetwork.com`) that
42
+
runs the same API, including the reset password mechanism, but the rate limiting
43
+
mechanism was not in place. The researcher was able to reset the password of any
44
+
user by using a simple brute-force to guess the 6 digits token.
45
+
29
46
## How To Prevent
30
47
48
+
* Inventory all API hosts and document important aspects of each one of them,
49
+
focusing on the API environment (e.g. production, staging, test, development),
50
+
who should have network access to the host (e.g. public, internal, partners)
51
+
and the API version.
31
52
* Document all aspects of your API such as authentication, errors, redirects,
32
53
rate limiting, cross-origin resource sharing (CORS) policy and endpoints,
33
54
including their parameters, requests and responses.
34
-
* Include documentation of your code review practice.
35
55
* Generate documentation automatically by adopting open standards. Include the
36
56
documentation build in your CI/CD pipeline.
37
-
* Make API documentation generally available.
57
+
* Make API documentation available to those authorized to use the API.
0 commit comments