Skip to content
Info disclosure Write-up Intermediate

Facebook Bug Bounty: Email Id, Phone Number Can be exposed Through Business Manager

A Business Manager admin could add a friend to a page role and then query a Graph API endpoint to retrieve that friend's primary email or phone number, even if the friend's privacy setting was 'only me'. The attacker could also add non-friends, who would receive an invitation to accept, and then obtain their contact details.

Rohit Kumar Follow

Published on medium.com

Bounty$3,000 View original

{{media:0}}

Rohit kumar, 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 Business Manager lets a business own and administer Pages, and the Page roles tab lets a Page admin add other people to roles on that Page. The Graph API exposes Page data through a request that includes a page_user_with_leads_access field, which is meant to describe the people attached to the Page and their roles. The researcher found that this field also returned the primary email address and phone number of the people listed, regardless of their own privacy settings.

The report was filed on 30 May as Whitehat Report #786259078237254, with the vulnerability type given as Privacy / Authorization and the product area as Facebook Web. It was disclosed on 3 October 2018 and paid a bounty of $3000.

Rohit kumar
Rohit kumar From the original on medium.com
Image for post
Image for post
Image for post
Money $$$$ 👊

Money $$$$ 👊

Setup

The researcher tested with his own account and a friend's account, with consent and approvals. The preconditions are:

  1. A Facebook Page.
  2. A Business Manager account.
  3. A Page ID, a Business Manager account ID, and an access token taken from the Business Manager panel.
  4. A victim who is either on the attacker's friend list, or who will accept a Page role invitation.

Finding it

The researcher noticed that the Graph API response for a Page, requested with a Business Manager token, included the page_user_with_leads_access field. That field returned the primary email address and phone number of the users attached to the Page. The same values are normally masked when Facebook shows them as a hint in the password reset flow, for example:

Text
We send a Otp on this Id fa*****@gmail.com or +9195*******3

The masked characters are the point: the API was returning the unmasked values behind them. The researcher also noted that the values were returned even when the victim's privacy setting was "only me", and that the setting (only me, friends or public) made no difference.

Exploitation

Step 1: build the request

The endpoint used was:

HTTP
https://graph.facebook.com/v2.10/(PAGE-ID-HERE)?access_token=(TOKEN-FROM-YOUR-BUSINESS-MANAGER)&__business_id=(BUSINESS-ID-HERE)&_reqName=object%3Apage&fields="id","name","global_brand_page_name","page_user_with_leads_access","category","link","locations.fields(id).limit(1)","is_published","is_verified","userpermissions.fields(user,business,business_persona,role)","business","picture.type(square)","global_brand_root_id"]&locale=en_GB&method=get&pretty=1&suppress_http_code=1

The path selects the Page by ID. access_token is the token taken from the Business Manager panel, __business_id is the Business Manager account ID, and _reqName=object%3Apage marks the request as a Page object lookup. The fields list is what asks for page_user_with_leads_access alongside the other Page attributes, and method=get makes it a read.

Step 2: fill in the three parameters

The researcher modified three values in the URL:

  1. [PAGE-ID-HERE]: the attacker's own Facebook Page ID.
  2. [TOKEN-FROM-YOUR-BUSINESS-MANAGER]: the token of the attacker's account, taken from the Business Manager panel.
  3. [BUSINESS-ID-HERE]: the attacker's Business account ID.

Step 3: add the victim to the Page roles

In the Page roles tab of the Page, the attacker adds a victim from the friend list. The researcher states that the victim is added without any approval button; the victim only receives a notification that they were added. If the victim is not on the friend list, the attacker adds them through the same tab; in that case the victim receives an invitation notification and must accept it before the attacker can see the email address and phone number.

Step 4: read the response

With the parameters filled in, visiting the endpoint returns the email address and phone number of the victim. This works even when the victim's privacy is set to "only me".

Step 5: the removed-admin case

The researcher reported a second observation: after a partner admin removed him from the Page admin roles, he could still retrieve the email address and phone number of the people in admin roles on that Page using his Business account access token. He tried this against other pages and it did not work there, and he was unsure whether the difference was token expiry. He noted that after being removed from the admin role he used a new, fresh access token from the Business Manager account and could still see the email addresses and phone numbers.

Step 6: automation

The researcher wrote a custom script that added multiple people to the admin roles one by one and extracted each person's primary email address and phone number as they were added. He stated that this made it easy to gather many private email addresses from his 3,000 friend list, and that after collecting the information the script could remove everyone again. He also stated that when the victim is removed from the Page roles, the notification the victim received is deleted as well, so the victim has no clue what happened.

Or watch on YouTube
From the original on medium.com

Root cause

The page_user_with_leads_access field on the Page object returned the primary email address and phone number of the users attached to the Page. The privacy setting on those values was not applied to this field, so a value set to "only me" was still returned to a Business Manager admin who had the Page and the token. The researcher's suggested mitigation was to remove the primary email address and phone number from the page_user_with_leads_access field.

A second design issue, in the researcher's view, was that adding a friend to a Page role did not require the friend's approval. Facebook's position was that this is expected: adding someone on your friends list does not require an approval on the Page role request. The researcher argued that a consent screen or approval button should exist, because without one the victim gets only a notification that they were added, and that notification disappears when they are removed.

Impact

A Business Manager admin who is also a Page admin could expose the primary email address or phone number of any user on their friend list, regardless of that user's privacy settings, by adding them to the Page roles and reading the API response. For users who are not friends, the attacker could add them through the Page roles tab, but the victim had to accept the invitation first. The researcher noted that the exposed values match the hints shown in the password reset flow, which could help an attacker identify which primary email address and phone number an account uses, and that the addresses could be used for spoofing or phishing. He also argued that the lack of an approval step and the deletion of the notification on removal meant the collection could happen without the victim noticing.

Facebook's assessment was that the attacker needs to be an admin of both a business account and a Page, and that the victim needs to approve the role invite, which it described as a pretty high bar for entry and not something that can be exploited at scale. The researcher disputed the approval step, and Facebook later stated that adding someone on your friends list does not require approval. In the bounty decision, Facebook described the issue as something that could have let a malicious Business Manager admin expose the primary email address or phone number of any friend regardless of their email privacy settings, and possibly non-friends if the victim approved the attacker's invite request.

Fix

Facebook confirmed on 16 June that the vulnerability had been patched, and the researcher confirmed that no email addresses or phone numbers were shown afterwards. The report does not describe the code change. The researcher's proposed mitigation was to remove the primary email address and phone number from the page_user_with_leads_access field. He also asked for an approval button or consent screen when a user is added to a Page role; Facebook replied that adding someone on your friends list not requiring approval on the Page role request is expected.

Variants to test

  1. Request other Page object fields that describe users, such as the userpermissions subfields, and check whether any of them return contact details. A positive result is an email address or phone number appearing where only an ID, name or role is expected.
  2. Repeat the request with a token from a Business Manager account that has been removed from the Page admin role, and with a freshly issued token, to see whether access survives removal. A positive result is contact details still being returned after removal.
  3. Test the same field on other object types that list users, such as business or ad account objects, and compare what each returns. A positive result is the same unmasked contact data appearing on an object where the user has no expectation of it.
  4. Add a test account with privacy set to "only me" for both email address and phone number, then read the field. A positive result is the value being returned unmasked despite the setting.
  5. Check whether adding a non-friend to a role returns contact details before the invitation is accepted. A positive result is data being returned before any acceptance step.

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

What happened, in plain words

Facebook lets a business own and run Pages. A Page is the public profile a company, band or brand uses on Facebook. To share the work of running a Page, an admin can open a tab called Page roles and add other people to roles on that Page, for example as an editor or another admin.

Behind the scenes, Facebook's website talks to Facebook's servers through something called the Graph API. An API is a way for one piece of software to ask another piece of software for information, a bit like a waiter taking your order to the kitchen and bringing back a plate. You send a request with a web address, and the server sends back an answer, usually in a structured format that a program can read.

One of the things the Graph API can return about a Page is a field called page_user_with_leads_access. A field is simply one named piece of information inside the answer, like one column in a spreadsheet row. This field is meant to describe the people attached to the Page and what roles they have.

The researcher found that this field also handed back the primary email address and phone number of the people listed, no matter what privacy setting those people had chosen for themselves. A privacy setting is the control each person has over who can see a piece of their profile, for example "only me", "friends" or "public".

The report was filed on 30 May as Whitehat Report #786259078237254. The vulnerability type was given as Privacy / Authorization, and the product area as Facebook Web. It was disclosed on 3 October 2018 and paid a bounty of $3000. A bounty is a reward a company pays to someone who reports a security problem to it responsibly.

Rohit kumar
Rohit kumar From the original on medium.com
Image for post
Image for post
Image for post
Money $$$$ 👊

Money $$$$ 👊

Setup

The researcher tested with his own account and a friend's account, with consent and approvals. Before any of this works, a few things have to be in place:

  1. A Facebook Page.
  2. A Business Manager account. Business Manager is Facebook's tool for businesses to manage their Pages, people and advertising in one place.
  3. A Page ID, a Business Manager account ID, and an access token taken from the Business Manager panel. An ID is just a unique number that identifies something, like a customer number. A token is a short string of characters that proves who you are when you make a request, similar to a wristband at an event: show it and you are let in, without having to prove your identity again every time.
  4. A victim who is either on the attacker's friend list, or who will accept a Page role invitation.

Finding it

The researcher noticed that when the Graph API answered a request about a Page, made with a Business Manager token, the answer included the page_user_with_leads_access field. That field returned the primary email address and phone number of the users attached to the Page.

Normally Facebook hides most of those characters when it shows them as a hint in the password reset flow. The password reset flow is what happens when you click "forgot password": Facebook shows you a partly hidden version of your email or phone so you can recognise your own account without anyone else learning the full value. The hint looked like this:

Text
We send a Otp on this Id fa*****@gmail.com or +9195*******3

Here is what that line means, piece by piece:

  • We send a Otp on this Id is Facebook telling you it will send a one-time password, a short code you use once to prove it is you, to the contact below.
  • fa*****@gmail.com is an email address with the middle characters replaced by asterisks, so you can see it starts with "fa" and ends with "@gmail.com" but not the rest.
  • +9195*******3 is a phone number in the same style, with the middle digits hidden.

The masked characters are the point: the API was returning the unmasked values behind them. The researcher also noted that the values were returned even when the victim's privacy setting was "only me", and that the setting (only me, friends or public) made no difference.

Exploitation

Step 1: build the request

The endpoint used was:

HTTP
https://graph.facebook.com/v2.10/(PAGE-ID-HERE)?access_token=(TOKEN-FROM-YOUR-BUSINESS-MANAGER)&__business_id=(BUSINESS-ID-HERE)&_reqName=object%3Apage&fields="id","name","global_brand_page_name","page_user_with_leads_access","category","link","locations.fields(id).limit(1)","is_published","is_verified","userpermissions.fields(user,business,business_persona,role)","business","picture.type(square)","global_brand_root_id"]&locale=en_GB&method=get&pretty=1&suppress_http_code=1

An endpoint is the specific web address you send a request to, the way a particular counter in a post office handles a particular kind of form. Reading the address from left to right:

  • https://graph.facebook.com/v2.10/ is the server and the version of the API being used.
  • (PAGE-ID-HERE) is where the Page's unique number goes. It sits in the path, which is the part of the address that points at the specific thing you want.
  • access_token=(TOKEN-FROM-YOUR-BUSINESS-MANAGER) is the token taken from the Business Manager panel. It is the wristband that proves who is asking.
  • __business_id=(BUSINESS-ID-HERE) is the Business Manager account ID, telling the server which business the request belongs to.
  • _reqName=object%3Apage marks the request as a Page object lookup. The %3A is just the colon character written in an encoded form, because some characters cannot appear literally in a web address.
  • fields= followed by a long list in quotes is what asks for page_user_with_leads_access alongside the other Page attributes. Each quoted name is one field the requester wants back, such as id, name, category and link.
  • method=get makes it a read. A GET request is the kind a browser makes when you simply open a page: you are asking to see something, not to change it.
  • locale=en_GB, pretty=1 and suppress_http_code=1 are formatting and language options for the answer.

Step 2: fill in the three parameters

The researcher modified three values in the URL. A parameter is one of the named values in a web address, the part after a = sign, like a box on a form you fill in.

  1. [PAGE-ID-HERE]: the attacker's own Facebook Page ID.
  2. [TOKEN-FROM-YOUR-BUSINESS-MANAGER]: the token of the attacker's account, taken from the Business Manager panel.
  3. [BUSINESS-ID-HERE]: the attacker's Business account ID.

Each of these is something the attacker already owns, which is why the step is easy: no guessing or breaking in is needed to prepare the request.

Step 3: add the victim to the Page roles

In the Page roles tab of the Page, the attacker adds a victim from the friend list. The researcher states that the victim is added without any approval button; the victim only receives a notification that they were added. If the victim is not on the friend list, the attacker adds them through the same tab; in that case the victim receives an invitation notification and must accept it before the attacker can see the email address and phone number.

This step is what puts the victim's account into the list that the field describes. Without it, there is nobody new for the API to report on.

Step 4: read the response

With the parameters filled in, visiting the endpoint returns the email address and phone number of the victim. This works even when the victim's privacy is set to "only me".

Visiting the address is enough because it is a GET request: the browser sends it and shows the answer, just as it would show any other page.

Step 5: the removed-admin case

The researcher reported a second observation: after a partner admin removed him from the Page admin roles, he could still retrieve the email address and phone number of the people in admin roles on that Page using his Business account access token. He tried this against other pages and it did not work there, and he was unsure whether the difference was token expiry. Token expiry means a token stops working after a set time, like a day pass that is no longer valid the next morning. He noted that after being removed from the admin role he used a new, fresh access token from the Business Manager account and could still see the email addresses and phone numbers.

Step 6: automation

The researcher wrote a custom script that added multiple people to the admin roles one by one and extracted each person's primary email address and phone number as they were added. A script is a small program that repeats a set of actions automatically, so a task that would take hours by hand takes seconds. He stated that this made it easy to gather many private email addresses from his 3,000 friend list, and that after collecting the information the script could remove everyone again. He also stated that when the victim is removed from the Page roles, the notification the victim received is deleted as well, so the victim has no clue what happened.

Or watch on YouTube
From the original on medium.com

Root cause

The page_user_with_leads_access field on the Page object returned the primary email address and phone number of the users attached to the Page. The privacy setting on those values was not applied to this field, so a value set to "only me" was still returned to a Business Manager admin who had the Page and the token. The researcher's suggested mitigation was to remove the primary email address and phone number from the page_user_with_leads_access field. A mitigation is a change that closes the hole, as opposed to a full redesign.

A second design issue, in the researcher's view, was that adding a friend to a Page role did not require the friend's approval. Facebook's position was that this is expected: adding someone on your friends list does not require an approval on the Page role request. The researcher argued that a consent screen or approval button should exist, because without one the victim gets only a notification that they were added, and that notification disappears when they are removed. A consent screen is a page that asks you to agree before something happens to your account.

Impact

A Business Manager admin who is also a Page admin could expose the primary email address or phone number of any user on their friend list, regardless of that user's privacy settings, by adding them to the Page roles and reading the API response. For users who are not friends, the attacker could add them through the Page roles tab, but the victim had to accept the invitation first.

The researcher noted that the exposed values match the hints shown in the password reset flow, which could help an attacker identify which primary email address and phone number an account uses, and that the addresses could be used for spoofing or phishing. Spoofing means pretending to be someone else, for example sending mail that looks like it comes from the victim. Phishing means sending a message designed to trick someone into handing over a password or other secret. He also argued that the lack of an approval step and the deletion of the notification on removal meant the collection could happen without the victim noticing.

Facebook's assessment was that the attacker needs to be an admin of both a business account and a Page, and that the victim needs to approve the role invite, which it described as a pretty high bar for entry and not something that can be exploited at scale. The researcher disputed the approval step, and Facebook later stated that adding someone on your friends list does not require approval. In the bounty decision, Facebook described the issue as something that could have let a malicious Business Manager admin expose the primary email address or phone number of any friend regardless of their email privacy settings, and possibly non-friends if the victim approved the attacker's invite request.

Fix

Facebook confirmed on 16 June that the vulnerability had been patched, and the researcher confirmed that no email addresses or phone numbers were shown afterwards. The report does not describe the code change. The researcher's proposed mitigation was to remove the primary email address and phone number from the page_user_with_leads_access field. He also asked for an approval button or consent screen when a user is added to a Page role; Facebook replied that adding someone on your friends list not requiring approval on the Page role request is expected.

Variants to test

These are follow-up checks in the same spirit, useful for anyone learning how to look for similar problems:

  1. Request other Page object fields that describe users, such as the userpermissions subfields, and check whether any of them return contact details. A positive result is an email address or phone number appearing where only an ID, name or role is expected.
  2. Repeat the request with a token from a Business Manager account that has been removed from the Page admin role, and with a freshly issued token, to see whether access survives removal. A positive result is contact details still being returned after removal.
  3. Test the same field on other object types that list users, such as business or ad account objects, and compare what each returns. A positive result is the same unmasked contact data appearing on an object where the user has no expectation of it.
  4. Add a test account with privacy set to "only me" for both email address and phone number, then read the field. A positive result is the value being returned unmasked despite the setting.
  5. Check whether adding a non-friend to a role returns contact details before the invitation is accepted. A positive result is data being returned before any acceptance step.

Glossary

  • API: a way for one piece of software to ask another for information, like a waiter carrying your order to the kitchen and bringing back the plate.
  • Access token: a short string of characters that proves who you are when making a request, like a wristband that lets you in without showing ID again.
  • Bounty: a reward a company pays to someone who reports a security problem responsibly.
  • Business Manager: Facebook's tool for businesses to manage their Pages, people and advertising in one place.
  • Consent screen: a page that asks you to agree before something happens to your account.
  • Endpoint: the specific web address a request is sent to, like a particular counter in a post office.
  • Field: one named piece of information inside an API answer, like one column in a spreadsheet row.
  • GET request: a request that only asks to see something, not to change it, the kind a browser makes when you open a page.
  • Graph API: Facebook's interface that lets software ask its servers for information.
  • ID: a unique number that identifies something, like a customer number.
  • Mitigation: a change that closes a security hole, as opposed to a full redesign.
  • Page: the public profile a company, band or brand uses on Facebook.
  • Page roles: the tab where a Page admin adds other people to roles such as editor or admin.
  • Parameter: one of the named values in a web address, the part after an = sign, like a box on a form.
  • Password reset flow: what happens when you click "forgot password", including the partly hidden hint of your email or phone.
  • Phishing: sending a message designed to trick someone into handing over a password or other secret.
  • Privacy setting: the control each person has over who can see a piece of their profile, such as "only me", "friends" or "public".
  • Script: a small program that repeats a set of actions automatically.
  • Spoofing: pretending to be someone else, for example sending mail that looks like it comes from the victim.
  • Token expiry: the point at which a token stops working after a set time, like a day pass that is no longer valid the next morning.
  • Vulnerability: a weakness in software that lets someone do something the software was not meant to allow.

More by Rohit Kumar

View all

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