Beware of Method Swapping: Unveiling a Potential Security Vulnerability
The web application enforced access control only for GET requests on a user account endpoint, so a user who was forbidden from viewing another account could delete it by switching the request method to DELETE. An attacker could delete any user's account.
In the ever-changing field of cybersecurity, being vigilant is essential. Every technological development raises the possibility of the emergence of new vulnerabilities.
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 access-control check was applied only to the GET method and not to the DELETE method on the same endpoint.
Impact
An attacker could delete any user's account, as demonstrated by deleting user 1.
What the attacker needed
Ability to send HTTP requests; knowledge of a user identifier
How it was found
- Send a GET request to the user endpoint and observe a 403 Forbidden response.
- Change the request method to DELETE on the same endpoint.
- Observe a 200 OK response and the account is deleted.
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.
Websites use different request methods to say what they want to do, such as GET to view a page or DELETE to remove something. Here the site checked permissions only when viewing, but not when deleting, so changing the method let someone delete another person's account.
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.