Method-Based Access Control Can Be Circumvented - PortSwigger
Testing how inconsistent HTTP method handling can bypass role-based access controls using Burp Suite Repeater and a low-privileged user session.
Overview
This lab demonstrates how method-based access control can be bypassed when an application enforces authorization inconsistently across HTTP methods. Using Burp Suite, I compared an administrator’s role-management request with a low-privileged user’s request. I discovered that changing the HTTP method allowed the lower-privileged user to upgrade their own role without administrator privileges, completing the lab.
Question / Lab Objective
The objective was to exploit the application’s method-based access control weakness and upgrade the role of the wiener user to administrator.
Walkthrough
1. Exploring the application
After launching the lab, I accessed the target application and explored its available functionality. The website displayed a list of products, individual product pages, and a My Account option.
I browsed the application to understand its structure and identify potential entry points for further investigation.
At this stage, I had not yet identified the administrative functionality. I decided to capture the application’s HTTP requests in Burp Suite so that I could examine how it handled account access and role management.
My goal was to compare the requests generated by different user roles and determine whether the server enforced authorization consistently.
2. Accessing the login page
I clicked My Account, which redirected me to the login page.
The lab instructions provided credentials for two accounts: administrator and wiener.
I used both accounts during the investigation because comparing their requests would help me understand which operations required administrative privileges.
3. Logging in as the administrator
I logged in using the administrator credentials provided by the lab and accessed the administrative interface.
After opening the admin panel, I found user-management functionality that allowed an administrator to change users’ roles.
This was an important discovery because role management is a privileged operation. An ordinary user should not be able to promote themselves to administrator.
I wanted to understand how the application submitted this operation to the server and whether the same request could be performed without an administrator’s session.
4. Logging in as the wiener user
Next, I logged in using the wiener credentials provided by the lab.
This gave me a low-privileged session that I could use to test the application’s authorization controls.
The key idea was to keep the wiener session active while testing whether it could perform an operation that should require administrator privileges.
Why is this important?
If I tested the administrative endpoint using the administrator’s session, a successful response would not prove a vulnerability. The server would already have a valid privileged session.
Using the wiener session allowed me to determine whether the application actually checked the user’s authorization.
5. Capturing and comparing requests in Burp Suite
I opened Burp Suite’s Proxy → HTTP history and identified two relevant requests:
- The administrator’s request to
/admin-roles. - The
wieneruser’s request to/my-account?id=wiener.
I sent both requests to Repeater for further testing.
Repeater allowed me to modify and resend requests while observing how the server responded.
Comparing the requests helped me identify three important differences:
- The HTTP method.
- The requested endpoint.
- The session cookie associated with each user.
I needed to understand these differences before attempting to reproduce the administrative action with the lower-privileged session.
6. Examining the administrator’s role-management request
In Repeater, I inspected the administrator’s request.
The request used the POST method and targeted the /admin-roles endpoint. Its body contained the username and requested role-change action.
The relevant parameters were: username=wiener&action=upgrade
The request also contained the administrator’s session cookie.
This request showed me how the application performed the role change.
I could now identify the operation I needed to test using the wiener session: submit the same intended action without using the administrator’s authentication cookie.
The important distinction was that I was testing the server’s authorization enforcement, not simply copying the administrator’s session.
7. Testing the administrative endpoint with the wiener session
I returned to the request associated with the wiener user.
Initially, it used the GET method and targeted /my-account?id=wiener. I modified the request to use POST, changed the endpoint to /admin-roles, and added the role-management parameters:
username=wiener&action=upgrade
I sent the modified request using the wiener session.
The response did provide clear confirmation that the role change had unsuccessfull and was unauthorized.. I therefore needed to investigate further.
The next step was to test whether changing the HTTP method affected the result.
8. Changing the request method to GET
I changed the request to use GET and moved the parameters into the URL:
GET /admin-roles?username=wiener&action=upgrade HTTP/2
I sent the request while keeping the wiener session cookie.
This time, the role change appeared to succeed but the response did not provide clear confirmation that the role change had succeeded. I therefore needed to investigate further rather than treating the response alone as proof.
This is an important habit during security testing: a request can return a response that looks successful without completing the intended operation. Conversely, an unusual response does not always mean that an operation failed.
This was the critical finding: the application allowed the low-privileged user to perform a privileged operation by changing the HTTP method used to access the administrative endpoint.
Why did changing the method matter?
HTTP methods describe the intended type of operation associated with a request. For example:
GETis generally used to retrieve a resource.POSTis commonly used to submit data or trigger an operation.
An application may have different routing or authorization logic for different methods. If the server checks administrator privileges for a POST request but fails to apply the same check to an equivalent GET request, the access-control mechanism can be bypassed.
In this lab, changing the method allowed me to reach the same role-management functionality through a different request path.
The vulnerability was not that GET is inherently insecure. The problem was that the application failed to enforce the required authorization consistently.
9. Experimenting with arbitrary HTTP methods
After observing that the GET request worked, I decided to investigate whether the behavior depended specifically on GET or whether the application handled other HTTP methods incorrectly as well.
I changed the method to an arbitrary value and tested the request in the lab environment.
For example:
use_random_character /admin-roles?username=wiener&action=downgrade HTTP/2
I then tested another arbitrary method name:
fddsfsgebe /admin-roles?username=wiener&action=upgrade HTTP/2
These experiments helped me explore how the application and its HTTP-handling infrastructure responded to unexpected method names.
However, the result needs to be interpreted carefully. Arbitrary method names do not automatically bypass authorization. Depending on the server and application framework, an unknown method might be rejected, handled by a fallback route, or processed in an unexpected way.
The security issue is the inconsistent enforcement of access control. The important evidence is whether the privileged action actually occurs under the low-privileged session.
10. Verifying the role change and completing the lab
After testing the modified requests, I checked the application’s behavior to verify the outcome of the role-management operation.
The lab displayed its completion message after the required administrative role change had been performed.
This confirmed that the application had allowed the role change without requiring the appropriate administrator privileges.
The experiment demonstrated that changing the HTTP method could circumvent the application’s method-based access control.
Key Takeaways
- Compare requests from different roles: An administrator’s request can reveal how a privileged operation is structured, while a low-privileged session helps test whether authorization is enforced correctly.
- Understand HTTP methods: Applications may process the same endpoint differently depending on the request method.
- Test authorization, not just authentication: A valid session does not mean the user should be allowed to perform every operation.
- Use Burp Suite Repeater: Repeater makes it easier to change methods, endpoints, parameters, and cookies while comparing responses.
- Verify state changes: Do not rely exclusively on status codes or response messages. Confirm whether the requested action actually occurred.
- Investigate unexpected behavior systematically: Testing alternative methods can reveal routing or authorization inconsistencies, but each result must be verified.
- Enforce access control server-side: Every privileged operation must independently verify that the authenticated user has the required permissions.
Security Impact
Method-based access control vulnerabilities can allow lower-privileged users to execute operations intended exclusively for administrators.
Depending on the affected functionality, an attacker might promote their own account, modify other users’ privileges, access restricted resources, or perform unauthorized administrative actions.
In this lab, the weakness allowed the wiener user to upgrade their own role without the intended administrator authorization. In a real-world application, this could lead to privilege escalation and compromise of other protected functionality.
The severity would depend on the privileges gained, the operations available to the upgraded account, and the extent to which the application relied on the vulnerable access-control mechanism.
Remediation
To prevent method-based access control bypasses:
- Enforce authorization on every request: Verify that the authenticated user has the necessary permissions for each privileged operation, regardless of the HTTP method.
- Centralize access-control checks: Use consistent server-side authorization middleware or a policy layer instead of relying on individual routes to implement checks correctly.
- Restrict privileged endpoints: Ensure that only authorized users can access administrative functions such as role management.
- Use HTTP methods consistently: Define the methods supported by each endpoint and reject unsupported methods explicitly. Do not rely on method restrictions as a substitute for authorization.
- Avoid state-changing GET requests: Operations that modify roles or other sensitive data should not be implemented as ordinary resource-retrieval requests.
- Test authorization systematically: Test privileged endpoints using low-privileged accounts and alternative HTTP methods to verify that access controls cannot be circumvented.
- Verify the resulting state: Include tests that confirm unauthorized requests cannot change user roles or other protected data.
Conclusion
This lab demonstrated how inconsistent access-control enforcement across HTTP methods can allow privilege escalation.
By comparing the administrator’s role-management request with the wiener user’s session in Burp Suite, I identified the /admin-roles endpoint and tested how it responded to changes in the HTTP method. The modified GET request allowed the low-privileged user to perform an administrative role change, demonstrating the access-control weakness.
The main lesson is that restricting a privileged operation to a particular HTTP method is not sufficient protection. Authorization must be checked on the server for every request, regardless of how the client submits it.
Thanks for reading!












