Determine a Facebook user from an email address
An endpoint accepted a SHA-256 hash of an email address and returned the corresponding Facebook user ID, even for private accounts. An attacker with a list of email addresses could bulk-resolve them to user IDs, enabling large-scale scraping and linking of email addresses to Facebook users.
Published on philippeharewood.com
Given an email address, it is possible to identify a user ID. There are various non-trivial ways to link an email address to a user however this particular call seems as though it can be used for scraping in bulk, given, for example, a mailing list.
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 endpoint that handles supporter invitations returned the inviter's user ID without checking whether the requester should be allowed to learn that mapping, and it accepted hashed emails so it could be automated at scale.
Impact
This could have let a malicious user tie an email address back to a Facebook user, and because the call could be automated it could be used for scraping in bulk.
What the attacker needed
A Facebook account; knowledge of the target email address; ability to run JavaScript in a browser console
The fix
Facebook fixed the issue within two days of the report.
How it was found
- Open a Chrome console window while logged in to Facebook.
- Send a request to the invitesupporters upload endpoint with an array containing the SHA-256 hash of the target email address.
- Read the numeric Facebook ID from the response payload.
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.
Facebook lets you find people by email, but normally you cannot turn an email into a user ID. Here, a hidden web request took a scrambled version of an email (a hash) and replied with the numeric ID of the account. Because it worked in bulk, someone with a mailing list could match many emails to Facebook accounts.
What is Info disclosure?
Data the application should keep private (personal data, internal details, other users' records) reaches someone it should not.