Access Control Vulnerabilities
A comprehensive walkthrough of 13 privilege escalation labs covering IDOR, horizontal/vertical privilege escalation, insecure direct object references, and access control bypass techniques
- Horizontal Privilege Escalation โ Accessing another user's data
- Vertical Privilege Escalation โ Gaining administrative privileges
- IDOR (Insecure Direct Object References) โ Accessing unauthorized resources
- Access Control Bypass โ Circumventing authorization checks
Lab 1: Unprotected Admin Functionality
This lab has an unprotected admin panel.
Goal: Delete the user
carlos.
How was the lab compromised?
The first move that I did was discover the robots.txt file:
I noticed that robots.txt contains the disallowed path /administrator-panel.
By navigating to this path, it provided me direct access to the admin interface without authentication,
where I deleted the target user and solved the lab.
robots.txt.
Lab 2: Unprotected Admin Functionality with Unpredictable URL
This lab has an unprotected admin panel at an unpredictable location.
Goal: Delete the user
carlos.
How was the lab compromised?
I first checked the /robots.txt file, but it returned a 404 Not Found
response. I then analyzed the page source and discovered a client-side JavaScript snippet:
<script>
var isAdmin = false;
if (isAdmin) {
var topLinksTag = document.getElementsByClassName("top-links")[0];
var adminPanelTag = document.createElement('a');
adminPanelTag.setAttribute('href', '/admin-76g9xu');
adminPanelTag.innerText = 'Admin panel';
topLinksTag.append(adminPanelTag);
}
</script>
The script revealed the admin panel URL: /admin-76g9xu. Even though the
isAdmin variable was set to false, the link to the admin panel was hardcoded,
allowing me to directly access the endpoint.
Lab 3: User Role Controlled by Request Parameter
This lab uses a forgeable cookie to identify administrators.
Goal: Delete the user
carlos.Credentials:
wiener:peter
How was the lab compromised?
I logged into my account and intercepted the login request. The server's response set a cookie
named Admin with the value false.
I set the Admin cookie to true, allowing me to access the admin panel
and delete the target user.
Lab 4: User Role Can Be Modified in User Profile
Admin panel accessible only to users with a
roleid of 2.Goal: Delete the user
carlos.Credentials:
wiener:peter
How was the lab compromised?
The vulnerability occurs in the email update functionality. When updating the email, I intercepted the request.
I observed that the response contains roleid. I added roleid=2 to
the request:
The server accepted the request and returned roleid=2. I then accessed the admin panel
and deleted the target user.
Lab 5: User ID Controlled by Request Parameter
Horizontal privilege escalation on the user account page.
Goal: Obtain the API key for
carlos.Credentials:
wiener:peter
How was the lab compromised?
I intercepted the request to the account page and noticed the id parameter. I modified
it to carlos, which allowed me to directly access the target user's account.
Lab 6: User ID Controlled by Request Parameter with Unpredictable User IDs
Horizontal privilege escalation using GUIDs.
Goal: Find the GUID for
carlos and submit his API key.Credentials:
wiener:peter
How was the lab compromised?
I navigated through the application and found a post shared by the target user carlos.
I clicked on the user carlos link and obtained the GUID associated with the target user.
Lab 7: User ID Controlled by Request Parameter with Data Leakage in Redirect
Sensitive information leaked in the body of a redirect response.
Goal: Obtain the API key for
carlos.Credentials:
wiener:peter
How was the lab compromised?
I attempted to access the target user directly by modifying the id parameter to
carlos. The application blocked access and redirected me to the login page.
Despite the redirect, I intercepted the request and found the response contained the API key of the target user.
Lab 8: User ID Controlled by Request Parameter with Password Disclosure
User account page contains the current user's existing password in a masked input.
Goal: Retrieve the administrator's password and delete
carlos.Credentials:
wiener:peter
How was the lab compromised?
After logging in, I observed that the application displayed the user's password value in the user panel.
I modified the id parameter from my user value to administrator, which
retrieved the administrator's password.
I then logged in as the administrator using the retrieved password:
Lab 9: Insecure Direct Object References
User chat logs stored directly on the file system, retrieved using static URLs.
Goal: Find the password for
carlos and log into their account.
How was the lab compromised?
I tested the live chat functionality and clicked on "View Transcript". The application exported
a file named 2.txt.
I intercepted the request and modified the filename parameter to 1.txt,
which gave me access to unauthorized chat logs containing the password.
The application stores chat logs directly on the server as text files and makes them accessible via static URLs (
1.txt, 2.txt, etc.). The application does not verify
whether a user is authorized to access these files, allowing an attacker to modify the filename
and access other users' chat logs.
Lab 10: URL-Based Access Control Can Be Circumvented
Front-end system blocks external access to
/admin, but the back-end supports
the X-Original-URL header.Goal: Delete the user
carlos.
How was the lab compromised?
I opened the page and observed a navigation bar that included an admin panel option:
Clicking on "Admin panel" resulted in an access denied response:
I intercepted the request and tested the X-Original-URL header by setting it to
/invalid, which returned a 404 Not Found response, confirming that
the back-end processes the header.
I set X-Original-URL to /admin and gained access to the admin panel:
I found the delete endpoint: /admin/delete?username=carlos. I set
X-Original-URL to /admin/delete and added username=carlos
as a query parameter:
Browser โ GET / + X-Original-URL:/admin โ Front-end
allows "/" โ Back-end executes "/admin" โ Response โ Admin panel โ Delete target user
Lab 11: Method-Based Access Control Can Be Circumvented
Access controls based partly on the HTTP method of requests.
Goal: Promote
wiener to administrator.Credentials:
administrator:admin and wiener:peter
How was the lab compromised?
I first logged in as the administrator to understand how the privilege upgrade request works.
I intercepted the upgrade request:
I logged out and logged in as wiener. Attempting to send the same POST
request returned Unauthorized.
I changed the HTTP method from POST to GET and sent the request:
Lab 12: Multi-Step Process with No Access Control on One Step
Multi-step process for changing a user's role with flawed access control.
Goal: Promote
wiener to administrator.Credentials:
administrator:admin and wiener:peter
How was the lab compromised?
I logged in as the administrator and observed that the privilege escalation is performed in two steps:
I logged out, logged in as wiener, and sent the confirmation request with my session
cookie, modifying the username parameter to wiener.
Lab 13: Referer-Based Access Control
Access control based on the
Referer header.Goal: Promote
wiener to administrator.Credentials:
administrator:admin and wiener:peter
How was the lab compromised?
I logged in as the administrator and intercepted the upgrade request, which included a
Referer header pointing to /admin.
I logged out, logged in as wiener, and sent the request with a forged
Referer header.
Insights & Security Mitigations
- Always enforce role validation on the server side
- Do not trust user-controlled parameters:
id,role,username, etc. - Protect administrative endpoints with proper authentication and authorization controls
- Avoid exposing sensitive data in redirects or HTTP responses
- Validate HTTP methods and security-related headers appropriately
- Implement object-level authorization checks to prevent IDOR/BOLA vulnerabilities
- Enforce server-side access control checks for every request
- Implement role-based access control (RBAC) correctly
- Validate resource ownership before returning sensitive data
- Avoid predictable identifiers; use random or non-sequential IDs where possible
- Do not expose administrative endpoints in client-side code
- Restrict direct access to sensitive URLs
- Log and monitor privilege escalation attempts
These labs demonstrate how Broken Access Control vulnerabilities can arise from improper authorization checks, client-side trust, and insecure handling of user-controlled input. By manipulating parameters, modifying cookies, bypassing front-end restrictions, and exploiting flawed access control logic, it was possible to escalate privileges, access sensitive data, and perform administrative actions without proper authorization.
All activities in this writeup were conducted within a fully authorized, isolated laboratory environment.
These techniques are presented solely for educational and defensive security purposes.