Removing Covers/Images on Friendship Pages on Facebook
The friendship page cover removal endpoint accepted a friendship_id belonging to any two users, so an attacker could delete the cover photo from any friendship page. The fix restricted removal to the user's own cover.
This is a quick post about a simple bug I found on Friendship Pages on Facebook. (Note: Not nearly as cool as a full account takeover, however!)
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 cover-removal endpoint trusted a client-supplied friendship identifier without verifying that the requesting user belonged to that friendship.
What the attacker needed
A Facebook account; knowledge of the two users' IDs
The fix
The endpoint was fixed so that a user can only remove their own cover.
How it was found
- Obtain the friendship_id for a target pair of users via the selector AJAX endpoint.
- Send a request to the remove AJAX endpoint with that friendship_id in the profile_id parameter.
- Refresh the page and the cover is gone.
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.
A friendship page is a Facebook page showing how two people are connected. The site had a request that deleted a cover photo, and it did not check that the person sending the request was one of the two people on that page. So anyone who knew the page's identifier could delete someone else's cover photo.
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.