Parameter Swap Party: When Flipping POST to GET Broke the App
The application routed both POST and GET requests to the same profile update and account deletion logic without consistent authentication checks. An attacker could switch the HTTP method to GET, omit authentication, and modify or delete other users' accounts, including an admin's.
medium.com
Published on medium.com
Free Link ๐
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 backend routed both POST and GET requests to the same handler and did not enforce authentication on the GET path, also trusting user-supplied parameters like userId without validation.
Impact
An attacker could take over accounts, delete an admin's account, and access sensitive user data without authentication.
What the attacker needed
None
The fix
The application should separate logic for GET and POST, validate HTTP methods server-side, avoid mixing query and body parameter parsing, and treat duplicate parameters as malicious.
How it was found
- Discover the endpoint /api/v1/user/updateProfile via JavaScript crawling.
- Change the POST request to a GET request with the same parameters.
- Observe that the profile is updated without authentication.
- Try a GET request to /api/v1/user/deleteAccount with a userId parameter to delete another user's account.
- Use parameter pollution by sending duplicate user parameters to retrieve admin data.
- Bypass WAF blocks by using HTTP verb override headers or HEAD requests.
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.
Normally, a website uses different HTTP methods like POST (to send data) and GET (to request data) for different actions. Here, the server treated them the same, so a request that should have required a login could be sent as a simple GET without any authentication. This let anyone change or delete accounts by just changing the method and adding a user ID.
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.