My target for this walkthrough is vAPI (Vulnerable Adversely Programmed Interface). vAPI is a self-hostable, deliberately vulnerable API designed to mimic real-world security flaws seen in modern applications. It serves as an excellent training ground for understanding the OWASP API Security Top 10 by simulating common vulnerabilities like Authorization Bypass, Excessive Data Exposure, and Rate Limiting failures.
In this first part, I will walk you through how I compromised Endpoints 1 through 5. I will demonstrate how I discovered the first 5 flags by exploiting critical flaws ranging from simple ID manipulation (BOLA) to brute-forcing OTPs and reverse-engineering mobile application code.
Before commencing the vulnerability assessment, a local instance of the vAPI target application was deployed to establish a controlled, isolated testing environment.
The target application was deployed on a Kali Linux virtual machine using Docker to ensure reproducibility and isolation from the host system.
Deployment Steps:
mkdir lab
cd lab
git clone https://github.com/roottusk/vapi.git
cd vapi
sudo docker compose up -d
sudo docker ps
Since vAPI is a headless API (no frontend for most functions), Postman was configured as the primary client for interacting with the endpoints.
Collection Import: The vAPI.postman_collection.json and vAPI_ENV.postman_environment.json files in the repository's postman/ directory were imported into the Postman workspace.
Broken Object Level Authorization (BOLA), also known as IDOR (Insecure Direct Object Reference), occurs when an application provides direct access to objects based on user-supplied input (like an ID in the URL) without validating that the authenticated user actually owns or has permission to access that specific object.
In vAPI, the user profile endpoints rely solely on the numerical ID parameter to retrieve or modify data, without verifying that the Authorization-Token corresponds to the requested user ID.
I started by creating a legitimate user account ("mel") to obtain a valid authentication token.
To test the severity of the flaw, I attempted to modify another user's data. I sent a PUT request to User ID 1 with a new payload.
The API leaked the details of the administrative user (ID 1), containing the flag:
"course": "flag{api1_d0cd9be2324cc237235b}".
Security Implications
Recommended Remediation
Broken Authentication vulnerabilities allow attackers to compromise passwords, keys, or session tokens, effectively taking over user accounts. In this instance, the application failed to implement rate limiting or credential-stuffing protections on the login endpoint. This allowed me to automate thousands of login attempts using a list of breached credentials (creds.csv) to identify valid accounts.
Testing Methodology & Reproduction Steps
During the information-gathering phase, I located a resource file named creds.csv containing a list of potential email and password pairs. To prepare for a Pitchfork attack (testing specific pairs like Email_A + Password_A), I split this file into two separate word lists:
I used the ffuf tool in pitchfork mode to iterate through the lists, sending a POST request for every pair. I filtered 200 OK responses, which indicate a successful login.
The attack identified valid credentials, and I used them to manually log in to confirm access.
"address": "flag{api2_6bf2beda61e2a1ab2d0a}".
Excessive Data Exposure occurs when an API endpoint returns a full data object (including sensitive fields like PII, passwords, or internal flags) to the client, relying on the client-side application (frontend or mobile app) to filter out what the user should not see. If an attacker bypasses the client and queries the API directly, they can view the entire data set.
In this scenario, the vulnerability was hidden within a mobile API endpoint used by the Android application provided in the resources.
Testing Methodology (Static Analysis)
Instead of setting up a resource-intensive Android Emulator (such as Android Studio) to dynamically intercept traffic, I opted for Static Application Security Testing (SAST). This approach allowed me to analyze the application's source code directly to discover hidden endpoints without running the app.
Tools Used:
The API responded with a 200 OK status. The JSON body contained a list of user comments. Crucially, specifically for the user baduser007, the API returned excessive metadata that should not be public.
Leaked Data:
Security Implications
Recommended Remediation
"Lack of Resources & Rate Limiting" occurs when an API fails to restrict the number of requests a client can make within a specific timeframe. This vulnerability is particularly critical in authentication flows, such as One-Time Password (OTP) verification.
In this instance, the vAPI application generated a 4-digit OTP for user login but failed to implement any rate limiting or "max retry" logic on the verification endpoint. This allowed me to iterate through all possible 10,000 combinations (0000-9999) to brute-force the valid code and bypass the authentication mechanism.
Testing Methodology & Reproduction Step
I validated the brute-forced OTP by manually sending it to the endpoint via Burp Suite. The API returned success: true and an authentication key.
Using this key to query the user profile revealed the flag.
"lastname": "flag{api4_ce696239323ea5b2d015}".
Security Implications
Recommended Remediation
Broken Function-Level Authorization (BFLA) occurs when an application fails to properly validate a user's privileges before granting access to administrative or sensitive functions. The server validates who the user is (Authentication) but fails to check if they are allowed to perform the requested action (Authorization).
In this instance, the vAPI application allowed a standard, low-privilege user to access the administrative endpoint /users (which lists the entire database) by simply knowing the URL structure.
Testing Methodology & Reproduction Steps
I verified my access by querying my own profile at /vapi/api5/user/3.
I then attempted to access the administrative function by changing the URL from /user/{id} to /users.
The API returned a 200 OK status code, despite the token belonging to a standard user. The response body contained the full list of registered users, including the Administrator.
Leaked Data:
"address": "flag{api5_76dd990a97ff1563ae76}".
Security Implications
Recommended Remediation
That’s it for Part 1 of this walkthrough. We have successfully compromised the first five endpoints, demonstrating how easily standard API features can turn into critical security liabilities.
Stay tuned for Part 2, where we will complete the hacking of Endpoints 6 through 10 and tackle the remaining vulnerabilities in the OWASP API Top 10.
See you in the next one!