Skip to content
IDOR Write-up Beginner

Group expert's pending expertise request leaking

A GraphQL query used by group admins to view pending expertise badge requests did not check that the caller administered the group being queried. By swapping the group ID, anyone could read the names of group experts and the details of their pending requests for any public group.

DF Follow

Published on hopesamples.blogspot.com

September 06, 2022

DF, on hopesamples.blogspot.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. 3 min read.

Context

Facebook groups have a role called group expert. A group expert can attach expertise to their badge, and to do so they send an expertise request to the group admin for approval. These requests are meant to be visible only to group admins, under the "Badge requests" option in the admin dashboard. The admin has the authority to approve or reject each request submitted by a group expert.

The report describes an IDOR in the GraphQL endpoint that backs that admin view. By changing the group ID in the request, anyone could read the pending expertise requests of any public group, including the names of the group experts and the details of their requests.

Setup

The researcher worked against the Facebook web application at www.facebook.com. The only precondition described is access to a group admin's dashboard, where the "Badge Requests" view is available and its request can be intercepted. The report does not name any interception proxy or other tooling.

Finding it

The pending expertise requests are fetched by a GraphQL call whose variables include the group ID. Changing that ID returned the experts' names and request details for another group. The report does not describe how the request was first identified beyond intercepting it from the admin dashboard.

Exploitation

Step 1: Capture the request from the admin dashboard

Go to the group admin's dashboard, click "Badge Requests" and intercept the request. The captured request is:

HTTP
POST /api/graphql/ HTTP/2

Host: www.facebook.com

fb_api_req_friendly_name=GroupsCometExpertiseBadgeRequestsRootQuery&variables={"groupID":"SampleID","scale":1}&server_timestamps=true&doc_id=5418595031540088

The important parts are the friendly name GroupsCometExpertiseBadgeRequestsRootQuery, which identifies the operation, and the variables parameter, which carries groupID (shown here as SampleID) and scale. The doc_id identifies the persisted GraphQL document on Facebook's side.

Step 2: Change the group ID and resend

Change the groupID parameter to the victim's group ID and send the request.

Step 3: Read the response

When changing the group ID, the group experts' names and their pending expertise request details are exposed in the response. The report does not reproduce the response body.

Root cause

The group ID is taken from client-supplied GraphQL variables and used to look up the pending expertise requests, and the response is returned without verifying that the caller is an admin of that group. The server returned the data for a group the caller did not administer. This is likely an object-level authorisation failure: the endpoint authenticates the caller but does not check the caller's relationship to the requested group object.

Impact

An attacker could see the pending expertise requests of any public group, including the names of the group experts who submitted them and the details of those requests. The data exposed is limited to what the "Badge requests" view shows to a group admin.

Fix

Variants to test

  1. Other GraphQL operations that take a group ID in their variables: substitute a group ID the test account does not administer and check whether the response contains data belonging to that group.
  2. The same GroupsCometExpertiseBadgeRequestsRootQuery operation against groups of different privacy settings, to see whether the check, if any, depends on group visibility.
  3. Other admin-only dashboard views that fetch data by object ID: capture the request, swap the object ID for one owned by another account, and look for the victim's data in the response.
  4. The same operation with a groupID for a group the test account has left or been removed from, to check whether membership state is enforced separately from admin state.

Timeline

Event Date
Reported 12-07-2022
Triaged 18-07-2022
Write-up published September 06, 2022

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.

What happened, in plain words

Facebook groups have a special role called a group expert. A group expert can add an expertise badge to their profile, but to do that they must send an expertise request to the group admin. The admin then approves or rejects it. These requests are supposed to be private: only the group admin should see them, in a section of the admin dashboard called Badge requests.

The researcher found that the web page which loads those requests asks Facebook's servers for them using a small piece of data called the group ID. By changing that ID to another group's ID, anyone could see the pending expertise requests of any public group, including the names of the experts and the details of their requests. This kind of bug is called an IDOR (Insecure Direct Object Reference): the server takes an identifier supplied by the user and returns the object it points to without checking that the user is allowed to see it.

Background: the pieces involved

Before walking through the steps, here are the basic ideas you need.

  • API: An API (Application Programming Interface) is a way for one piece of software to talk to another. Think of it as a waiter in a restaurant: you (the browser) tell the waiter (the API) what you want, and the waiter brings it from the kitchen (the server). You do not go into the kitchen yourself.
  • GraphQL: A style of API where the client sends a request describing exactly what data it wants, and the server returns just that. Facebook uses a GraphQL endpoint at /api/graphql/.
  • Request and response: When your browser asks a server for something, that is a request. The server's answer is the response.
  • HTTP request line and headers: The first line of a request says the method (like POST) and the path (like /api/graphql/). Lines below it, such as Host:, are headers, which carry extra information.
  • Parameter: A named value sent with a request. In the request below, variables is a parameter whose value is a JSON object containing groupID and scale.
  • JSON: A text format for structured data, using curly braces and key-value pairs, like {"groupID":"SampleID","scale":1}.
  • Group ID: A unique number (or string) that identifies a particular Facebook group. Every group has one.
  • Intercept: To capture a request that your browser sends, so you can look at it and change it before it reaches the server. This is normally done with a tool called a proxy; the report does not name the tool used.
  • IDOR (Insecure Direct Object Reference): A vulnerability where an application uses an identifier supplied by the user (like a group ID) to look up an object, but does not check that the user is allowed to access that object. If you can change the ID and see someone else's data, it is an IDOR.
  • Authorisation: The process of checking whether a user is allowed to do something. Authentication is checking who the user is; authorisation is checking what they may do.

The setup

The researcher worked against the Facebook website at www.facebook.com. The only precondition mentioned is that you need access to a group admin's dashboard, where the "Badge Requests" view is available, so that you can capture the request it makes. The report does not say which interception tool was used.

Finding the problem

The pending expertise requests are loaded by a GraphQL call whose variables include the group ID. Changing that ID returned the experts' names and request details for another group.

Exploitation

Step 1: Capture the request from the admin dashboard

  1. Go to the group admin's dashboard.
  2. Click "Badge Requests".
  3. Intercept the request that the page sends.

The captured request looks like this:

HTTP
POST /api/graphql/ HTTP/2

Host: www.facebook.com

fb_api_req_friendly_name=GroupsCometExpertiseBadgeRequestsRootQuery&variables={"groupID":"SampleID","scale":1}&server_timestamps=true&doc_id=5418595031540088

Line by line:

  • POST /api/graphql/ HTTP/2: This is the request line. POST is the method (sending data to the server), /api/graphql/ is the path of the GraphQL endpoint, and HTTP/2 is the version of the protocol.
  • Host: www.facebook.com: This header tells the server which website the request is for.
  • The long line starting with fb_api_req_friendly_name= is the body of the request (or query string, depending on how it is sent). It contains several parameters separated by &:
    • fb_api_req_friendly_name=GroupsCometExpertiseBadgeRequestsRootQuery: a human-readable name for the operation, so Facebook's engineers can tell what it does.
    • variables={"groupID":"SampleID","scale":1}: the variables for the GraphQL operation. groupID is the ID of the group whose requests are being fetched; here it is a placeholder, SampleID.
    • doc_id=5418595031540088: an identifier for the stored GraphQL query on Facebook's side. Facebook uses persisted queries: the full query text is stored on the server, and the client only sends this ID.

The important parts for the attack are the operation name and the groupID variable.

Step 2: Change the group ID and resend

Change the groupID parameter to the victim's group ID and send the request.

Why do this? Because the server should check that the person making the request is an admin of the group identified by groupID. If it does not, it will return the pending requests for whatever group ID you supply.

Step 3: Read the response

When you change the group ID, the response exposes the group experts' names and the details of their pending expertise requests. The report does not reproduce the response body.

Why it worked (root cause)

The group ID comes from the client in the GraphQL variables and is used to look up the pending expertise requests. The response is returned without verifying that the caller is an admin of that group. The server returned the data for a group the caller did not administer. This is likely an object-level authorisation failure: the endpoint checks who you are (authentication) but not your relationship to the requested group object (authorisation).

Impact

An attacker could see the pending expertise requests of any public group, including the names of the group experts who submitted them and the details of those requests. The data exposed is limited to what the "Badge requests" view shows to a group admin.

Fix

Variants to test

  1. Other GraphQL operations that take a group ID in their variables: substitute a group ID the test account does not administer and check whether the response contains data belonging to that group.
  2. The same GroupsCometExpertiseBadgeRequestsRootQuery operation against groups of different privacy settings, to see whether the check, if any, depends on group visibility.
  3. Other admin-only dashboard views that fetch data by object ID: capture the request, swap the object ID for one owned by another account, and look for the victim's data in the response.
  4. The same operation with a groupID for a group the test account has left or been removed from, to check whether membership state is enforced separately from admin state.

Timeline

Event Date
Reported 12-07-2022
Triaged 18-07-2022
Write-up published September 06, 2022

Glossary

  • API: A way for software to talk to other software, like a waiter taking your order to the kitchen.
  • Authentication: Checking who a user is.
  • Authorisation: Checking what a user is allowed to do.
  • Badge requests: The section of a Facebook group admin dashboard where expertise requests are approved or rejected.
  • Client: The software making a request, usually your browser.
  • Cookie: A small piece of data stored by your browser and sent with requests to identify you. (Not used in this report, but common in web security.)
  • doc_id: An identifier for a stored GraphQL query on Facebook's servers.
  • Endpoint: A specific URL where an API can be reached, like /api/graphql/.
  • GraphQL: A query language for APIs where the client specifies exactly what data it wants.
  • Group expert: A Facebook group member who can add an expertise badge to their profile.
  • Group ID: A unique identifier for a Facebook group.
  • Header: Extra information sent with an HTTP request or response, like Host:.
  • HTTP: The protocol used to transfer web pages and API requests.
  • IDOR (Insecure Direct Object Reference): A vulnerability where an application uses an identifier supplied by the user to access an object without checking permission.
  • Intercept: To capture a request so you can inspect or modify it before it reaches the server.
  • JSON: A text format for structured data using key-value pairs.
  • Persisted query: A GraphQL query stored on the server, referenced by an ID instead of being sent in full each time.
  • POST: An HTTP method used to send data to a server.
  • Proxy: A tool that sits between your browser and the server, allowing you to intercept and modify requests.
  • Request: A message from a client to a server asking for something.
  • Response: The server's answer to a request.
  • Root cause: The underlying reason a vulnerability exists.
  • Server: The computer that stores data and responds to requests.
  • Token: A piece of data used to authenticate a user or request.
  • Triaged: The stage where a security team has reviewed a report and confirmed it is valid.
  • Variables: In GraphQL, values supplied separately from the query text, like groupID.

More by DF

View all

1 more disclosed report, 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.

Insecure direct object reference (IDOR)

The lesson behind this report.

One user can read or change another user's data, usually by changing an identifier the server trusts without checking who is asking. One of the most paid bug classes on web programs.