Skip to content
Info disclosure Write-up Intermediate

How I got your phone number through Facebook

Facebook's default privacy setting allowed anyone to look up a user by phone number, and the password reset feature revealed the last two digits of a phone number. An attacker could combine these to discover a user's full phone number in small countries by brute-forcing the remaining digits.

Inti De Ceukelaire Follow

Published on medium.com

Update: someone pointed out that PayPal actually reveals the last four digits of the phone numbers, so this technique may work for large countries as well if the target has its phone linked to its PayPal account.

Inti De Ceukelaire, 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 lets users attach a phone number to their account and offers a privacy control called "Who can look you up using the phone number you provided". The researcher, Inti De Ceukelaire, found that this control, combined with Facebook's Graph Search and the "find friends" contact import, allows an attacker to recover a private phone number for a known profile. The trick is practical in small countries such as Belgium, with roughly 11.2 million people, where the number space and the set of provider prefixes are limited.

The report is a privacy issue rather than a classic vulnerability. Facebook's position, quoted in the write-up, is that when the "who can look me up by phone" setting is public, the phone number is public. The researcher disagrees with the design and published the technique after Facebook declined to fix it.

Setup

The technique needs:

  1. A target whose phone number is linked to Facebook and whose "who can look you up using the phone number you provided" setting is at its default, which the report says is public.
  2. One or more test Facebook accounts. The researcher had to switch accounts because Facebook only allows 20,000 contacts to be imported in a short timespan.
  3. A program that can generate a range of phone numbers and write them as a contact list.
  4. Access to Facebook's password reset flow, Graph Search and the "find friends" import.

Facebook applies strong rate limiting: after roughly 1000 lookups it temporarily blocks additional requests. The researcher notes that a botnet of valid accounts might get around this, but says he is sure Facebook has restrictions against that too.

Finding it

The starting observation is that a phone number entered into Graph Search returns the corresponding user. The researcher used this to verify numbers he had found, for example a Belgian celebrity's number.

Verifying a Belgian celeb’s phone number I found using my technique From the original on medium.com

Testing every possible number directly is impractical: it would take months, and the rate limiting blocks it. The problem therefore reduces to shrinking the candidate space before doing the final lookups. The researcher also noticed that the privacy settings are misleading. A phone number set to "only me" on the profile is still exposed, because the "who can look me up" setting overrules it.

This setting only indicates whether the phone number is visible on your profile. It does not indicate whether your phone number is public. From the original on medium.com
If this setting is set to ‘Everyone’, which is the default value, your phone number is considered public.

The setting only controls whether the number is visible on the profile, not whether it can be discovered. The "who can look me up" wording also implies the searcher already has the number and is looking for the profile, not the reverse. There is no "only me" option for this setting at all.

If you link your phone number to Facebook and want to lock down your privacy settings, you can not prevent your ‘friends’ will still have access From the original on medium.com

Facebook's security team replied that this was not an issue.

Not an issue, according to Facebook From the original on medium.com

Exploitation

Step 1: the last two digits

The password reset flow reveals the last two digits of the phone number on the account. The researcher used this to eliminate the final two digits before doing any searching.

Facebook reveals the last two digits of the minister our home affairs, a highly ranked politician From the original on medium.com

This step takes about a minute. The report also notes an update: PayPal reveals the last four digits of a phone number, so the technique may work for large countries as well if the target has the number linked to PayPal.

Verifying one of the phone numbers I discovered From the original on medium.com

Step 2: the provider number

A typical Belgian number is written as follows, where X is any digit from 0 to 9 and PP is the provider prefix:

Text
04PPXXXX50

With the last two digits known, fewer than 400,000 possible numbers remain. Provider prefixes map to mobile operators.

From the original on medium.com

Some prefixes are more common than others. The researcher reasoned that government workers most likely have a 047 number, because Proximus is the state-sponsored provider.

He wrote a program to generate a contact list of every possible number for a given prefix, for example 0479. Generating the 10,000 possible numbers took less than a second.

It took less than a second to generate a list with all 10,000 possible numbers From the original on medium.com

The list was then imported through the "find friends" functionality and the suggested friends were checked.

There were a couple of “Jan”’s in the list, but my target was not. Don’t mind the ‘500’ number — more contacts were in imported. From the original on medium.com

There were several people named Jan in the suggestions, but not the target. The 0478 prefix was also unsuccessful. At this point the researcher switched accounts, because Facebook only allows 20,000 contacts to be imported in a short timespan. On a second test account, 0477 worked: "third time lucky".

0477 it is! From the original on medium.com

So the provider prefix is now known:

Text
0477XXXX50

There is a list of 10,000 numbers, one of which is the minister's.

Step 3: narrowing down

The remaining work is simple arithmetic. With 10,000 candidates, testing half of them narrows the pool to a handful. For example, testing the range:

Text
0477 0000 50 — 0477 5000 50
Still bingo! From the original on medium.com

The target was present in this range, so the fifth digit is 0, 1, 2, 3 or 4, leaving 5000 candidates. Halving again, the next test covers:

Text
0477 0000 50 – 0477 2500 50
No results found From the original on medium.com

No result in the 0000 to 2500 range, so the number lies in 2500 to 5000. The pool is halved repeatedly: 2500, 1250, 750, 325, 162, 81 and finally 40 numbers. The researcher notes that splitting further to 20, 10 and 5 is possible, but with fewer than 50 numbers left it is just as easy to test each one individually in Graph Search.

Step 4: the final countdown

With 40 candidates left, each one is entered in the search bar until the target profile appears. This takes about a minute.

Testing all numbers left manually until I got the right one. From the original on medium.com

Root cause

The design flaw is that the "who can look you up using the phone number you provided" setting defaults to public and has no "only me" option. The profile visibility setting for the phone number ("only me") does not override it, so users who believe their number is private are still discoverable. The report frames this as a usability and privacy problem: the settings are vague and mislead users into thinking the number is protected.

Two Facebook features make the enumeration practical: the password reset flow discloses the last two digits, and the "find friends" import accepts large contact lists, which turns a brute-force search into a small number of bulk checks. The rate limiting on Graph Search lookups (roughly 1000 before a temporary block) does not stop the import-based narrowing, and the 20,000 contact import limit only forces the attacker to switch accounts.

Impact

Anyone in a small country who has added a phone number and left the default setting can have that number recovered by someone who knows their profile. The researcher demonstrated this against Belgian celebrities and politicians, including the minister of home affairs. The report says it is hard to give an exact list of affected countries, but the technique should work where the number has 10 digits and the list of provider prefixes is limited.

In his testings it took 30 to 60 minutes to crack most numbers, though the time depends on the number space, prerequisites and luck. The researcher informed the minister, who said he did not know Facebook was leaking his number but did not personally mind as long as there was no abuse. In cooperation with a local radio station, another Belgian celebrity was called on air; he removed his phone number from Facebook immediately afterwards.

Fix

The report states that Facebook decided not to fix the issue. The researcher's suggestions are:

  1. Inform users, since most do not know the default behaviour.
  2. Add an "only me" option for the "who can look me up" setting.
  3. Hide the two digits revealed in a password reset request when the user does not frequently log in from that particular computer.
  4. Limit the number of friends that can be imported further; the researcher sees no reason anyone would import 10,000 numbers at once.

Variants to test

  1. Other small countries with short provider prefix lists. Generate the full candidate range for a known prefix, import it through "find friends" and check whether the target appears in the suggestions. A positive result is the target profile in the suggested friends list.
  2. Password reset digit disclosure. Request a password reset for a target account and check whether the response reveals trailing digits of the phone number. A positive result is any partial number shown before authentication.
  3. PayPal last-four disclosure. If the target has a phone number linked to PayPal, check whether PayPal reveals the last four digits. A positive result is a partial number that reduces the candidate space enough for the import technique to work in a larger country.
  4. Import limits across accounts. Test how many contacts can be imported per account in a short timespan and whether switching accounts resets the limit. A positive result is a fresh import allowance on a second account, as the researcher observed.
  5. Graph Search rate limiting. Measure how many phone number lookups trigger the temporary block (the report says roughly 1000). A positive result is a block after a predictable number of lookups, confirming the limit that makes bulk import necessary.

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. 10 min read.

What happened, in plain words

Facebook lets you add your phone number to your account. It also gives you a privacy setting called "Who can look you up using the phone number you provided". Inti De Ceukelaire found that this setting, together with two ordinary Facebook features (the search box and the "find friends" contact import), lets someone work out a private phone number for a person whose profile they already know.

The trick is practical in small countries such as Belgium, which has roughly 11.2 million people, because there are only so many phone numbers and only so many ways a Belgian mobile number can start.

This is a privacy problem rather than a classic break-in. Facebook's position, quoted in the write-up, is that when the "who can look me up by phone" setting is public, the phone number is public. The researcher disagrees with that design and published the technique after Facebook declined to fix it.

A quick word on the main ideas before we start, because the rest of the article leans on them:

  • Graph Search is Facebook's search box that answers questions about people, for example by typing a name, a workplace or a phone number. Think of it as a library catalogue: you give it a detail and it tells you which book (profile) matches.
  • "Find friends" contact import is the feature that lets you upload your phone's address book so Facebook can suggest which of your contacts already have accounts. Think of it as handing the librarian a list of names and asking which ones are already members.
  • Password reset is the "forgot my password" flow. You type an identifier (an email address or a phone number) and Facebook tells you whether an account exists and, in this case, shows part of the number back to you.
  • Rate limiting is a cap a website puts on how many requests you can make in a short time, like a shop that only lets you try on a few items before asking you to come back later.

Setup

The technique needs a few things in place:

  1. A target whose phone number is linked to Facebook and whose "Who can look you up using the phone number you provided" setting is at its default, which the report says is public.
  2. One or more test Facebook accounts. The researcher had to switch accounts because Facebook only allows 20,000 contacts to be imported in a short timespan.
  3. A program that can generate a range of phone numbers and write them out as a contact list.
  4. Access to Facebook's password reset flow, Graph Search and the "find friends" import.

Facebook applies strong rate limiting: after roughly 1000 lookups it temporarily blocks additional requests. The researcher notes that a botnet of valid accounts might get around this, but says he is sure Facebook has restrictions against that too. A botnet here just means many accounts controlled together, like a crowd of people each asking one question so no single person looks suspicious.

Finding it

The starting observation is simple: a phone number typed into Graph Search returns the corresponding user. The researcher used this to confirm numbers he had already found, for example a Belgian celebrity's number.

Verifying a Belgian celeb’s phone number I found using my technique From the original on medium.com

Testing every possible number directly is impractical. It would take months, and the rate limiting blocks it long before you finish. So the real problem is not "how do I guess a number" but "how do I shrink the list of candidates before I start looking them up".

The researcher also noticed that the privacy settings are misleading. A phone number set to "only me" on the profile is still exposed, because the "who can look me up" setting overrules it.

This setting only indicates whether the phone number is visible on your profile. It does not indicate whether your phone number is public. From the original on medium.com
If this setting is set to ‘Everyone’, which is the default value, your phone number is considered public.

The setting only controls whether the number is visible on the profile, not whether it can be discovered. The "who can look me up" wording also implies the searcher already has the number and is looking for the profile, not the reverse. There is no "only me" option for this setting at all.

If you link your phone number to Facebook and want to lock down your privacy settings, you can not prevent your ‘friends’ will still have access From the original on medium.com

Facebook's security team replied that this was not an issue.

Not an issue, according to Facebook From the original on medium.com

Exploitation

Step 1: the last two digits

The password reset flow reveals the last two digits of the phone number on the account. The researcher used this to eliminate the final two digits before doing any searching. Why bother? Because every digit you already know removes a factor of ten from the pile of numbers you still have to try.

Facebook reveals the last two digits of the minister our home affairs, a highly ranked politician From the original on medium.com

This step takes about a minute. The report also notes an update: PayPal reveals the last four digits of a phone number, so the technique may work for large countries as well if the target has the number linked to PayPal.

Verifying one of the phone numbers I discovered From the original on medium.com

Step 2: the provider number

A typical Belgian number is written as follows, where X is any digit from 0 to 9 and PP is the provider prefix:

Text
04PPXXXX50

Line by line: 04 is how Belgian mobile numbers begin, PP is the provider number, XXXX are four unknown digits, and 50 are the last two digits from the password reset step. With the last two digits known, fewer than 400,000 possible numbers remain. Provider prefixes map to mobile operators.

From the original on medium.com

Some prefixes are more common than others. The researcher reasoned that government workers most likely have a 047 number, because Proximus is the state-sponsored provider. That is a guess based on who tends to buy which operator, and it is the kind of shortcut that saves time.

He wrote a program to generate a contact list of every possible number for a given prefix, for example 0479. Generating the 10,000 possible numbers took less than a second.

It took less than a second to generate a list with all 10,000 possible numbers From the original on medium.com

The list was then imported through the "find friends" functionality and the suggested friends were checked. The idea is that if the target's number is in the list you uploaded, Facebook will suggest the target's profile back to you, because Facebook thinks the target is one of your contacts.

There were a couple of “Jan”’s in the list, but my target was not. Don’t mind the ‘500’ number — more contacts were in imported. From the original on medium.com

There were several people named Jan in the suggestions, but not the target. The 0478 prefix was also unsuccessful. At this point the researcher switched accounts, because Facebook only allows 20,000 contacts to be imported in a short timespan. On a second test account, 0477 worked: "third time lucky".

0477 it is! From the original on medium.com

So the provider prefix is now known:

Text
0477XXXX50

Line by line: 0477 is the confirmed operator prefix, XXXX are the four digits still unknown, and 50 are the last two digits from step 1. There is a list of 10,000 numbers, one of which is the minister's.

Step 3: narrowing down

The remaining work is simple arithmetic. With 10,000 candidates, testing half of them narrows the pool to a handful. For example, testing the range:

Text
0477 0000 50 — 0477 5000 50

Line by line: this is a block of numbers from 0477 0000 50 up to 0477 5000 50. You upload that block as a contact list and see whether the target shows up in the suggestions. If the target appears, the answer is inside the block; if not, it is outside. This is the same idea as guessing a number between 1 and 100 by asking "is it above 50?" instead of trying every number in turn.

Still bingo! From the original on medium.com

The target was present in this range, so the fifth digit is 0, 1, 2, 3 or 4, leaving 5000 candidates. Halving again, the next test covers:

Text
0477 0000 50 – 0477 2500 50

Line by line: this block runs from 0477 0000 50 to 0477 2500 50, the lower half of the previous block. Uploading it tells you whether the target sits in the lower half or the upper half.

No results found From the original on medium.com

No result in the 0000 to 2500 range, so the number lies in 2500 to 5000. The pool is halved repeatedly: 2500, 1250, 750, 325, 162, 81 and finally 40 numbers. The researcher notes that splitting further to 20, 10 and 5 is possible, but with fewer than 50 numbers left it is just as easy to test each one individually in Graph Search.

Step 4: the final countdown

With 40 candidates left, each one is entered in the search bar until the target profile appears. This takes about a minute.

Testing all numbers left manually until I got the right one. From the original on medium.com

Root cause

The design flaw is that the "who can look you up using the phone number you provided" setting defaults to public and has no "only me" option. The profile visibility setting for the phone number ("only me") does not override it, so users who believe their number is private are still discoverable. The report frames this as a usability and privacy problem: the settings are vague and mislead users into thinking the number is protected.

Two Facebook features make the enumeration practical: the password reset flow discloses the last two digits, and the "find friends" import accepts large contact lists, which turns a brute-force search into a small number of bulk checks. The rate limiting on Graph Search lookups (roughly 1000 before a temporary block) does not stop the import-based narrowing, and the 20,000 contact import limit only forces the attacker to switch accounts.

Impact

Anyone in a small country who has added a phone number and left the default setting can have that number recovered by someone who knows their profile. The researcher demonstrated this against Belgian celebrities and politicians, including the minister of home affairs. The report says it is hard to give an exact list of affected countries, but the technique should work where the number has 10 digits and the list of provider prefixes is limited.

In his testings it took 30 to 60 minutes to crack most numbers, though the time depends on the number space, prerequisites and luck. The researcher informed the minister, who said he did not know Facebook was leaking his number but did not personally mind as long as there was no abuse. In cooperation with a local radio station, another Belgian celebrity was called on air; he removed his phone number from Facebook immediately afterwards.

Fix

The report states that Facebook decided not to fix the issue. The researcher's suggestions are:

  1. Inform users, since most do not know the default behaviour.
  2. Add an "only me" option for the "who can look me up" setting.
  3. Hide the two digits revealed in a password reset request when the user does not frequently log in from that particular computer.
  4. Limit the number of friends that can be imported further; the researcher sees no reason anyone would import 10,000 numbers at once.

Variants to test

  1. Other small countries with short provider prefix lists. Generate the full candidate range for a known prefix, import it through "find friends" and check whether the target appears in the suggestions. A positive result is the target profile in the suggested friends list.
  2. Password reset digit disclosure. Request a password reset for a target account and check whether the response reveals trailing digits of the phone number. A positive result is any partial number shown before authentication.
  3. PayPal last-four disclosure. If the target has a phone number linked to PayPal, check whether PayPal reveals the last four digits. A positive result is a partial number that reduces the candidate space enough for the import technique to work in a larger country.
  4. Import limits across accounts. Test how many contacts can be imported per account in a short timespan and whether switching accounts resets the limit. A positive result is a fresh import allowance on a second account, as the researcher observed.
  5. Graph Search rate limiting. Measure how many phone number lookups trigger the temporary block (the report says roughly 1000). A positive result is a block after a predictable number of lookups, confirming the limit that makes bulk import necessary.

Glossary

  • Graph Search: Facebook's search feature that finds people and other objects from details you type, such as a name or a phone number.
  • "Find friends" contact import: a Facebook feature that accepts an uploaded address book and suggests which of those contacts already have accounts.
  • Password reset flow: the "forgot my password" process, which confirms whether an account exists for a given email address or phone number.
  • Rate limiting: a cap on how many requests a site accepts from one source in a period of time, after which further requests are temporarily blocked.
  • Botnet: a collection of many machines or accounts controlled together to spread activity across many sources.
  • Provider prefix: the leading digits of a phone number that identify the mobile operator.
  • Brute force: trying every possible value until one works.
  • Enumeration: systematically listing or testing candidates to discover which one is valid.
  • Privacy setting: a control that decides who can see or find a piece of information on an account.
  • Default setting: the value a setting has before the user changes it.
  • Two-factor authentication: a login method that requires a second proof, often a code sent to your phone, in addition to your password.
  • Bug bounty program: a scheme where a company pays researchers for reporting security or privacy problems.
  • Hall of Fame: a public list where a company credits researchers who reported valid issues.

More by Inti De Ceukelaire

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.