Skip to content
Info disclosure Write-up Beginner

A Facebook bug that exposes email/phone number to your friends

When a user added a new email or phone number to their Facebook account, the privacy setting defaulted to 'Friends' instead of the promised 'Only Me', exposing contact information to friends. An attacker who is a friend could view the victim's email or phone number.

Saugat Pokharel Follow

Published on iamsaugat.medium.com

Bounty$18,250 View original

Hi, I am Saugat Pokharel from Kathmandu, Nepal. Today, I am going to explain my other quick and easy finding on Facebook.

Saugat Pokharel, on iamsaugat.medium.com

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.

Written with AI from the full original report and checked against it passage by passage; anything it could not back up was removed or toned down. The original is the record. 7 min read.

Context

Facebook lets a user attach several contact points to an account: email addresses and phone numbers. Each contact point carries a visibility setting that controls who can see it on the profile. The account settings pages for email and phone are the places where a user adds and confirms a new contact point, and the prompt shown during that flow makes a promise about the resulting privacy.

The feature under scrutiny here is the default visibility applied to a newly added and confirmed contact point. The researcher's interest was triggered by a widely reported leak of 533 million Facebook users' phone numbers and email addresses in April 2021. Facebook's public position, as the researcher describes it, was that the data had not been obtained by hacking but by public scraping that abused the Contact Importer feature, and that the data dated from 2019. The researcher checked whether his own data was in the list, did not find it, and decided to change his email as a precaution. That routine action is where the bug surfaced.

Setup

The setup is a normal Facebook account and the standard account settings interface. No special tooling, role or version is described. The relevant pages are:

  • Facebook > Settings > Account Settings, for adding and confirming an email address.
  • https://www.facebook.com/settings?tab=account&section=phone, for adding and confirming a phone number.

The precondition for the finding is simply that a user adds a new contact point and confirms it, then relies on the privacy promised by the prompt without re-checking it afterwards.

Finding it

While adding a new email, the researcher read the prompt carefully. It said:

Only you will see your email on your profile.

That wording means the new email should end up with privacy set to "Only Me".

From the original on iamsaugat.medium.com

He added and confirmed the email, then went to his profile. The email's privacy had defaulted to "Friends" instead of "Only Me". The prompt and the actual outcome disagreed, and the direction of the disagreement was towards more exposure, not less. The researcher's reasoning is worth keeping: users could change the privacy of their email later, but not everyone will repeatedly check the privacy of an email after confirming it. A user who reads the prompt and trusts it will believe the address is visible only to them. That gap between stated and actual behaviour is what made it look like a bug, and he reported it to Facebook Security.

Exploitation

Step 1: Confirm the email default

Add a new email through Settings > Account Settings, confirm it, and inspect the profile. The privacy is "Friends", not the "Only Me" promised by the prompt. This is the initial report.

Step 2: Check whether phone numbers behave the same way

After sending the report, the researcher went further to see whether phone numbers were affected. He navigated to:

Text
https://www.facebook.com/settings?tab=account&section=phone
From the original on iamsaugat.medium.com

He added and confirmed his number. The privacy defaulted to "Friends" here as well. He mentioned this in the same report, and asked the security team whether he could file a separate report for the phone number issue to improve his Hacker Plus count. The reply was: "Sure, you can create a different report."

The email issue was acknowledged and fixed three days after triage. The Facebook team said: "We will decide bounty once we fix this phone number issue as well."

Step 3: Bypass the email fix through the disavow flow

With the email issue fixed, the researcher tried to bypass the original fix. He used the disavow flow.

The disavow flow is a Facebook feature for regaining access to an account directly from an email when the account is compromised. If an attacker has accessed the account and changed the password, email or phone, a notification is sent to the previously removed email asking whether the account owner performed the change. The victim can disavow the action by clicking "Secure your account".

Email notification from where disavow flow can be initiated From the original on iamsaugat.medium.com

Email notification from where disavow flow can be initiated

He clicked "Secure your account" and added a new email. After adding it, he also saw an option to change his email address. He changed the email address to a random address from a temp mail service. After confirming the email, its privacy again defaulted to "Friends" instead of "Only Me".

From the original on iamsaugat.medium.com

This confirmed that the patch was not sufficient. He replied in the initial report with the bypass steps and a video POC, and, after approval from the security team, created a new report for the disavow flow bypass.

Step 4: Look for further endpoints

He then searched for more bypasses and found that there were many endpoints where the email defaulted to privacy "Friends". He sent a few more bypasses, repeatedly, until he got the response shown below.

From the original on iamsaugat.medium.com

At that point he was advised not to spend more time looking for bypasses, so he stopped searching for additional vulnerable endpoints.

Root cause

The report does not describe the server-side code. What the behaviour shows is that the contact point creation and confirmation paths did not apply the privacy value the interface promised: the prompt stated "Only you will see your email on your profile", while the stored visibility was "Friends". The same mismatch appeared on the phone number path and on the disavow flow path, and the researcher found many endpoints with the same default. The first fix addressed the paths that had been reported, but not the disavow flow, so the bypass worked. The report does not state why the existing checks did not catch the mismatch.

Impact

A user who adds an email or phone number and trusts the prompt would have that contact point visible to friends rather than only to themselves. The exposure is to the user's friends, not to the public, and the user could change the privacy afterwards, though the researcher notes that not everyone re-checks privacy after confirming.

Facebook said it fixed the issue and corrected the settings for people whose visibility configuration it believed was impacted, meaning users who had added an email and had privacy "Friends" were changed to "Only Me". Facebook also said it found no evidence of abuse, such as scraping of that data. Previously, a new Facebook account defaulted to "Friends"; from then on the default became "Only Me".

Fix

Facebook fixed the issue and corrected the settings for affected users. While checking the fix, the researcher found that all endpoints were correctly identified and fixed. The default privacy for a newly created account changed from "Friends" to "Only Me".

The outcome for the researcher: all three reports had the same reward, for a total of $18250 ($5000 x 3 + a $3250 bonus). The finding was featured on the Facebook Bug Bounty page as one of the interesting bugs related to contact points, on the same day the bounty was paid. The bounty took him to rank #11 globally on the Facebook Whitehat Thanks Page.

From the original on iamsaugat.medium.com

He also reached the Platinum league in the Facebook Hacker Plus League. Researchers in that league get an invitation to attend Vegas DEFCON, sponsored by Facebook.

From the original on iamsaugat.medium.com

He also received a message from one of his favourite security engineers at Facebook.

From the original on iamsaugat.medium.com

A separate issue found while verifying the email issue: one of his emails could not be removed from his account using mobile devices. He intercepted the Android app traffic and tried to delete that specific email, but an exception always blocked the deletion. Facebook acknowledged and fixed it, and rewarded $1000.

Undeletable email address From the original on iamsaugat.medium.com

Undeletable email address

Timeline of the report:

Event Date
Initial email issue sent April 17, 2021
Initial phone issue sent April 17, 2021
Triaged April 21, 2021
Email issue fixed April 24, 2021
Bypass sent May 7, 2021
Phone number issue fixed September 2, 2021
Bypass fixed September 2, 2021
Bounty rewarded September 2, 2021
Bounty message from one of the three spitted reports From the original on iamsaugat.medium.com

Bounty message from one of the three spitted reports

Video POC: https://youtu.be/wkGQL2jNabU

Or watch on YouTube
From the original on iamsaugat.medium.com

Variants to test

  • Other contact point flows. Add a contact point through every path that offers one (settings pages, recovery flows, account confirmation flows) and check the resulting visibility against what the interface promises. A positive result is a stored visibility broader than the prompt states.
  • Recovery and disavow flows. Trigger the account recovery or disavow flow, add or change a contact point from inside it, and inspect the privacy afterwards. A positive result is the same "Friends" default appearing on a path that was not part of the original fix.
  • Endpoint enumeration. Look for additional endpoints that create or confirm contact points and test each one. A positive result is any endpoint where the default differs from the documented or prompted value.
  • Re-test after a fix. When a fix is announced, retry the original path and the alternate paths, since a patch applied per endpoint can leave others open.
  • Deletion paths. Try removing a contact point from every client, including the mobile app, and watch for exceptions that block deletion. A positive result is a contact point that cannot be removed through a given client.

Written with AI from the full original report and checked against it passage by passage; anything it could not back up was removed or toned down. The original is the record. 13 min read.

What happened, in plain words

A security researcher in Nepal, Saugat Pokharel, was reading the news in April 2021 about a huge leak of Facebook users' phone numbers and email addresses. He checked whether his own details were in the leak, and they were not. Even so, he decided to change the email address on his Facebook account as a precaution.

While he was doing that ordinary task, he read the small message Facebook shows when you add a new email. The message promised that only he would see the email on his profile. After he confirmed the email and looked at his profile, the email was visible to his friends instead. The promise and the reality did not match, and the reality was the more exposed one.

He reported it. Then he found the same problem with phone numbers, and later found a way to get around Facebook's first fix by using a different part of the site. Facebook eventually fixed everything, paid him a total of $18250 across three reports, and changed the default privacy for new accounts. He also found a separate, unrelated bug along the way and was paid $1000 for it.

This article walks through what he did, step by step, and explains every technical idea as it comes up. You only need to know how to use a browser to follow it.

The background: what a contact point is, and why privacy settings matter

Facebook lets you attach several contact points to one account. A contact point is simply a way to reach you: an email address or a phone number. You can have more than one of each.

Each contact point has a visibility setting (also called a privacy setting). This controls who can see that contact point on your profile. Common values are:

  • Only Me: nobody but you can see it.
  • Friends: the people on your friends list can see it.
  • Public: anyone can see it.

Think of it like the label on a parcel. The label says who is allowed to open it. If the label says "only the addressee" but the parcel is left on the doorstep for the whole street, the label was wrong, and that is the kind of mismatch this story is about.

The pages involved are the normal account settings pages, the ones you reach from a browser:

  • Facebook > Settings > Account Settings, where you add and confirm an email address.
  • https://www.facebook.com/settings?tab=account&section=phone, where you add and confirm a phone number.

No special tools, no hacking software, no unusual account type. Just a normal account and the standard settings screens.

Why the researcher was looking at all

On April 3, 2021, the researcher saw news with the title "533 Million Facebook users' phone/email leaked online". As an active Facebook user, that was concerning to him.

Facebook later explained, as the researcher describes it, that the data had not been taken by hacking. Instead, it had been gathered by public scraping that abused a feature called Contact Importer, and the data dated from 2019.

Two ideas need unpacking here:

  • Scraping means automatically collecting information that a website shows, usually with a script, rather than a person clicking around. It is like photocopying every page of a public noticeboard.
  • Contact Importer is a Facebook feature that lets you upload your phone's address book to find friends. If it can be abused, it can be used to check which phone numbers or emails belong to which accounts, which is a way of gathering data at scale.

The researcher checked whether his own data was in the leaked list, using a site called haveibeenzucked.com, and did not find it. Still, he wanted to change his email as a precaution. That routine action is where the bug appeared.

Finding it: the prompt that made a promise

While adding a new email, he read the prompt carefully. It said:

Only you will see your email on your profile.

That sentence means the new email should end up with privacy set to "Only Me".

From the original on iamsaugat.medium.com

He added the email and confirmed it. Confirming usually means clicking a link that Facebook sends to the new address, to prove the address really belongs to you. Then he went to his profile and looked. The email's privacy had defaulted to "Friends" instead of "Only Me".

Why does this matter? Because the prompt and the actual result disagreed, and the disagreement went in the direction of more exposure, not less. The researcher's reasoning is worth keeping in mind: yes, a user could change the privacy of the email later, but not everyone will go back and re-check the privacy of an email after confirming it. A user who reads the prompt and trusts it will believe the address is visible only to them. That gap between what the site says and what it does is what made it look like a bug, and he reported it to Facebook Security.

Step 1: confirm the email default

The first step is simply to repeat what he did:

  1. Go to Settings > Account Settings.
  2. Add a new email address.
  3. Confirm it through the link Facebook sends.
  4. Open your profile and look at who can see that email.

The result: the privacy is "Friends", not the "Only Me" promised by the prompt. This became the initial report.

Step 2: check whether phone numbers behave the same way

After sending the report, the researcher went further. He wanted to know whether phone numbers had the same problem. To check, he opened this page:

Text
https://www.facebook.com/settings?tab=account&section=phone
From the original on iamsaugat.medium.com

What that URL means, piece by piece:

  • https:// is the secure version of the web protocol. It means the connection between your browser and the site is encrypted.
  • www.facebook.com is the site.
  • /settings is the settings page.
  • ?tab=account&section=phone is the part after the question mark. It tells the page which tab and which section to open. The & separates two settings: tab=account and section=phone. Think of it as telling a librarian "second floor, phone section" in one sentence.

He added and confirmed his number. The privacy defaulted to "Friends" here as well. He mentioned this in the same report, and asked the security team whether he could file a separate report for the phone number issue, to improve his Hacker Plus count.

Hacker Plus is Facebook's programme that tracks and rewards researchers over time, a bit like a loyalty scheme for bug hunters. Filing separate reports can count separately towards that score. The reply from the team was: "Sure, you can create a different report."

The email issue was acknowledged and fixed three days after triage. Triage is the first stage of a bug report: the security team reads it, checks whether it is real and how serious it is, and assigns it to someone. The Facebook team said: "We will decide bounty once we fix this phone number issue as well."

Step 3: get around the email fix using the disavow flow

With the email issue fixed, the researcher tried to bypass the original fix. A bypass means finding another way to do the same harmful thing after the first route has been closed. If a shop locks the front door but leaves the back door open, the lock is a fix that can be bypassed.

This time he used the disavow flow.

What the disavow flow is

The disavow flow is a Facebook feature for getting back into your account directly from an email, in case the account is compromised. If an attacker has got into the account and changed the password, email or phone, Facebook sends a notification to the previously removed email address, asking whether the account owner really made that change. The victim can then disavow the action, meaning "I did not do this", by clicking "Secure your account".

Email notification from where disavow flow can be initiated From the original on iamsaugat.medium.com

Email notification from where disavow flow can be initiated

Think of it as a bank phoning your old number to ask "did you really just change your address?" If you say no, the bank reverses the change. It is a safety net, and safety nets are interesting to testers because they are another way into the same settings.

What he did

He clicked "Secure your account" and added a new email. After adding it, he also saw an option to change his email address. He changed the email address to a random address from a temp mail service.

Temp mail is a service that gives you a disposable email address that lasts a short time. Testers use it so they do not have to use a real personal address.

After confirming the email, its privacy again defaulted to "Friends" instead of "Only Me".

From the original on iamsaugat.medium.com

This confirmed that the patch was not sufficient. The first fix had closed the route he originally reported, but the disavow route still had the same flaw. He replied in the initial report with the bypass steps and a video POC, and, after approval from the security team, created a new report for the disavow flow bypass.

A POC, or proof of concept, is a demonstration that the bug is real. A video POC is a recording of the steps, so the team can see exactly what happened without having to reproduce it themselves.

Step 4: look for more endpoints

He then searched for more bypasses. He found that there were many endpoints where the email defaulted to privacy "Friends". He sent a few more bypasses, repeatedly, until he got the response shown below.

From the original on iamsaugat.medium.com

An endpoint is a specific address on a server that does one job. A website is not one single program; it is many small addresses, each handling one action: one for adding an email, one for confirming it, one for changing it, and so on. If the same mistake is made separately in each of those places, then fixing one does not fix the others. That is exactly what he was finding.

At that point he was advised not to spend more time looking for bypasses, so he stopped searching for additional vulnerable endpoints.

Why the bug happened

The report does not describe the server-side code, so we cannot say exactly which line was wrong. What the behaviour shows is that the paths for creating and confirming a contact point did not apply the privacy value the interface promised. The prompt said "Only you will see your email on your profile", while the stored visibility was "Friends".

The same mismatch appeared on the phone number path and on the disavow flow path, and the researcher found many endpoints with the same default. The first fix covered the paths that had been reported but not the disavow flow, so the bypass worked.

The report does not state why the existing checks did not catch the mismatch.

What the impact was

A user who adds an email or phone number and trusts the prompt would have that contact point visible to friends rather than only to themselves. The exposure is to the user's friends, not to the public, and the user could change the privacy afterwards, though the researcher notes that not everyone re-checks privacy after confirming.

Facebook said it fixed the issue and corrected the settings for people whose visibility configuration it believed was impacted. In plain terms, users who had added an email and had privacy "Friends" were changed to "Only Me". Facebook also said it found no evidence of abuse, such as scraping of that data. Previously, a new Facebook account defaulted to "Friends"; from then on the default became "Only Me".

The fix and the rewards

Facebook fixed the issue and corrected the settings for affected users. While checking the fix, the researcher found that all endpoints were correctly identified and fixed. The default privacy for a newly created account changed from "Friends" to "Only Me".

The outcome for the researcher: all three reports had the same reward, for a total of $18250 ($5000 x 3 + a $3250 bonus). The finding was featured on the Facebook Bug Bounty page as one of the interesting bugs related to contact points, on the same day the bounty was paid. The bounty took him to rank #11 globally on the Facebook Whitehat Thanks Page.

From the original on iamsaugat.medium.com

He also reached the Platinum league in the Facebook Hacker Plus League. Researchers in that league get an invitation to attend Vegas DEFCON, sponsored by Facebook.

From the original on iamsaugat.medium.com

He also received a message from one of his favourite security engineers at Facebook.

From the original on iamsaugat.medium.com

A separate bug found along the way

While verifying the email issue, he hit another problem. One of his emails could not be removed from his account using mobile devices. He intercepted the Android app traffic and tried to delete that specific email, but an exception always blocked the deletion.

Two ideas to explain:

  • Intercepting traffic means putting a tool between the app and the server so you can read and change the messages they exchange. It is like opening the envelope of a letter to read it before it is delivered.
  • An exception is an error that a program raises when something goes wrong. Here, the server kept raising an error instead of deleting the email.

Facebook acknowledged and fixed it, and rewarded $1000.

Undeletable email address From the original on iamsaugat.medium.com

Undeletable email address

Timeline of the report

Event Date
Initial email issue sent April 17, 2021
Initial phone issue sent April 17, 2021
Triaged April 21, 2021
Email issue fixed April 24, 2021
Bypass sent May 7, 2021
Phone number issue fixed September 2, 2021
Bypass fixed September 2, 2021
Bounty rewarded September 2, 2021
Bounty message from one of the three spitted reports From the original on iamsaugat.medium.com

Bounty message from one of the three spitted reports

Video POC: https://youtu.be/wkGQL2jNabU

Or watch on YouTube
From the original on iamsaugat.medium.com

Things worth testing if you want to try this yourself

These are the kinds of checks the researcher's approach suggests. They are listed as ideas, not as instructions to break any rules. Only test on accounts and systems you are allowed to test, and follow the programme's rules.

  • Other contact point flows. Add a contact point through every path that offers one (settings pages, recovery flows, account confirmation flows) and check the resulting visibility against what the interface promises. A positive result is a stored visibility broader than the prompt states.
  • Recovery and disavow flows. Trigger the account recovery or disavow flow, add or change a contact point from inside it, and inspect the privacy afterwards. A positive result is the same "Friends" default appearing on a path that was not part of the original fix.
  • Endpoint enumeration. Look for additional endpoints that create or confirm contact points and test each one. A positive result is any endpoint where the default differs from the documented or prompted value.
  • Re-test after a fix. When a fix is announced, retry the original path and the alternate paths, since a patch applied per endpoint can leave others open.
  • Deletion paths. Try removing a contact point from every client, including the mobile app, and watch for exceptions that block deletion. A positive result is a contact point that cannot be removed through a given client.

Glossary

  • Account Settings: the pages inside Facebook where you manage your email addresses, phone numbers, password and similar details.
  • Bypass: a way to achieve the same harmful result after the original route has been fixed.
  • Contact Importer: a Facebook feature that lets you upload your phone's address book to find friends; it can be abused to gather data at scale.
  • Contact point: a way to reach you on an account, such as an email address or a phone number.
  • Disavow flow: a Facebook recovery feature that emails a previously removed address so the owner can say "I did not make this change" and secure the account.
  • Endpoint: a specific address on a server that performs one action, such as adding or confirming an email.
  • Exception: an error raised by a program when something goes wrong, which can block an action.
  • Hacker Plus: Facebook's programme that tracks and rewards researchers over time.
  • Intercept: to place a tool between an app and a server so you can read or change the messages they exchange.
  • Only Me / Friends / Public: the three common visibility values for a contact point, meaning visible to nobody but you, to your friends, or to anyone.
  • POC (proof of concept): a demonstration that a bug is real, often a video recording of the steps.
  • Privacy setting (visibility setting): the rule that controls who can see a piece of information on your profile.
  • Prompt: the short message a website shows you while you are doing something, such as adding an email.
  • Public scraping: automatically collecting information a website shows, usually with a script, rather than a person clicking around.
  • Temp mail: a service that gives you a disposable email address that lasts a short time.
  • Triage: the first stage of a bug report, where the security team checks whether it is real and how serious it is.
  • URL: the address of a page on the web; the part after ? passes settings to the page.
  • Video POC: a recording of the steps that demonstrate a bug.

More by Saugat Pokharel

View all

5 more disclosed reports, best first.

More from Meta

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Information disclosure

The lesson behind this report.

Data the application should keep private (personal data, internal details, other users' records) reaches someone it should not.