Skip to content

Commit 593d284

Browse files
authored
Publish Latest 2025-03-29 (#445)
Updates based on OWASP/wstg@c1414ba
1 parent 8e360a8 commit 593d284

File tree

6 files changed

+106
-0
lines changed

6 files changed

+106
-0
lines changed

_data/latest.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -472,6 +472,9 @@ docs:
472472
- title: '4.12.1 API Reconnaissance'
473473
url: 4-Web_Application_Security_Testing/12-API_Testing/01-API_Reconnaissance
474474

475+
- title: '4.12.2 API Broken Object Level Authorization'
476+
url: 4-Web_Application_Security_Testing/12-API_Testing/02-API_Broken_Object_Level_Authorization
477+
475478
- title: '4.12.99 Testing GraphQL'
476479
url: 4-Web_Application_Security_Testing/12-API_Testing/99-Testing_GraphQL
477480

Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
---
2+
3+
layout: col-document
4+
title: WSTG - Latest
5+
tags: WSTG
6+
7+
---
8+
9+
{% include breadcrumb.html %}
10+
# API Broken Object Level Authorization
11+
12+
|ID |
13+
|------------|
14+
|WSTG-APIT-02|
15+
16+
## Summary
17+
18+
Broken Object Level Authorization (BOLA) occurs when an API does not properly enforce authorization checks for each object accessed by the client. Attackers can manipulate object identifiers in API requests (such as IDs, GUIDs, or tokens) to access or modify resources they are not authorized to. This vulnerability is critical in APIs due to their direct access to underlying objects and the prevalence of APIs in modern applications.
19+
20+
Exploiting BOLA can lead to unauthorized access to sensitive data, user impersonation, horizontal privilege escalation (accessing other users' resources), and vertical privilege escalation (gaining unauthorized admin-level access).
21+
22+
## Test Objectives
23+
24+
- The objective of this test is to identify whether the API enforces proper **object-level authorization** checks, ensuring that users can only access and manipulate objects they are authorized to interact with.
25+
26+
## How to Test
27+
28+
### Understand API Endpoints and Object References
29+
30+
Review API documentation (e.g. OpenAPI specification), traffic, or use an interception proxy (e.g., **Burp Suite**, **ZAP**) to identify endpoints that accept object identifiers of interest. These could be in the form of **IDs**, **UUIDs**, or other references.
31+
32+
Examples:
33+
34+
- `GET /api/users/{user_id}`
35+
- `GET /api/orders/{order_id}`
36+
- `POST /graphql`\
37+
`query: {user(id: "123") }`
38+
39+
With the knowledge gained in the previous step, review and collect third-party object identifiers (e.g. user IDs, orders IDs etc) that can be used subsequently in the object identifiers manipulation.
40+
41+
Additionaly, generate a list of potential object identifiers for brute-force. For example, if an API is retrieving a purchase order from an authenticated user, generate various purchase order IDs for testing.
42+
43+
### Manipulate Object Identifiers in API Requests
44+
45+
With the goal to determine if users can access or modify objects they do not own by altering object identifiers in API request, change the object identifier (e.g., user ID, order ID) in the URL or request body.
46+
47+
Example: Modify a request like `GET /api/users/123/profile` (where 123 is the current user ID) to `GET /api/users/124/profile` (where 124 is another user's ID).
48+
49+
Depending on the application context, utilize two different accounts to perform the tests. With an account A, create resources that exclusively belongs to that account (e.g. purchase order) and with an account B, try to access the resource from account A (e.g. purchase order).
50+
51+
### Test Object-Level Access with Different HTTP Methods
52+
53+
Test various **HTTP methods** for BOLA vulnerabilities:
54+
55+
- **GET**: Try accessing unauthorized objects by manipulating the object ID in the request.
56+
- **POST/PUT/PATCH**: Attempt to create or modify objects that belong to other users.
57+
- **DELETE**: Try to delete an object owned by another user.
58+
59+
### Test BOLA in GraphQL APIs
60+
61+
For **GraphQL APIs**, send a query with a modified object ID in the query parameters (see [Testing GraphQL](https://owasp.org/www-project-web-security-testing-guide/stable/4-Web_Application_Security_Testing/12-API_Testing/01-Testing_GraphQL)):
62+
63+
Example: `query { user(id: "124") { name, email } }`.
64+
65+
### Test for Bulk Object Access
66+
67+
Test if the API allows unauthorized **bulk access** to objects. This could happen in endpoints that return lists of objects.
68+
69+
Example: `GET /api/users` returns data for all users instead of only the authenticated user’s data.
70+
71+
## Indicators of BOLA
72+
73+
- **Successful exploitation**: If modifying an object ID in the request returns data or allows actions on objects that belong to other users, the API is vulnerable to BOLA.
74+
- **Error responses**: Properly secured APIs in general would return `403 Forbidden` or `401 Unauthorized` for unauthorized object access. A `200 OK` response for another user's object indicates BOLA.
75+
- **Inconsistent responses**: If some endpoints enforce authorization and others do not, it points to incomplete or inconsistent security controls.
76+
77+
## Remediation
78+
79+
- **Object Ownership Checks**: Ensure that object-level authorization checks are performed for every API request. Always verify that the user making the request is authorized to access the requested object.
80+
- **Role-Based Access Control (RBAC)**: Implement RBAC policies that define which roles can access or modify specific objects.
81+
- **Least Privilege Principle**: Apply the principle of least privilege to ensure that users can only access the minimum set of objects they need for their role.
82+
- **Use UUIDs or Non-Sequential IDs**: Prefer non-predictable, non-sequential object identifiers (e.g., **UUIDs** instead of simple integers) to make enumeration and brute-force attacks harder.
83+
84+
## Tools
85+
86+
- **ZAP**: Automated scanners or manual proxy tools can help test object references in API requests.
87+
- **Burp Suite**: Use the **Repeater** or **Intruder** tools to manipulate object IDs and send multiple requests to test access control.
88+
- **Postman**: Send requests with altered object IDs and observe the responses.
89+
- **Fuzzing Tools**: Use fuzzers to brute-force object IDs and check for unauthorized access.
90+
91+
## References
92+
93+
- [OWASP API Security Top 10: BOLA](https://owasp.org/API-Security/editions/2023/en/0xa1-broken-object-level-authorization/)
94+
- [OWASP Testing Guide: Testing for Insecure Direct Object References (IDOR)](https://owasp.org/www-project-web-security-testing-guide/stable/4-Web_Application_Security_Testing/05-Authorization_Testing/04-Testing_for_Insecure_Direct_Object_References)
95+
- [OWASP Testing Guide: Testing for GraphQL](https://owasp.org/www-project-web-security-testing-guide/stable/4-Web_Application_Security_Testing/12-API_Testing/01-Testing_GraphQL)

latest/4-Web_Application_Security_Testing/12-API_Testing/README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,6 @@ tags: WSTG
1313

1414
4.12.1 [API Reconnaissance](01-API_Reconnaissance.md)
1515

16+
4.12.2 [API Broken Object Level Authorization](02-API_Broken_Object_Level_Authorization.md)
17+
1618
4.12.99 [Testing GraphQL](99-Testing_GraphQL.md)

latest/4-Web_Application_Security_Testing/12-API_Testing/index.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,6 @@ tags: WSTG
1313

1414
4.12.1 [API Reconnaissance](01-API_Reconnaissance.md)
1515

16+
4.12.2 [API Broken Object Level Authorization](02-API_Broken_Object_Level_Authorization.md)
17+
1618
4.12.99 [Testing GraphQL](99-Testing_GraphQL.md)

latest/README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -323,6 +323,8 @@ tags: WSTG
323323

324324
#### 4.12.1 [API Reconnaissance](4-Web_Application_Security_Testing/12-API_Testing/01-API_Reconnaissance.md)
325325

326+
#### 4.12.2 [API Broken Object Level Authorization](4-Web_Application_Security_Testing/12-API_Testing/02-API_Broken_Object_Level_Authorization.md)
327+
326328
#### 4.12.99 [Testing GraphQL](4-Web_Application_Security_Testing/12-API_Testing/99-Testing_GraphQL.md)
327329

328330
## 5. [Reporting](5-Reporting/README.md)

latest/index.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -323,6 +323,8 @@ tags: WSTG
323323

324324
#### 4.12.1 [API Reconnaissance](4-Web_Application_Security_Testing/12-API_Testing/01-API_Reconnaissance.md)
325325

326+
#### 4.12.2 [API Broken Object Level Authorization](4-Web_Application_Security_Testing/12-API_Testing/02-API_Broken_Object_Level_Authorization.md)
327+
326328
#### 4.12.99 [Testing GraphQL](4-Web_Application_Security_Testing/12-API_Testing/99-Testing_GraphQL.md)
327329

328330
## 5. [Reporting](5-Reporting/README.md)

0 commit comments

Comments
 (0)