Facebook User Identification Bug
A Facebook badge preview image was dynamically generated from a user ID, and although other users' previews showed a generic logo, the image dimensions still differed. An external website could load many badge previews with different IDs and check their dimensions to detect if a specific person was visiting the site.
Meta
Published on patorjk.com
I decided to take another shot at Facebook’s Security Bug Bounty program. This time I ended up finding a bug that allowed a website to use Facebook to detect if a visitor was a particular person.
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 badge preview endpoint returned a differently sized image for the badge owner versus other users, leaking whether the viewer matched the requested user ID.
Impact
A website could detect whether a visitor was a particular Facebook user from a list of known IDs, enabling targeted tracking or content changes, though only for users the attacker already knew.
What the attacker needed
Victim visits attacker's website; attacker knows victim's Facebook ID; victim logged into Facebook
The fix
The bug was fixed after the report, and the author verified the fix.
How it was found
- Notice that a Facebook badge preview image is generated from a user ID.
- Try loading another user's badge preview and observe that a Facebook logo appears instead of the profile image.
- Realise that the logo has different dimensions from a real badge preview.
- Use JavaScript on an external site to load many badge previews with different user IDs.
- Check the height and width of each loaded image to determine if the viewer matches a tested user ID.
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 visit a website, your browser can load images from other sites. This report found that a Facebook image changed size depending on whether the viewer was the person whose ID was in the image link. By loading many such images, a website could quietly test whether you are a particular person.
What is Info disclosure?
Data the application should keep private (personal data, internal details, other users' records) reaches someone it should not.