How I was able to generate Access Tokens for any Facebook user.
An endpoint used by the Rights Manager dashboard issued a page access token for whatever identifier was supplied, without checking that the identifier belonged to a page rather than a user. By supplying a user's identifier instead, an attacker could obtain an access token for that user and read their private data.
Published on medium.com
{{media:0}}
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
Impact
The token's scopes were page-level rather than user-level, so the attacker could not read messages or fully take over the account, but could read private information such as emails, phone numbers, payment details, managed pages and their tokens, ad accounts and private posts, photos and videos.
What the attacker needed
Knowledge of a target user's identifier; access to the Rights Manager endpoint
The fix
Facebook first changed its APIs to reject tokens generated this way, then later changed the endpoint and others to refuse to issue such tokens when the identifier matches a user object.
How it was found
- Send a POST request to the vulnerable endpoint with a page_id parameter.
- Replace the page_id value with the identifier of a target Facebook user.
- Read the access token for that user from the response.
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 page access token is a credential that lets software act on behalf of a Facebook page. The server handed one out for any identifier you gave it, including the identifier of a normal person's account, so the attacker received a credential tied to that person. The token's permissions were limited to page-level actions, so it did not allow a full account takeover, but it still exposed private profile data.
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.