Skip to content
Info disclosure Write-up Intermediate

How I was able to find page/personal account disclosure on Instagram

When an Instagram message thread was assigned to a Facebook page admin, a WebSocket message sent to the Instagram account disclosed the ID of the assigned Facebook page admin. An attacker could also discover which Facebook page was linked to an Instagram account by sending a GET request to an Instagram API endpoint.

Ajay Gautam Follow

Published on medium.com

Bounty$2,000 View original

{{media:0}}

Ajay Gautam, 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. 4 min read.

Context

This write-up covers an information disclosure in the integration between Instagram and Facebook Pages. When an Instagram account is linked to a Facebook Page, the Page can send and receive messages with Instagram users, and Page admins can be assigned to those conversations. The feature normally lets a Page's inbox handle Instagram direct messages and lets admins share the workload of replying.

The researcher had previously written about Page admin disclosure and, encouraged by the feedback, went looking for related leaks in the Instagram/Facebook integration. The testing covered the messaging flow between an Instagram account and a linked Facebook Page, and a user info endpoint on i.instagram.com.

Setup

The setup is a Facebook Page linked to an Instagram account, with the ability to send Instagram messages from the Page inbox and to assign Page admins to a conversation. The researcher tested the same assignment feature from both sides: from Facebook and from Instagram. No specific tools or versions are named in the report.

Finding it

The researcher was testing the Facebook message feature and could not obtain the admin ID in any way from the Facebook side. Trying the same flow from Instagram produced a different result: when an Instagram message thread is assigned to a Page admin from the Facebook Page inbox, a WebSocket message is sent to the Instagram account, and that message discloses the ID of the assigned Facebook Page admin.

That asymmetry is what made it interesting. The assignment action is a normal Page inbox operation, but the notification pushed over the Instagram WebSocket carried an identifier the Instagram user should not have been able to see.

Exploitation

Step 1: send a message to the linked Instagram account

The researcher first sent a message to the Instagram ID where the Facebook Page was linked. This establishes the conversation that the Page inbox will later handle.

Step 2: assign an admin from the Page inbox

Viewing the message from the Facebook Page, the researcher could assign other admins to the conversation, as shown in the Page inbox.

Step 3: read the WebSocket response

When an admin was assigned to the conversation, the assigned admin was leaked in the Instagram WebSocket response.

This is the core of the bug: the assignment event, delivered to the Instagram client over the WebSocket, includes the Facebook Page admin's ID.

Step 4: disclose the linked Page ID

Finding which Page was linked to the Instagram account was not hard. A GET request to the user info endpoint returns the Page ID linked with the Instagram account:

In the report the endpoint is shown with a concrete user ID in the URL, https://i.instagram.com/api/v1/users/3963556405/info/, and the response discloses the Instagram account linked with the Facebook Page.

Step 5: retest after the fix

After Facebook notified the researcher that the issue had been patched, the researcher checked again. The leak of the Instagram account linked with the Facebook Page still existed via the same endpoint:

The researcher reported it again on the same support inbox. The Facebook team replied after a few days regarding the vulnerability fix. A second bounty of 2000 USD was awarded, bringing the total for the vulnerability to USD 5,500.

Root cause

The report does not describe the server-side code. What it shows is that the WebSocket notification sent to the Instagram account on admin assignment includes the Facebook Page admin's ID, and that the user info endpoint returns the Page ID linked to the Instagram account. Both are cases of the integration returning identifiers to a party that does not need them. The report does not say why the existing checks did not prevent this; The report does not say why the existing checks did not prevent this.

Impact

An Instagram user in a conversation with a linked Facebook Page could learn the ID of the Facebook Page admin assigned to the thread, and could learn the Page ID linked to an Instagram account through the user info endpoint. The researcher frames it as page/personal account disclosure.

Fix

Facebook patched the issue after the first report. The researcher then found that the leak of the Instagram account linked with the Facebook Page still worked through /api/v1/users/{id}/info/, reported it again, and the team fixed it as well.

Variants to test

  1. Assign admins to conversations from other inbox surfaces and inspect the WebSocket frames delivered to the external user for identifiers of the assigning party.
  2. Query user info endpoints for linked-account fields (Page ID, business ID, linked account ID) on other Meta products and check whether the response includes them for accounts you do not own.
  3. Re-test any endpoint after a fix notification, as the researcher did here, since a partial fix can leave one of several disclosure paths open.

Timeline

Event Date
Reported Saturday, May 2, 2020
Triaged Monday, June 8, 2020
Fixed Tuesday, June 9, 2020
Bounty awarded Thursday, June 18, 2020
Second report triaged Thursday, July 2, 2020
Second bounty awarded (2000 USD) Thursday, July 16, 2020
Image for post
Bounty Awarded From the original on medium.com

Reference

https://medium.com/@tnirmalz/facebook-bugbounty-disclosing-page-members-1178595cc520

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

What happened, in plain words

Instagram and Facebook are both run by Meta, and they are designed to work together. One of those connections lets a Facebook Page (the kind of profile a business, brand or public figure uses) be linked to an Instagram account. Once they are linked, the Page can send and receive Instagram direct messages, and the people who run the Page (its admins) can be assigned to those conversations so that several people can share the job of replying.

This write-up is about a leak in that connection. When a Page admin was assigned to an Instagram conversation, a notification was quietly pushed to the Instagram account, and that notification contained the numeric ID of the Facebook Page admin. Separately, a simple request to an Instagram address returned the ID of the Facebook Page linked to an Instagram account. Neither piece of information was meant to be visible to the ordinary Instagram user, which is why the researcher calls it page/personal account disclosure.

The researcher had written about a similar leak before (Page admin disclosure) and got good feedback, so he went looking for related problems in the Instagram/Facebook integration. He reported the first issue, Facebook fixed it, he checked again, found part of the leak still worked, reported that too, and was paid a second bounty. In total he was awarded USD 5,500.

The pieces you need to know first

Before the steps make sense, here are the basic ideas, explained from zero.

  • A Facebook Page is a public profile for a business or brand. It has admins, the people allowed to post and reply on its behalf.
  • An Instagram account is a normal personal or business profile on Instagram.
  • Linking means telling Facebook and Instagram that a particular Page and a particular Instagram account belong together, so messages can flow between them.
  • An API (Application Programming Interface) is the set of web addresses a program uses to talk to a service. Think of it as a serving hatch at a restaurant: you do not walk into the kitchen, you pass a request through the hatch and get a response back. When your browser or the Instagram app shows you something, it is usually asking an API behind the scenes.
  • A GET request is the simplest kind of API call: you ask a web address for information, the same way typing a URL into your browser does. It does not change anything on the server; it just reads.
  • A WebSocket is a two-way connection that stays open between your app and a server, so the server can push new information to you the moment something happens, without you asking again. Think of a phone call that stays connected, versus sending a letter and waiting for a reply. Chat apps use WebSockets so that new messages appear instantly.
  • An ID here is just a number that identifies something, like a customer number. It is not a password, but it can still be sensitive: it can reveal who is behind an account or a Page.
  • Information disclosure is the security term for a service handing out information that the person receiving it should not be able to see. Nothing is broken or taken over; the problem is that a secret leaks out.
  • A bounty is a reward a company pays a researcher who reports a security problem responsibly instead of abusing it.

Setting up the test

The setup is a Facebook Page linked to an Instagram account, with the ability to send Instagram messages from the Page's inbox and to assign Page admins to a conversation. The researcher tested the same assignment feature from both sides: from Facebook and from Instagram. The report does not name any specific tools or software versions.

Finding the leak

The researcher was testing the Facebook message feature. From the Facebook side, he could not obtain the admin ID in any way. Then he tried the same flow from Instagram, and the result was different.

When an Instagram message thread is assigned to a Page admin from the Facebook Page inbox, a WebSocket message is sent to the Instagram account. That message discloses the ID of the assigned Facebook Page admin.

That difference between the two sides is what made it interesting. Assigning an admin is a completely normal Page inbox action, but the notification pushed over the Instagram WebSocket carried an identifier the Instagram user should not have been able to see.

Walking through the steps

Step 1: send a message to the linked Instagram account

The researcher first sent a message to the Instagram ID where the Facebook Page was linked. This creates the conversation that the Page inbox will later handle. You need a conversation to exist before you can assign anyone to it, just as you need a ticket to exist before you can assign it to a support agent.

Step 2: assign an admin from the Page inbox

Viewing the message from the Facebook Page, the researcher could assign other admins to the conversation, as shown in the Page inbox.

The image shows assigning an admin to the Instagram message from the Facebook Page.

Step 3: read the WebSocket response

When an admin was assigned to the conversation, the assigned admin was leaked in the Instagram WebSocket response.

This is the heart of the bug. The assignment event is delivered to the Instagram client over the WebSocket, and that event includes the Facebook Page admin's ID. The Instagram user never asked for that ID; it arrived as part of a routine notification.

Step 4: find the linked Page ID

Working out which Page was linked to the Instagram account was not hard. A GET request to the user info endpoint returns the Page ID linked with the Instagram account:

Line by line:

  • GET is the method: read something, do not change anything.
  • https://i.instagram.com is Instagram's private API host, the address the app itself talks to.
  • /api/v1/users/{id}/info/ is the path. {id} is a placeholder for the Instagram user's numeric ID; you replace it with the real number.
  • HTTP/1.1 is simply the version of the web protocol being used.

In the report the endpoint is shown with a concrete user ID in the URL, https://i.instagram.com/api/v1/users/3963556405/info/, and the response discloses the Instagram account linked with the Facebook Page.

The image shows the response from that request, revealing the Instagram account linked with the Facebook Page.

Step 5: check again after the fix

Facebook notified the researcher that the issue had been patched. He did not simply take that at face value: he checked again. The leak of the Instagram account linked with the Facebook Page still existed via the same endpoint:

Line by line:

  • GET again means read-only.
  • /api/v1/users/{id}/info/ is the same user info path as before, with {id} standing for the user's numeric ID.
  • HTTP/1.1 is the protocol version.

He reported it again on the same support inbox. The Facebook team replied after a few days regarding the vulnerability fix. A second bounty of 2000 USD was awarded, bringing the total for the vulnerability to USD 5,500.

Why it happened

The report does not describe the server-side code. What it shows is two things: the WebSocket notification sent to the Instagram account on admin assignment includes the Facebook Page admin's ID, and the user info endpoint returns the Page ID linked to the Instagram account. Both are cases of the integration returning identifiers to a party that does not need them. A reasonable guess is that the responses were built from internal assignment and linking records without filtering which fields the Instagram-facing client is allowed to see, but that is not stated in the report.

What it means for users

An Instagram user in a conversation with a linked Facebook Page could learn the ID of the Facebook Page admin assigned to the thread. Through the user info endpoint, they could also learn the Page ID linked to an Instagram account. The researcher frames it as page/personal account disclosure.

The fix

Facebook patched the issue after the first report. The researcher then found that the leak of the Instagram account linked with the Facebook Page still worked through /api/v1/users/{id}/info/, reported it again, and the team fixed it as well.

Other places worth testing

  1. Assign admins to conversations from other inbox surfaces and inspect the WebSocket frames delivered to the external user for identifiers of the assigning party.
  2. Query user info endpoints for linked-account fields (Page ID, business ID, linked account ID) on other Meta products and check whether the response includes them for accounts you do not own.
  3. Re-test any endpoint after a fix notification, as the researcher did here, since a partial fix can leave one of several disclosure paths open.

Timeline

Event Date
Reported Saturday, May 2, 2020
Triaged Monday, June 8, 2020
Fixed Tuesday, June 9, 2020
Bounty awarded Thursday, June 18, 2020
Second report triaged Thursday, July 2, 2020
Second bounty awarded (2000 USD) Thursday, July 16, 2020
Image for post
Bounty Awarded From the original on medium.com

The image shows the notification that the bounty was awarded.

The image shows the total bounty awarded.

Reference

https://medium.com/@tnirmalz/facebook-bugbounty-disclosing-page-members-1178595cc520

Glossary

  • API: the set of web addresses a program uses to talk to a service, like a serving hatch between your app and the company's computers.
  • Bounty: a reward a company pays a researcher who reports a security problem responsibly.
  • Facebook Page: a public profile for a business, brand or public figure, run by admins.
  • GET request: a read-only request for information from a web address.
  • ID: a number that identifies something, such as a user or a Page.
  • Information disclosure: a security problem where a service reveals information the recipient should not be able to see.
  • Instagram account: a normal personal or business profile on Instagram.
  • Linking: connecting a Facebook Page and an Instagram account so messages can flow between them.
  • Page admin: a person allowed to post and reply on behalf of a Facebook Page.
  • Page inbox: the place inside Facebook where a Page's messages, including Instagram messages, are handled.
  • Triaged: the stage where a company's security team has reviewed a report and confirmed it is a real issue.
  • User info endpoint: the API address that returns details about a user account.
  • WebSocket: a two-way connection that stays open so the server can push new information to your app instantly, like a phone call that stays connected.
  • Write-up: a public article describing a security finding and how it was discovered.

More by Ajay Gautam

View all

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