Messenger site wide CSRF
The Messenger.com site did not validate CSRF tokens on any of its endpoints, so an attacker could make a logged-in user perform actions such as changing settings or removing a user from a group thread. The author confirmed this by removing or altering the token and still getting successful responses.
When Messenger.com launched back in April, I quickly had a look for any low-hanging fruit.
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 server did not validate the CSRF token (fb_dtsg) on any Messenger.com endpoint, accepting requests even when the token was missing or altered.
Impact
An attacker could perform actions on behalf of a logged-in Messenger user, such as changing settings or removing a user from a group thread, without the user's knowledge.
What the attacker needed
Victim is logged in to Messenger.com; victim visits an attacker-controlled page
The fix
The fix was to properly check the CSRF token on every request.
How it was found
- Send a request to change the sound_enabled setting with the normal parameters and note the expected response.
- Remove the fb_dtsg CSRF token from the request and send it again.
- Observe that the response is the same as the normal request, indicating the token was not checked.
- Try another endpoint, such as removing a user from a group thread, without the token.
- Observe that this request also succeeds, confirming the missing check.
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 are logged into a website, your browser automatically sends your session cookie with every request to that site. If the site does not also require a secret, unpredictable token in each request, another website can quietly make your browser send a request that changes your account. This is called cross-site request forgery (CSRF). Here, the Messenger site accepted requests without checking that token, so an attacker could change settings or remove people from group chats on behalf of any logged-in user.
What is CSRF?
Another site makes a signed-in user's browser perform an action they did not intend.