Attacker Can Edit Other Users Profile in a Real World Platform
The profile update endpoint authenticated the request with a Bearer token but did not check that the user_id in the URL belonged to the caller. Any logged-in user could change another user's profile name by swapping in their identifier.
medium.com
Published on medium.com
While testing a web application, I discovered a vulnerability that allowed unauthorized modification of user profiles. At first glance, the functionality seemed harmless — a simple “change username” feature.
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
The endpoint performed authentication but no object-level authorization check, trusting the user_id supplied in the URL path.
Impact
An authenticated attacker could modify any other user's profile data, enabling impersonation in chat, targeted social engineering and mass defacement.
What the attacker needed
A free account; victim's user_id visible in chat
The fix
The server should derive the user identity from the Bearer token and enforce object-level authorization so users can only modify their own data.
How it was found
- Create an attacker account and a victim account.
- Log in as the attacker and intercept the profile update request.
- Find the victim's user_id in the chat section.
- Replace the attacker's ID in the request path with the victim's ID.
- Send the modified request using the attacker's Bearer token.
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.
When you log in, the app gives you a token that proves who you are. This app checked the token but never checked that the profile being edited was actually yours. So anyone with an account could edit anyone else's profile just by changing a number in the request.
What is IDOR?
One user can read or change another user's data, usually by changing an identifier the server trusts without checking who is asking. One of the most paid bug classes on web programs.