Skip to content
Info disclosure Write-up Beginner

Bypassed Facebook Phone Number Security

The Facebook account recovery form revealed the user ID linked to a phone number even when the user's privacy setting was 'Friends Only'. An attacker could enter a phone number, complete the recovery form with fake details, and see the user ID in the support dashboard or in a follow-up email.

Zahid Ali Follow

Published on medium.com

Bounty$3,000 View original

Enumeration vulnerabilities which demonstrate that a given e-mail address or mobile phone number is tied to “a Facebook account” are not eligible under the bug bounty program. This is true whether the endpoint returns only confirmed items, or both confirmed and unconfirmed.

Zahid Ali, on 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's account recovery flow, reached through the "Forgotten password?" link, lets a user who has lost access to an account prove ownership and regain entry. For accounts registered with a phone number, the flow offers a path for users who "No longer have access to these" (the phone number or email on file). That path asks the user to supply a new email address twice, fill in a form, and submit it. The submission opens a Support Dashboard, and Facebook follows up by email.

The report concerns a privacy boundary on that flow. Facebook's own programme rules, quoted at the top of the write-up, draw the line clearly:

  • Enumeration that only shows whether an email address or phone number is tied to a Facebook account is not eligible, whether the endpoint returns only confirmed items or both confirmed and unconfirmed. Without the user ID, this is treated as extremely low risk.
  • Vulnerabilities that let an attacker determine which specific user ID an email address or phone number is linked to may be rewarded, but only if this happens in violation of the account's privacy settings about who can look the user up via that email or phone number.

The bug sits in the second category: it disclosed the specific user ID behind a phone number even when the account's "Who can look you up using the phone number you provided?" setting was set to Friends Only.

Setup

The researcher tested the Facebook account recovery form. The form was only available for users who had registered their Facebook ID with phone numbers, so the precondition is a target account that has a phone number linked and has restricted phone-number lookups to Friends Only. No special tooling is described; the work was done through the normal web flow and the emails Facebook sends in response.

Finding it

The researcher was testing the account recovery form and noticed that the Support Dashboard it opens exposed the self-identified user ID (uid) of the account that owns the phone number entered. That is exactly the disclosure the programme rules single out: not merely "this number has an account", but the specific user ID, and it happened despite the account's privacy setting restricting lookups by phone number to friends.

Exploitation

First attempt: uid in the Support Dashboard

  1. Go to Forgotten password?
  2. Type a phone number where facebook id is linked.
  3. Now click "No longer have access to these"
  4. type your new email twice
  5. fill up form with fake information and "Submit"
  6. Support Dashboard will open where self-identified uid is visible for the attacker.

The key step is the submission of the recovery form with fabricated details. The Support Dashboard that opens afterwards shows the self-identified uid, so the attacker learns which specific account the phone number belongs to. The screenshots below follow the flow from the recovery form through to the dashboard.

From the original on medium.com

Facebook accepted the bug and awarded 1500 USD.

From the original on medium.com

The patch and the changed behaviour

After the fix, the researcher disclosed the bug to friends but remained curious about the form and tested it again. The uid was no longer shown in the Support Dashboard, but the same information could still be obtained with a changed behaviour: the server still sent the user ID of the specific phone number by email if the same email address was used in a second attempt.

In the researcher's words: "Getting user id in the email in the first attempt they patched the bug but server still sending user id of that specific phone number if we do 2nd attempt with the same email".

Second attempt: uid in the email

  1. Go to Forgotten password?
  2. type your new email twice
  3. Support Dashboard will open but this time self-identified UID is not visible in the support dashboard. (Because bug has been patched)
  4. Check the email but user id is not there also.
  5. Go to Forgotten password? (Again)
  6. Type same phone number.
  7. repeat same steps with same email we did it in first bug.

The first pass through the flow now behaves correctly: neither the dashboard nor the email contains the uid. The second pass, reusing the same email address, is where the server still leaks it. The screenshots document the first pass and the email that arrives without a user ID.

From the original on medium.com

As the researcher put it: "I got reply from Facebook but in this reply i am not getting user id of that number. Now Lets do 2nd attempt."

From the original on medium.com

On the second attempt the email contains the self-identified uid, highlighted in the screenshot.

Triage correspondence

The researcher reported the changed behaviour and received a reply from Reginaldo on the Facebook Security team:

Text
Hi Zahid,

Ah, I see what's happening here. Can you still reproduce this? It has the same root cause as your other report #314709118, so the fix for #314709118 should have fixed this one too. As we get a lot of submissions, we'll close this ticket while we wait for more info from you. If you do find that the issue still reproduces, please reply to this email and the ticket will re-open and we can take another look.

Thanks for your submission.

Reginaldo
Security
Facebook

The researcher replied that the bug was still reproducible. Neal from Facebook Security then responded:

Text
Hi Zahid,

We have looked into this issue and believe that the vulnerability has been patched. New tickets going forward should not contain the information. Please follow up with us if you believe that the patch does not resolve this issue.

Neal
Security
Facebook

The researcher confirmed that the bug was patched and did not expect a bounty, assuming the reports would be merged. Neal replied:

Text
Hi Zahid,

Awesome, thanks for confirming! We will be in touch about bounty information in the next few days.

Thanks,

Neal
Security
Facebook

The researcher was awarded again for the same bug with the changed behaviour.

From the original on medium.com

Root cause

The original fix addressed the display of the self-identified uid in the Support Dashboard, but the server-side logic that composes the follow-up email still included the uid of the phone number's account. The leak therefore survived in a second code path. The report shows that on a first submission with a given email the uid is absent, and on a repeat submission with the same email it is present. Facebook's triage noted that the issue shared a root cause with report #314709118. The disclosure violated the Friends Only setting rather than merely confirming that the number had an account.

Impact

An attacker who knows a victim's phone number can recover the specific Facebook user ID linked to it, even when the account restricts phone-number lookups to Friends Only. That breaks the privacy boundary the programme rules describe: the attacker learns not just that the number has an account, but which account it is. The condition is that the target account registered a phone number and that the recovery form is available for it. The disclosure requires two passes through the recovery flow with the same email address, because the first pass no longer leaks the uid. The report does not describe any further use of the recovered uid.

Fix

Facebook patched the issue. According to Neal's message, new tickets going forward should not contain the information, and the researcher confirmed the patch. The report does not describe the code change itself.

Variants to test

  • Repeat submissions with the same identifier. Run an account recovery or support flow twice with the same email address and compare the outputs. A positive result is the uid appearing only on the second pass.
  • Compare every output channel. Check the dashboard, the confirmation page, and the emails sent after submission. A positive result is a field present in one channel but not another, which suggests the fix covered only the visible one.
  • Check privacy settings against the disclosure. Set the account's lookup-by-phone setting to Friends Only and run the flow as a non-friend. A positive result is the specific user ID being returned, which is the case the programme rules say may be rewarded.
  • Vary the identifier type. A positive result is the same uid disclosure through the email-based path.
  • Watch for state carried between attempts.

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

Facebook lets you get back into an account when you have lost your password. You click a link called "Forgotten password?" and the site walks you through some steps to prove the account is yours. For accounts that were registered with a phone number, one of those steps is a form for people who "No longer have access to these", meaning they no longer have the phone number or email that was on the account. You type a new email address twice, fill in a form, and press Submit. Facebook then opens a page called the Support Dashboard and also sends you an email.

This report is about a privacy leak in that flow. Facebook has a setting that lets you choose who can find your account using your phone number. One option is "Friends Only", which means only your friends should be able to look you up that way. The researcher found that by entering someone's phone number, an attacker could learn the specific user ID of the account that phone number belongs to, even when the owner had restricted lookups to friends.

A user ID (often shortened to uid) is the internal number Facebook uses to identify one particular account. It is not the same as a phone number or an email address: it points at exactly one account. Knowing that a phone number has some Facebook account is one thing; knowing which account, by its uid, is more sensitive, and Facebook's bug bounty rules treat the two very differently.

Facebook fixed the bug and paid the researcher 1500 USD. Later the researcher tested the same form again and found the leak was only partly fixed: the uid no longer appeared on the Support Dashboard, but the server still sent it in the follow-up email if the same email address was used in a second attempt. Facebook patched that too, and paid the researcher again for the changed behaviour.

The rules that frame the bug

The write-up opens by quoting Facebook's own bug bounty programme rules, because those rules decide whether this kind of finding counts. A bug bounty programme is a scheme where a company pays independent researchers for reporting security problems responsibly instead of exploiting them. The rules say, in the researcher's quotation:

  • Findings that only show whether an email address or phone number is tied to a Facebook account are not eligible, whether the endpoint returns only confirmed items or both confirmed and unconfirmed. Without the user ID, this is considered extremely low risk.
  • Findings that let an attacker work out which specific user ID an email address or phone number is linked to may be rewarded, but only if this happens in violation of the account's privacy settings about who can look the user up via that email or phone number.

An endpoint, in this context, is simply a particular address on Facebook's servers that the website talks to when you use a feature. Think of it as a service counter: you hand over some information, and it hands something back. The rules are saying that a counter which only answers "yes, this number has an account" is not interesting enough to reward, but a counter that answers "this number belongs to account number 12345" is, provided the account owner had asked not to be found that way.

The bug in this report falls into the second category. It revealed the specific user ID behind a phone number even when the account's "Who can look you up using the phone number you provided?" setting was set to Friends Only.

Setting up

The researcher tested the Facebook account recovery form. That form was only available for users who had registered their Facebook ID with phone numbers, so the precondition is a target account that has a phone number linked and has restricted phone-number lookups to Friends Only. No special tooling is described: the work was done through the normal web flow and the emails Facebook sends in response. In other words, everything here can be done in an ordinary browser, with access to the email inbox you type into the form.

Finding it

The researcher was testing the account recovery form and noticed that the Support Dashboard it opens exposed the self-identified user ID (uid) of the account that owns the phone number entered. "Self-identified" here means the account identifies itself: the dashboard shows the uid of the account the phone number belongs to, as part of the recovery process.

That is exactly the disclosure the programme rules single out: not merely "this number has an account", but the specific user ID, and it happened despite the account's privacy setting restricting lookups by phone number to friends. The privacy setting is the account owner's instruction to Facebook about who may find them, and the disclosure happened despite it.

Exploitation

First attempt: uid in the Support Dashboard

The researcher's reproduction steps, exactly as written:

  1. Go to Forgotten password?
  2. Type a phone number where facebook id is linked.
  3. Now click "No longer have access to these"
  4. type your new email twice
  5. fill up form with fake information and "Submit"
  6. Support Dashboard will open where self-identified uid is visible for the attacker.

Why each step matters:

  1. "Forgotten password?" is the entry point to the recovery flow. It is the normal link any user would click when locked out, so an attacker does not need anything unusual to reach it.
  2. The phone number is the identifier being tested. The attacker types the victim's number here, not their own.
  3. "No longer have access to these" is the branch for people who cannot receive the code or email on file. Choosing it moves the flow away from proving ownership through the original contact details and towards the form-based path.
  4. Typing a new email address twice is the flow's way of making sure the address is spelled correctly. The attacker types a new email address twice, as the form requires.
  5. Filling the form with fake information and pressing Submit is the key step. The attacker fills the form with fake information and presses Submit.
  6. The Support Dashboard that opens afterwards shows the self-identified uid, so the attacker learns which specific account the phone number belongs to.

The screenshots below follow the flow from the recovery form through to the dashboard.

From the original on medium.com

Facebook accepted the bug and awarded 1500 USD.

From the original on medium.com

The patch and the changed behaviour

After the fix, the researcher disclosed the bug to friends but remained curious about the form and tested it again. The uid was no longer shown in the Support Dashboard, but the same information could still be obtained with a changed behaviour: the server still sent the user ID of the specific phone number by email if the same email address was used in a second attempt.

"The server" is the computer at Facebook that does the actual work behind the pages you see. When you press Submit, your browser sends the details to the server, and the server decides what to show on the dashboard and what to put in the email. After the first fix the dashboard no longer showed the uid, but the email still included it on a second attempt.

In the researcher's words: "Getting user id in the email in the first attempt they patched the bug but server still sending user id of that specific phone number if we do 2nd attempt with the same email".

Second attempt: uid in the email

The researcher's steps for the changed behaviour, exactly as written:

  1. Go to Forgotten password?
  2. type your new email twice
  3. Support Dashboard will open but this time self-identified UID is not visible in the support dashboard. (Because bug has been patched)
  4. Check the email but user id is not there also.
  5. Go to Forgotten password? (Again)
  6. Type same phone number.
  7. repeat same steps with same email we did it in first bug.

Steps 1 to 5 are the same as before: reach the recovery form, enter the victim's phone number, choose the "No longer have access" branch, type an email address the attacker controls, and submit with fake details.

Step 6 is the check on the dashboard. This time the uid is not shown there, which is the fix working as intended for that page.

Step 7 is the check on the email. The attacker opens the inbox for the address they typed and looks for the uid. On this first pass it is not there either, so the first attempt now behaves correctly.

Steps 8 to 10 repeat the whole flow a second time, using the same phone number and the same email address. On the second pass the email contains the uid. On the second pass, the server's email still contains the uid, so the leak survives in a different output.

The screenshots document the first pass and the email that arrives without a user ID.

From the original on medium.com

As the researcher put it: "I got reply from Facebook but in this reply i am not getting user id of that number. Now Lets do 2nd attempt."

From the original on medium.com

On the second attempt the email contains the self-identified uid, highlighted in the screenshot.

Triage correspondence

Triage is the first stage of handling a bug report: a security team member reads it, checks whether it is real and whether it is already known, and decides what happens next. The researcher reported the changed behaviour and received a reply from Reginaldo on the Facebook Security team:

Text
Hi Zahid,

Ah, I see what's happening here. Can you still reproduce this? It has the same root cause as your other report #314709118, so the fix for #314709118 should have fixed this one too. As we get a lot of submissions, we'll close this ticket while we wait for more info from you. If you do find that the issue still reproduces, please reply to this email and the ticket will re-open and we can take another look.

Thanks for your submission.

Reginaldo
Security
Facebook

This message asks the researcher to confirm the bug still happens. It also says the issue shares a root cause with an earlier report, numbered #314709118. A root cause is the underlying mistake in the code that produces a symptom; two different symptoms can come from the same mistake. The team closes the ticket for now, but says a reply will reopen it.

The researcher replied that the bug was still reproducible. Neal from Facebook Security then responded:

Text
Hi Zahid,

We have looked into this issue and believe that the vulnerability has been patched. New tickets going forward should not contain the information. Please follow up with us if you believe that the patch does not resolve this issue.

Neal
Security
Facebook

A patch is a change to the code that removes the bug. "New tickets going forward should not contain the information" means that support cases created after the fix will no longer include the uid.

The researcher confirmed that the bug was patched and did not expect a bounty, assuming the reports would be merged. Neal replied:

Text
Hi Zahid,

Awesome, thanks for confirming! We will be in touch about bounty information in the next few days.

Thanks,

Neal
Security
Facebook

The researcher was awarded again for the same bug with the changed behaviour.

From the original on medium.com

Root cause

The original fix addressed the display of the self-identified uid in the Support Dashboard, but the server-side logic that composes the follow-up email still included the uid of the phone number's account. The leak therefore survived in a second code path. A code path is one route through the program that produces an output; fixing one route does not automatically fix another that produces the same kind of output.

The report shows that on a first submission with a given email the uid is absent, and on a repeat submission with the same email it is present. Facebook's triage noted that the issue shared a root cause with report #314709118. The disclosure violated the Friends Only setting rather than merely confirming that the number had an account.

Impact

An attacker who knows a victim's phone number can recover the specific Facebook user ID linked to it, even when the account restricts phone-number lookups to Friends Only. That breaks the privacy boundary the programme rules describe: the attacker learns not just that the number has an account, but which account it is. The condition is that the target account registered a phone number and that the recovery form is available for it. The disclosure requires two passes through the recovery flow with the same email address, because the first pass no longer leaks the uid. The report does not describe any further use of the recovered uid.

Fix

Facebook patched the issue. According to Neal's message, new tickets going forward should not contain the information, and the researcher confirmed the patch. The report does not describe the code change itself.

Variants to test

These are patterns a beginner can try on other flows, using only a browser and an email inbox. Each one describes what to do and what a positive result looks like.

  • Repeat submissions with the same identifier. Run an account recovery or support flow twice with the same email address and compare the outputs. A positive result is the uid appearing only on the second pass.
  • Compare every output channel. Check the dashboard, the confirmation page, and the emails sent after submission. A positive result is a field present in one channel but not another, which suggests the fix covered only the visible one.
  • Check privacy settings against the disclosure. Set the account's lookup-by-phone setting to Friends Only and run the flow as a non-friend. A positive result is the specific user ID being returned, which is the case the programme rules say may be rewarded.
  • Vary the identifier type. A positive result is the same uid disclosure through the email-based path.
  • Watch for state carried between attempts.

Glossary

  • Bug bounty programme: a scheme where a company pays independent researchers for reporting security problems responsibly.
  • Endpoint: a particular address on a server that a website talks to when you use a feature; it takes input and returns something.
  • User ID (uid): the internal number a site uses to identify one particular account.
  • Self-identified uid: the uid of the account that the entered phone number belongs to, shown by the recovery flow itself.
  • Account recovery flow: the series of pages a site shows to help someone who has lost access to their account get back in.
  • Support Dashboard: the page Facebook opens after the recovery form is submitted, which shows details of the support case.
  • Privacy setting: an account owner's instruction to the site about who may find or see them in a particular way.
  • Friends Only: a privacy setting meaning only people accepted as friends may use that lookup.
  • Server: the computer at the company that does the work behind the pages you see and sends the emails.
  • Server-side logic: the part of the program that runs on the server, as opposed to what the browser displays.
  • Code path: one route through a program that produces an output; different routes can produce the same kind of output.
  • Root cause: the underlying mistake in the code that produces a symptom.
  • Patch: a change to the code that removes a bug.
  • Triage: the first stage of handling a bug report, where the security team checks it and decides what happens next.
  • Ticket: the record a support or security team keeps for one report or request.
  • Disclosure: revealing information that was meant to stay private.
  • Enumeration: working out whether a given email address or phone number is tied to an account.
  • Vulnerability: a weakness in a system that can be used to break its intended behaviour.
  • Bounty: the payment a company makes for a valid security report.

More by Zahid Ali

View all

6 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.