I Changed Someone’s Profile Picture… And They Had No Idea!!
The profile picture upload request identified the target account by a user id supplied by the client, and the server did not check that the id belonged to the caller. An attacker could therefore change any other user's profile picture to an image of their choosing.
infosecwriteups.com
Published on infosecwriteups.com
https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fgiphy.com%2Fembed%2FmPytjcsG3XS4o%2Ftwitter%2Fiframe&displayname=Giphy&url=https%3A%2F%2Fmedia.giphy.com%2Fmedia%2FmPytjcsG3XS4o%2Fgiphy.gif%3Fcid%3D790b7611cs0oqemwu6r462xrr9aamnympz6gg2xdspu55bck%26ep%3Dv1gifssearch%26rid%3Dgiphy.gif%26ct%3Dg&image=https%3A…
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 upload endpoint trusted the user id sent in the request and never verified that it matched the logged-in session.
Impact
Any user's profile picture could be replaced with an arbitrary image, which could be used to deface or impersonate accounts.
What the attacker needed
A free account; an intercepting proxy
The fix
The server should derive the target account from the authenticated session rather than from a client-supplied user id, or verify that the id belongs to the caller.
How it was found
- Upload a new profile picture while logged in as yourself.
- Capture the resulting upload request in an intercepting proxy.
- Replace your own user id in the request with another person's user id.
- Send the request and observe that the other person's profile picture is replaced.
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 upload a profile picture, your browser sends a request to the server that includes a number identifying your account. The server should check that this number really is yours. Here it did not, so anyone could put a different person's number in the request and change that person's picture instead of their own.
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.