Bypassed Access Control Using a Simple Method-Based Request Trick — Access Control Labs
The lab's access control relied on the HTTP method, so a normal user could escalate their own privileges by sending the same administrative action as a GET request instead of a POST. An attacker could therefore grant themselves admin rights.
Published on bashoverflow.com
This article explores a vulnerability scenario provided by PortSwigger Labs that demonstrates how method-based access control can be bypassed. The lab is set in a controlled environment where participants can understand and exploit flawed access controls in a practical manner.
The full write-up lives on its author's site
It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
How it worked
Root cause
Likely the server enforced admin-only actions only for POST requests and did not check the user's role for the equivalent GET request.
Impact
An attacker could escalate their privileges to administrator and then access sensitive information or modify and delete critical data.
What the attacker needed
A normal user account; ability to intercept and modify requests
The fix
Access control should not rely solely on HTTP methods; server-side validation of user roles and permissions should be applied to every request.
How it was found
- Log in as the administrator and change Carlos's access rights to admin.
- In Burp Suite, find the request that changes access rights and send it to Repeater.
- Log in as wiener in a private window and locate wiener's session cookie.
- In Repeater, replace the session cookie with wiener's and set the body to upgrade wiener; the response is 401 Unauthorized.
- Change the request method from POST to GET with the same parameters in the URL.
- Observe a successful response and confirm the lab is solved.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
A website often checks what you are allowed to do based on how your browser sends a request. Here, the check only looked at the type of request (POST) and missed the same action sent as a GET request. So a normal user could trick the site into giving them admin rights.
What is Access control?
A user can do something their role should not allow: reach an admin function, act on a feature they have not paid for, or skip a permission check. IDOR is the special case where the object belongs to someone else.