API security tests
How to test for BOLA on an endpoint with weak enumerable user IDs?
In this blog you will learn how to test for Broken Object Level Authorization with weak enumerable user IDs.

Jaydev Ahire
Jan 31, 2023
6 min read
In this article, we will discuss an interesting test case where a weak user identifier can be used to perform a BOLA attack which could lead to data modification and sensitive data exposure. The attacker aims to compromise users' basket information.
General Severity: Medium to Critical
OWASP Category: API1:2019 Broken Object Level Authorization
For practical demonstration, we will use Owasp Juice Shop vulnerable application.
The web application has a feature where users can add their preferred juices to the basket. As an attacker, we will try to guess and retrieve information about other users by modifying IDs on the vulnerable REST API basket endpoint.
General Reproduction Steps:
1. Log in to the application and add any juice to the basket while capturing the request using Burp Suite (or any other proxy).

2. Observe the application was making a request to GET /rest/basket endpoint and send a request to a repeater for later use.

3. As you can see, the Apple juice we have added previously to our basked has a basket ID 1
4. Now, modify the basket ID number from 1 to 2.

5. Again modify the ID from 2 to 5.

Observe that by modifying the ID number in an incremental fashion, we successfully exploited the BOLA vulnerability that allowed us to retrieve other users’ basket information. This happened because the basket endpoint above had a broken authorization flaw.
Impact:
Object references frequently include database IDs, which can be accessed by attackers to expose sensitive user information. You can also learn more about what BOLA is here.
Remediations:
Developers implementing the API should implement a proper authorization mechanism. In the above case, the developer should check if the requested basket id is actually owned by the user and only then allow access.
Perform active testing of your endpoints for BOLA vulnerabilities using automated testing products such as Akto. Do not deploy vulnerable changes that break the tests.
Always use the UUID instead of simple sequential number IDs. UUIDs are Unique identifiers IDs, a mixture of letters and numbers that are impossible to guess.
In the next blog, we will learn how attackers can exploit BOLA by using other users’ unauthorized UUID.
In this article, we will discuss an interesting test case where a weak user identifier can be used to perform a BOLA attack which could lead to data modification and sensitive data exposure. The attacker aims to compromise users' basket information.
General Severity: Medium to Critical
OWASP Category: API1:2019 Broken Object Level Authorization
For practical demonstration, we will use Owasp Juice Shop vulnerable application.
The web application has a feature where users can add their preferred juices to the basket. As an attacker, we will try to guess and retrieve information about other users by modifying IDs on the vulnerable REST API basket endpoint.
General Reproduction Steps:
1. Log in to the application and add any juice to the basket while capturing the request using Burp Suite (or any other proxy).

2. Observe the application was making a request to GET /rest/basket endpoint and send a request to a repeater for later use.

3. As you can see, the Apple juice we have added previously to our basked has a basket ID 1
4. Now, modify the basket ID number from 1 to 2.

5. Again modify the ID from 2 to 5.

Observe that by modifying the ID number in an incremental fashion, we successfully exploited the BOLA vulnerability that allowed us to retrieve other users’ basket information. This happened because the basket endpoint above had a broken authorization flaw.
Impact:
Object references frequently include database IDs, which can be accessed by attackers to expose sensitive user information. You can also learn more about what BOLA is here.
Remediations:
Developers implementing the API should implement a proper authorization mechanism. In the above case, the developer should check if the requested basket id is actually owned by the user and only then allow access.
Perform active testing of your endpoints for BOLA vulnerabilities using automated testing products such as Akto. Do not deploy vulnerable changes that break the tests.
Always use the UUID instead of simple sequential number IDs. UUIDs are Unique identifiers IDs, a mixture of letters and numbers that are impossible to guess.
In the next blog, we will learn how attackers can exploit BOLA by using other users’ unauthorized UUID.
In this article, we will discuss an interesting test case where a weak user identifier can be used to perform a BOLA attack which could lead to data modification and sensitive data exposure. The attacker aims to compromise users' basket information.
General Severity: Medium to Critical
OWASP Category: API1:2019 Broken Object Level Authorization
For practical demonstration, we will use Owasp Juice Shop vulnerable application.
The web application has a feature where users can add their preferred juices to the basket. As an attacker, we will try to guess and retrieve information about other users by modifying IDs on the vulnerable REST API basket endpoint.
General Reproduction Steps:
1. Log in to the application and add any juice to the basket while capturing the request using Burp Suite (or any other proxy).

2. Observe the application was making a request to GET /rest/basket endpoint and send a request to a repeater for later use.

3. As you can see, the Apple juice we have added previously to our basked has a basket ID 1
4. Now, modify the basket ID number from 1 to 2.

5. Again modify the ID from 2 to 5.

Observe that by modifying the ID number in an incremental fashion, we successfully exploited the BOLA vulnerability that allowed us to retrieve other users’ basket information. This happened because the basket endpoint above had a broken authorization flaw.
Impact:
Object references frequently include database IDs, which can be accessed by attackers to expose sensitive user information. You can also learn more about what BOLA is here.
Remediations:
Developers implementing the API should implement a proper authorization mechanism. In the above case, the developer should check if the requested basket id is actually owned by the user and only then allow access.
Perform active testing of your endpoints for BOLA vulnerabilities using automated testing products such as Akto. Do not deploy vulnerable changes that break the tests.
Always use the UUID instead of simple sequential number IDs. UUIDs are Unique identifiers IDs, a mixture of letters and numbers that are impossible to guess.
In the next blog, we will learn how attackers can exploit BOLA by using other users’ unauthorized UUID.
Monthly product updates in your inbox. No spam.
Keep reading



Product updates
5 mins
Introducing Akto CLI : You can now run Akto tests in CLI
You can now run Akto tests directly from the Command-Line Interface (CLI). Akto tests in CLI brings the functionality of Akto into your development workflow.



Product updates
10 mins
Akto Vulnerabilities are now tagged with CWE
Developers and security teams crave a standardized frame of reference for vulnerabilities. CWE bridges the knowledge gap and provides much-needed context.



Product updates
1 min
Login using GitHub is now available to all On premise users
Login using GitHub is now available to all On premise users