Web Security Labs

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

Web Security Intermediate August 2026 Authorization Privilege Escalation GitHub
Overview: Access control vulnerabilities (also known as authorization flaws) occur when an application fails to properly enforce restrictions on what authenticated users are allowed to do. These labs demonstrate various privilege escalation techniques including:
  • 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

Lab Description:
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:

Lab 1 - robots.txt

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.

Lab 1 - Admin Panel
Lab 1 - Delete Success
Lab 1 Solved! Unprotected admin panel discovered via robots.txt.

Lab 2: Unprotected Admin Functionality with Unpredictable URL

Lab Description:
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:

Lab 2 - JavaScript Source
<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 2 - Admin Panel
Lab 2 - Delete Success
Lab 2 Solved! Admin URL discovered in client-side JavaScript.

Lab 3: User Role Controlled by Request Parameter

Lab Description:
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.

Lab 3 - Cookie

I set the Admin cookie to true, allowing me to access the admin panel and delete the target user.

Lab 3 - Step 1
Lab 3 - Step 2
Lab 3 - Step 3
Lab 3 - Step 4
Lab 3 Solved! Cookie manipulation to gain admin privileges.

Lab 4: User Role Can Be Modified in User Profile

Lab Description:
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.

Lab 4 - Email Update

I observed that the response contains roleid. I added roleid=2 to the request:

Lab 4 - Role Modification

The server accepted the request and returned roleid=2. I then accessed the admin panel and deleted the target user.

Lab 4 - Admin Access
Lab 4 - Delete Success
Lab 4 Solved! Role modification in user profile.

Lab 5: User ID Controlled by Request Parameter

Lab Description:
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 5 - IDOR Request
Lab 5 - API Key
Lab 5 Solved! IDOR via request parameter.

Lab 6: User ID Controlled by Request Parameter with Unpredictable User IDs

Lab Description:
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.

Lab 6 - Carlos Post

I clicked on the user carlos link and obtained the GUID associated with the target user.

Lab 6 - GUID
Lab 6 - API Key
Lab 6 - Success
Lab 6 Solved! IDOR with GUID discovery via posts.

Lab 7: User ID Controlled by Request Parameter with Data Leakage in Redirect

Lab Description:
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 7 - Data Leakage
Lab 7 Solved! API key leaked in redirect response body.

Lab 8: User ID Controlled by Request Parameter with Password Disclosure

Lab Description:
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.

Lab 8 - Password Display

I modified the id parameter from my user value to administrator, which retrieved the administrator's password.

Lab 8 - Admin Password
Lab 8 - Password

I then logged in as the administrator using the retrieved password:

Lab 8 - Admin Login
Lab 8 - Delete Success
Lab 8 Solved! Password disclosure via IDOR.

Lab 9: Insecure Direct Object References

Lab Description:
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.

Lab 9 - Live Chat

I intercepted the request and modified the filename parameter to 1.txt, which gave me access to unauthorized chat logs containing the password.

Lab 9 - Chat Logs
Lab 9 - Login
Lab 9 - Success
Vulnerability Analysis:
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 9 Solved! IDOR on chat log files.

Lab 10: URL-Based Access Control Can Be Circumvented

Lab Description:
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:

Lab 10 - Admin Option

Clicking on "Admin panel" resulted in an access denied response:

Lab 10 - Access Denied

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.

Lab 10 - X-Original-URL Test

I set X-Original-URL to /admin and gained access to the admin panel:

Lab 10 - Admin Panel
Lab 10 - Admin Response
Lab 10 - Admin Page

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:

Lab 10 - Delete Attempt
Lab 10 - Delete Success
Lab 10 - Confirmation
Lab 10 - Final
Attack Flow:
Browser โ†’ GET / + X-Original-URL:/admin โ†’ Front-end allows "/" โ†’ Back-end executes "/admin" โ†’ Response โ†’ Admin panel โ†’ Delete target user
Lab 10 Solved! X-Original-URL header bypass.

Lab 11: Method-Based Access Control Can Be Circumvented

Lab Description:
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.

Lab 11 - Admin Panel
Lab 11 - Upgrade Option

I intercepted the upgrade request:

Lab 11 - Upgrade Request

I logged out and logged in as wiener. Attempting to send the same POST request returned Unauthorized.

Lab 11 - Unauthorized

I changed the HTTP method from POST to GET and sent the request:

Lab 11 - GET Request
Lab 11 - Success
Lab 11 - Admin Panel
Lab 11 Solved! Method-based access control bypass.

Lab 12: Multi-Step Process with No Access Control on One Step

Lab Description:
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:

Lab 12 - Step 1
Lab 12 - Step 2
Lab 12 - Step 3
Lab 12 - Step 4

I logged out, logged in as wiener, and sent the confirmation request with my session cookie, modifying the username parameter to wiener.

Lab 12 - Confirmation Request
Lab 12 - Success
Lab 12 Solved! Multi-step access control flaw.

Lab 13: Referer-Based Access Control

Lab Description:
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.

Lab 13 - Referer Header

I logged out, logged in as wiener, and sent the request with a forged Referer header.

Lab 13 - Forged Referer
Lab 13 - Success
Lab 13 Solved! Referer header bypass.

Insights & Security Mitigations

Never rely on client-side checks for authorization
Best Practices:
  • 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
Conclusion:
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.
Disclaimer:
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.