← Back to Writeups
PORTSWIGGERN/AAccess Control

User role can be modified in user profile

XESXOR9/2/20262 min read
#access control#portswigger#web-security-academy#access-control

User role can be modified in user profile

Platform: PortSwigger | Category: Access Control | Type: Lab | Difficulty: N/A | OS: N/A | Author: XESXOR | Date: 2026-08-24 | Status: Solved Techniques: Web Security Academy, Access Control

Summary

Walkthrough of the PortSwigger Web Security Academy lab User role can be modified in user profile (Access Control). This lab demonstrates a access control vulnerability and its exploitation to achieve the lab objectives.

Lab Overview

PortSwigger Web Security Academy — Access Control

This writeup is part of the XESXOR PortSwigger collection. The original lab description and solution have been preserved and reformatted for clarity.

Lab Description :

image

Solution :

So as per the lab description, we can view the admin panel only if our roleID=2.

GET request to /myaccount -

Once we click my account link, the browser sends a req as follows.

image

GET request o /login -

This request retreives the login page to enter the username and password.

image

Login page -

image

Enter the credentials which are given for testing which is wiener:peter& click LOGIN button, the captured request is as follows

image

Now we have logged in as wiener,

image

Till now we didn't see any suspicious cookie values being sent from our client

Lets move on & try to update our email.

image

Request :

image

Send the request to repeater (I tried sending all the previous requests to repeater, it didn't have the roleid cookie either in request or response)

Response :

image

Observe that we have a roleid=1 in the JSON response.

So add the value roleid=2 in the JSON request & see what is the response in browser

image

We have a 302 redirect

image

Click Follow redirect,

image

Now we can see the link to Admin Panel in the browser.

image

Now click on admin panel & delete the carlos user to solve the lab.

image

Key Takeaways / Lessons

  • Understanding Access Control detection and exploitation is crucial for web security.
  • Always validate and sanitize user input; implement proper access controls.
  • This lab is part of the PortSwigger Web Security Academy — practice in a safe, legal environment.

Crafted by XESXOR Research • 2026-08-24 • PortSwigger Web Security Academy • Lab: User role can be modified in user profile