Skip to content
Access control Write-up Intermediate

View the ranked messenger users for any page

A GraphQL endpoint in Creator Studio let any user retrieve the ranked list of messenger users for any page, without checking admin rights. An attacker could see which of their friends had messaged a given page, and for pages with messaging disabled the list could reveal page admins.

Philippe Harewood Follow

Published on philippeharewood.com

In Creator Studio there is a new feature to rank messenger users. This isn’t scoped to admins so a user can see which of their friends messaged any page.

Philippe, on philippeharewood.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.

The original is short, so this covers everything it reports, then explains this kind of bug in general: how it works, how to test for it and how it is fixed. The general sections are about the bug class, not this target. Written with AI and checked against the original; the original is the record. 5 min read.

What the report shows

Creator Studio gained a feature that ranks Messenger users for a page. The researcher, Philippe Harewood, found that the ranking was not restricted to page admins: an ordinary user could query it and see which of their own friends had messaged any given page.

The request he documented is a GraphQL call that takes a page ID as a variable:

Text
graphql?doc_id=3204638226276173&variables={pageID:113702895386410}

By changing the pageID value, a user can ask for the ranked list of Messenger users for a page they do not administer. The report does not describe how the response is filtered.

The report also notes a second consequence. When a page admin has disabled messaging on the page, the only users who remain on the ranked list are those with admin roles, because they are the ones who can still test messaging on the page. That turns the same endpoint into a page admin disclosure. The report adds a caveat: the admin in question must have messaged the page for this to work.

Impact, as the report states it: an attacker can see which of their friends have messaged a particular page.

Timeline:

Date Event
Nov 16, 2019 Report sent
Nov 19, 2019 Confirmation of submission by Facebook
Nov 27, 2019 Confirmation of patch by Facebook
Dec 5, 2019 Bounty awarded by Facebook

The report does not give a severity rating or a bounty amount.

Root cause

The ranking feature was built for page admins, but the resolver behind it appears to have returned data for any authenticated caller who supplied a page ID, rather than verifying that the caller holds an admin role on that page.

The admin-disclosure variant follows from the same gap: the list is derived from who has messaged the page, and on a page with messaging disabled that population is effectively the admin set.

Impact

Within the report's own framing, the exposure is a privacy leak: a user learns which of their friends have interacted with a given page. That can reveal which friends have interacted with a given page.

The secondary effect is more sensitive. On pages where messaging is disabled, the same query can reveal which accounts hold admin roles, because those are the only users left on the list. The report is explicit that this only holds when the admin has messaged the page.

How this kind of bug works

This is a broken object-level or function-level authorisation flaw in a GraphQL API. GraphQL exposes a single endpoint with a schema of fields, and each field resolves independently. Authorisation is therefore not enforced by routing or by the URL, as it often is in REST; it has to be implemented inside each resolver or in a shared layer that every resolver calls. When a new field is added for an admin-facing feature, it is easy to ship the resolver without the role check that the UI implies.

The client sends a doc_id and a set of variables rather than a full query document, so the operation is identified by an opaque identifier.

The defences are straightforward: enforce authorisation in the resolver or a middleware that cannot be bypassed, check object ownership against the authenticated identity rather than trusting an ID in the request, and treat persisted-query identifiers as public so that every operation behind them is independently authorised.

How to test for it

  1. Map the GraphQL surface. Look for persisted-query endpoints that carry a document identifier plus variables, and collect identifiers from client JavaScript, mobile app traffic and error messages.
  2. Establish two accounts: one privileged on a target object (a page, group, organisation or tenant) and one ordinary account with no role on it.
  3. As the privileged account, exercise the feature so that data exists, then capture the exact operation and variables.
  4. Replay the same operation with the ordinary account's session, keeping the object identifier unchanged. A positive result is a response containing the privileged object's data rather than an authorisation error or an empty result.
  5. Vary the object identifier to objects the test account has no relationship with, to distinguish a missing role check from a missing ownership check.
  6. Test the negative-space cases: objects where the feature is disabled, where the only remaining data subjects are privileged users, or where the list is empty for legitimate reasons.

Common false positives: the endpoint returns data that is already public; the response is filtered to the caller's own relationships, which may be intended; the operation succeeds but returns an empty list because of server-side filtering rather than because of authorisation; or the test account actually holds a role you did not notice. Confirm by comparing responses across two accounts with clearly different privileges.

How it could be fixed

Add an authorisation check to the resolver or a shared middleware: verify that the authenticated caller holds the required role on the page identified by the variable before returning any data. Do not rely on the client only invoking the operation from an admin UI. Where the feature is inherently admin-only, gate the field at the schema level as well. Audit other fields added in the same release for the same omission, and add regression tests that call each privileged operation with an unprivileged session.

Hunting notes

These bugs cluster around newly shipped features, especially those added to creator or business dashboards where the UI hides the feature behind a role. Persisted GraphQL operations are a strong signal: if the client sends a document identifier and variables, the operation is a candidate for replay. Recon should collect document identifiers from web and mobile clients and note which ones take object IDs as variables.

To make the report land, show the two-account comparison explicitly: the privileged response and the unprivileged response for the same operation and the same object ID. State the privacy consequence in concrete terms, and if a secondary disclosure exists, describe the precondition honestly, as this report does with the requirement that the admin has messaged the page.

The original is short, so this covers everything it reports, then explains this kind of bug in general: how it works, how to test for it and how it is fixed. The general sections are about the bug class, not this target. Written with AI and checked against the original; the original is the record. 6 min read.

What happened, in plain words

Facebook's Creator Studio is a dashboard where people who run a page (a business, a public figure, a brand) can manage it. It gained a feature that ranks Messenger users for a page. The researcher, Philippe Harewood, found that this ranking was not restricted to page admins. An ordinary user could ask for it and see which of their own friends had messaged any given page.

The request he documented is a GraphQL call that takes a page ID as a variable:

Text
graphql?doc_id=3204638226276173&variables={pageID:113702895386410}

GraphQL is a way for a client (a browser or a mobile app) to ask a server for exactly the data it needs, through a single address. Instead of many different URLs, there is one endpoint and a set of named operations. Here the operation is identified by doc_id=3204638226276173, and the page being asked about is passed as pageID:113702895386410. By changing the pageID value, a user can ask for the ranked list of Messenger users for a page they do not administer. The report does not describe how the response is filtered.

The report also notes a second consequence. When a page admin has disabled messaging on the page, the only users who remain on the ranked list are those with admin roles, because they are the ones who can still test messaging on the page. That turns the same endpoint into a page admin disclosure, since the remaining users are those with admin roles. The report adds a caveat: the admin in question must have messaged the page for this to work.

Impact, as the report states it: an attacker can see which of their friends have messaged a particular page.

Timeline:

Date Event
Nov 16, 2019 Report sent
Nov 19, 2019 Confirmation of submission by Facebook
Nov 27, 2019 Confirmation of patch by Facebook
Dec 5, 2019 Bounty awarded by Facebook

The report does not give a severity rating or a bounty amount.

In general, how this kind of bug works

This is a broken authorisation flaw in a GraphQL API. Authorisation means checking whether the person making a request is allowed to do what they are asking. In a traditional website, each page or action often has its own address, and the server can check permissions per address. In GraphQL there is one endpoint, and each field in the schema is handled by its own function, called a resolver. Authorisation therefore has to be implemented inside each resolver, or in a shared layer that every resolver calls. When a new field is added for an admin-facing feature, it is easy to ship the resolver without the role check that the user interface implies. The UI may hide the feature behind an admin role, but hiding a button is not security: anyone who can send the request can try it.

The client sends a doc_id and a set of variables rather than a full query document, so the operation is identified by an opaque identifier. Think of it like a hotel key card: the card number is not secret, but the door should still check whether that card is allowed into that room.

The defences are straightforward: enforce authorisation in the resolver or a middleware that cannot be bypassed, check object ownership against the authenticated identity rather than trusting an ID in the request, and treat persisted-query identifiers as public so that every operation behind them is independently authorised.

How to test for it

  1. Map the GraphQL surface. Look for persisted-query endpoints that carry a document identifier plus variables, and collect identifiers from client JavaScript, mobile app traffic and error messages.
  2. Establish two accounts: one privileged on a target object (a page, group, organisation or tenant) and one ordinary account with no role on it.
  3. As the privileged account, exercise the feature so that data exists, then capture the exact operation and variables.
  4. Replay the same operation with the ordinary account's session, keeping the object identifier unchanged. A positive result is a response containing the privileged object's data rather than an authorisation error or an empty result.
  5. Vary the object identifier to objects the test account has no relationship with, to distinguish a missing role check from a missing ownership check.
  6. Test the negative-space cases: objects where the feature is disabled, where the only remaining data subjects are privileged users, or where the list is empty for legitimate reasons.

Common false positives: the endpoint returns data that is already public; the response is filtered to the caller's own relationships, which may be intended; the operation succeeds but returns an empty list because of server-side filtering rather than because of authorisation; or the test account actually holds a role you did not notice. Confirm by comparing responses across two accounts with clearly different privileges.

How it could be fixed

Add an authorisation check to the resolver or a shared middleware: verify that the authenticated caller holds the required role on the page identified by the variable before returning any data. Do not rely on the client only invoking the operation from an admin UI. Where the feature is inherently admin-only, gate the field at the schema level as well. Audit other fields added in the same release for the same omission, and add regression tests that call each privileged operation with an unprivileged session.

Hunting notes

These bugs cluster around newly shipped features, especially those added to creator or business dashboards where the UI hides the feature behind a role. Persisted GraphQL operations are a strong signal: if the client sends a document identifier and variables, the operation is a candidate for replay. Recon should collect document identifiers from web and mobile clients and note which ones take object IDs as variables.

To make the report land, show the two-account comparison explicitly: the privileged response and the unprivileged response for the same operation and the same object ID. State the privacy consequence in concrete terms, and if a secondary disclosure exists, describe the precondition honestly, as this report does with the requirement that the admin has messaged the page.

Glossary

  • GraphQL: a way for a client to ask a server for exactly the data it needs through a single endpoint, using named operations and fields.
  • Resolver: the function inside a GraphQL server that produces the data for one field.
  • Persisted query: a GraphQL operation stored on the server and identified by an opaque identifier (here doc_id) instead of sending the full query text each time.
  • Variable: a value passed alongside a GraphQL operation, such as a page ID, that the operation uses when it runs.
  • Authorisation: the check that decides whether the person making a request is allowed to do what they are asking.
  • Authentication: proving who you are, for example by logging in; authorisation happens after authentication.
  • Broken object-level authorisation: a flaw where the server does not check that the caller is allowed to access the specific object (here, a page) named in the request.
  • Broken function-level authorisation: a flaw where the server does not check that the caller is allowed to use a particular operation or feature at all.
  • Endpoint: the address on a server that receives requests, such as the GraphQL address in this report.
  • Page admin: a person with a management role on a Facebook page.
  • Disclosure: revealing information that the person was not meant to see.
  • Bounty: a payment made by a company to a researcher who reports a valid security bug.
  • Severity: a rating of how serious a bug is; this report does not give one.
  • False positive: a test result that looks like a bug but is not, because the behaviour is intended or the data is already public.

More by Philippe Harewood

View all

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

Broken access control

The lesson behind this report.

A user can do something their role should not allow: reach an admin function, act on a feature they have not paid for, or skip a permission check. IDOR is the special case where the object belongs to someone else.