Skip to content
IDOR Write-up Intermediate

Bypass Admin approval, Mute Member and Posting Permissions for Only admins

An IDOR in the GraphQL endpoint for creating a Watch Party allowed an attacker to change the group ID to a victim group, bypassing admin approval, mute status, and admin-only posting permissions. The attacker could then create a Watch Party in the victim group and invite all members.

Sarmad Hassan Follow

Published on blog.flawminers.com

The Watch Party Option is an innovative feature within Facebook groups that empowers not only Group admins but also regular members to select any public video on Facebook and present it simultaneously to other group members. This feature enhances the communal viewing experience by allowing members to collectively…

Sarmad Hassan, on blog.flawminers.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. 5 min read.

Context

Facebook groups carry a set of administrative controls that decide what members can do inside the group. Two of them matter here: post approval, where every group post must be approved by an admin or a moderator before it appears, and posting permissions, which can be restricted so that only admins may post. A third control is muting, which stops a specific member from posting in the group at all.

The feature at the centre of this write-up is Watch Party. It lets group admins and also regular members pick any public video on Facebook and present it to other group members at the same time, so the group can watch and react together. The researcher came across the idea while going through old notes, where a single line read:

  • To check "Watch Party Option"

That note led to testing the Watch Party flow inside groups, and to an Insecure Direct Object Reference (IDOR) in the graphql endpoint behind it.

Setup

The report describes two perspectives rather than a lab setup: a victim who owns a group and an attacker who is a member of that group. The victim group is configured with the following settings:

  1. Post Approval: all group posts must be approved by an admin or a moderator.
  2. Posting Permissions: only admin.
  3. The attacker account is muted through the group member options, to prevent any posts in the group.

The attacker needs an account that is a member of the victim group, and needs to be able to create a Watch Party in a group of their own so the creation request can be intercepted. No specific tooling, versions or headers are named in the report beyond the ability to intercept and modify the request.

Finding it

While testing the Watch Party functionality in Facebook groups, the researcher identified an IDOR inside the graphql endpoint. The bug allows an attacker to bypass three separate group controls:

  • Posting admin approval.
  • Muting a member.
  • Posting permissions restricted to admins.

The Watch Party creation request carries a group_id supplied by the client. In the report, changing that value to the victim group ID still produced a created session, even though the caller was muted there and only admins could post.

Exploitation

Step 1: Configure the victim group

From the victim's perspective, navigate to the group settings you own and verify the settings:

  • Posting Permissions: only admin.

These are the two controls the attack is meant to bypass.

Step 2: Mute the attacker

Still from the victim's perspective, open the group member options and mute the "Attacker" account to prevent any posts in the group. This adds the third control: the attacker should not be able to post at all.

Step 3: Create a Watch Party and intercept the request

From the attacker's perspective, go to your own group and create a Watch Party, intercepting the request. The request structure is as follows:

HTTP
POST /api/graphql/ HTTP/1.1
variables={"input":{"client_mutation_id":"2","actor_id":"userID","composer_session_id":"SESSIONID","creator_actor_id":"actorID","custom_name":null,"group_id":"AttackerGroupID","video_ids":["VIDEO-ID"]}}&doc_id=doc-id

The important parts of this request are:

  • group_id: the group the Watch Party is created in. Here it is the attacker's own group, which is the value that will be swapped.
  • actor_id and creator_actor_id: identify the acting user and the creator of the session.
  • composer_session_id: a session identifier for the composer.
  • video_ids: the public video to be shown in the Watch Party.
  • doc_id: identifies the GraphQL document (the mutation) being called.

The mutation being invoked is group_living_room_create, which returns a LivingRoomSession.

Step 4: Point the request at the victim group

Change the value of group_id from AttackerGroupID to the victim group ID and forward the request. The response will be similar to:

JSON
{
  "data": {
    "group_living_room_create": {
      "client_mutation_id": "2",
      "living_room": {
        "__typename": "LivingRoomSession",
        "id": "199255894011111"
      }
    }
  }
}

Here id (199255894011111) is the LivingRoomSession ID. The response shows a created LivingRoomSession after the group_id was changed to the victim group ID.

Step 5: Use the session in the victim group

Visit the following URL, substituting the victim group ID and the LivingRoomSession ID returned in the previous step:

Text
https://www.facebook.com/groups/[victim-group-id]/wp/[LivingRoomSession id]

Watch the video and invite all group members. This effectively bypasses all group settings established by the group admin: the muted member has created content in the group, and the post approval and admin-only posting restrictions have not been applied.

From the original on blog.flawminers.com

Root cause

The Watch Party creation mutation takes the target group_id from client-supplied input and creates the LivingRoomSession for that group. The report shows that the three group controls could be bypassed through this mutation. In other words, the authorisation check that should tie the acting user to the group named in group_id was missing or incomplete for this code path. Because the object reference (group_id) is accepted directly, this is classed as an IDOR. The report does not describe the server-side implementation, so the exact location of the missing check is not stated.

Impact

An attacker who is a member of a group can create a Watch Party inside that group regardless of the group's settings. Concretely, the attacker can bypass posting admin approval, bypass being muted, and bypass posting permissions that are restricted to admins. Once the session exists, the attacker can watch the video and invite all group members through the group URL, so the unauthorised content reaches the whole membership. The report does not state any further impact, such as what else the session could be used for.

Fix

The report records the remediation timeline rather than the code change:

Date Actor Event
03 Jun 2018 Sarmad Initial report
14 Jun 2018 Meta Bug Bounty Report triaged
27 Jun 2018 Meta Bug Bounty Fixed the first two impacts
17 Jul 2018 Meta Bug Bounty Complete fix
18 Jul 2018 Sarmad Fix confirmed
18 Jul 2018 Meta Bug Bounty Bounty awarded

The fix was applied by Meta in two stages, with the first two impacts fixed on 27 Jun 2018 and the complete fix on 17 Jul 2018, and the researcher confirmed the fix on 18 Jul 2018.

Variants to test

  1. Swap the group identifier in other group-scoped GraphQL mutations (for example, anything that creates content or sessions in a group) and see whether the response returns a created object for a group where the caller is muted or restricted. A positive result is a successful creation response for a group the caller should not be able to post in.
  2. Repeat the Watch Party creation while muted in the target group and check whether the returned LivingRoomSession ID resolves at the group URL. A positive result is a working session page under the victim group ID.
  3. Test the same mutation with a group_id for a group the attacker is not a member of, and observe whether the server rejects it. A positive result is a created session for a non-member group.
  4. Check whether the session, once created, can be used to invite members or surface content without the usual approval step. A positive result is content visible to group members without admin or moderator approval.

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

What happened, in plain words

Facebook groups are like clubs. A club has rules, and the club's organisers (admins) decide who may speak, who must have their messages checked before everyone sees them, and who is not allowed to speak at all for a while. Facebook gives group admins exactly these controls. This write-up is about a way to get around all three of them at once.

The feature involved is called Watch Party. A Watch Party is a shared viewing session: one person picks a public video on Facebook and everyone in the group watches it together at the same moment, like putting a film on in a living room while friends sit around the same screen. Facebook lets not only admins but also ordinary members start a Watch Party in a group.

The researcher found the idea in an old note that simply said:

  • To check "Watch Party Option"

That one line led to testing how a Watch Party is created, and to a flaw in the request that Facebook's website sends to its servers when a Watch Party is started. The flaw is called an Insecure Direct Object Reference, or IDOR. In plain terms: the request says which group the Watch Party is for, and in the report changing that value to another group still produced a session. It is like a hotel receptionist who hands out a room key to anyone who says a room number out loud, without checking that the person is the guest of that room.

By changing one value in that request, a member who has been muted, in a group where only admins may post and where every post needs approval, could still create a Watch Party inside that group and invite every member to it. The group's rules were never applied.

Background you need first

A few ideas come up again and again below, so here they are from zero.

The website and the server. When you use Facebook in a browser, the pages you see are drawn by your browser, but the real information lives on Facebook's servers, the computers that store the data. Your browser constantly talks to those servers: it asks for data and sends instructions. Most of what you see on screen is the result of that conversation.

Requests. Every one of those messages from your browser to a server is called a request. A request has a method (what kind of action it is), a path (which part of the service it is aimed at), sometimes a body (the details), and headers (extra information about the message). The most common method you will see here is POST, which means "here is some data, please do something with it".

APIs. An API is the set of doors a service offers to programs, including the browser, so they can ask for things and give instructions without a human clicking through pages. Think of a restaurant: the menu and the waiter are the API. You do not walk into the kitchen yourself; you order through the waiter, and the kitchen decides what to do. Facebook's website uses an API behind the scenes for almost everything you click.

GraphQL. GraphQL is a particular style of API. Instead of many separate addresses for many separate actions, there is usually one address, here /api/graphql/, and each request says which named operation it wants. That name is carried in a field called doc_id. The operation itself is called a mutation when it changes something, such as creating a Watch Party. So a GraphQL request is like a single service counter where you hand over a form: the form says which task you want done (doc_id) and carries the details for that task (variables).

IDs. An ID is a unique label for a thing: a user, a group, a video, a session. Facebook uses long numbers as IDs. When a request contains an ID, the server has to look up what that ID refers to and then decide whether the person sending the request is allowed to act on it.

Sessions and session identifiers. When you log in, the server gives your browser a way to prove who you are on every following request, so you do not have to type your password again for each click. That proof is often a session identifier, a long string that the browser sends along with requests. In the request below, composer_session_id is a session identifier used by the part of the page where you compose a post or a Watch Party. Treat any session identifier like a password: anyone who has it can act as you.

Intercepting a request. Browsers have developer tools, and there are also separate programs called proxies, that let you pause a request after your browser has built it but before it reaches the server. You can then read it, change a value, and let it continue. This is the core skill in this report: the browser fills in the request, the researcher edits one field, and the server sees the edited version.

IDOR. Insecure Direct Object Reference means the server accepts an identifier supplied by the client (your browser) and acts on it without checking that you are allowed to touch the object it names. The "object" can be a group, a document, an order, a session. The fix is always the same idea: before doing anything with the ID, the server must check the caller's permissions on that specific object.

Muting, post approval and posting permissions. These are the three group controls in play:

  • Post approval: every post in the group must be approved by an admin or a moderator before other members see it.
  • Posting permissions: the group can be set so that only admins may post.
  • Muting: a specific member is stopped from posting in the group at all.

All three are rules the server is supposed to enforce. A rule that only exists in the browser's display, and is not checked on the server, is no rule at all, because anyone can edit what their browser sends.

The finding

While testing the Watch Party feature in Facebook groups, the researcher found an IDOR in the graphql endpoint. The bug lets an attacker bypass:

  • Posting admin approval.
  • Muting a member.
  • Posting permissions restricted to admins.

The reasoning is simple once you know how the request is built. The request that creates a Watch Party contains a group_id, the ID of the group the session is for. That value comes from the browser. If the server does not check that the person sending the request is allowed to create content in the group named by group_id, then a member can put in the ID of a group where they are muted, or where only admins may post, and the server will create the session anyway.

Reproduction steps

The report describes two roles rather than a lab: a victim who owns a group, and an attacker who is a member of that group. You need an account that is a member of the victim group, and you need to be able to create a Watch Party in a group of your own so that the creation request can be intercepted and edited.

Step 1: Set up the victim group

From the victim's side, open the settings of the group you own and check two settings:

  1. Post Approval: all group posts must be approved by an admin or a moderator.
  2. Posting Permissions: only admin.

Why this step: these are two of the three controls the attack is meant to get around. Setting them first gives you a clear before-and-after: the group says "nobody but admins may post, and everything is checked", and the attack should show that a non-admin, muted member can still create something in the group.

Step 2: Mute the attacker

Still from the victim's side, open the group member options and mute the "Attacker" account, to prevent any posts in the group.

Why this step: this adds the third control. After this, the attacker should not be able to post in the group at all. If the attack works, all three rules have been defeated in one go.

Step 3: Create a Watch Party and intercept the request

Now switch to the attacker's side. Go to your own group, start creating a Watch Party, and intercept the request before it leaves your browser. The request looks like this:

HTTP
POST /api/graphql/ HTTP/1.1
variables={"input":{"client_mutation_id":"2","actor_id":"userID","composer_session_id":"SESSIONID","creator_actor_id":"actorID","custom_name":null,"group_id":"AttackerGroupID","video_ids":["VIDEO-ID"]}}&doc_id=doc-id

Line by line, in plain words:

  • POST /api/graphql/ HTTP/1.1: this is a POST request aimed at the GraphQL address /api/graphql/, using version 1.1 of the HTTP protocol. In other words: "I am sending data to the GraphQL service."
  • variables={...}: this is the data for the operation. It is a block of JSON, a text format for structured data, where each name has a value.
    • "input": the outer container holding all the details for this action.
    • "client_mutation_id":"2": a label the browser attaches to this particular change so it can match the reply to the request. It is not a security value; it is bookkeeping.
    • "actor_id":"userID": the ID of the user performing the action, here the attacker's own account.
    • "composer_session_id":"SESSIONID": the session identifier for the composer, the part of the page where the Watch Party is being set up.
    • "creator_actor_id":"actorID": the ID of the user who is the creator of the session.
    • "custom_name":null: an optional name for the session. Here it is empty (null means "no value").
    • "group_id":"AttackerGroupID": the ID of the group the Watch Party is being created in. Right now it is the attacker's own group. This is the value that will be swapped, and it is the heart of the bug.
    • "video_ids":["VIDEO-ID"]: the list of public videos to be shown in the Watch Party. The square brackets mean a list, even if it holds one item.
  • &doc_id=doc-id: the name of the GraphQL operation being called. The server uses it to know which task to run. The operation here is group_living_room_create, which creates a LivingRoomSession, Facebook's internal name for a Watch Party session.

Why this step: you cannot edit a request you cannot see. Creating the Watch Party in your own group first gives you a valid, working request, with all the fields the server expects, that you can then modify in one place.

Step 4: Point the request at the victim group

Change the value of group_id from AttackerGroupID to the victim group's ID, then forward the request. The response will be similar to:

JSON
{
  "data": {
    "group_living_room_create": {
      "client_mutation_id": "2",
      "living_room": {
        "__typename": "LivingRoomSession",
        "id": "199255894011111"
      }
    }
  }
}

What this reply says, piece by piece:

  • "data": the container for the successful result.
  • "group_living_room_create": the name of the operation that was run, matching the doc_id from the request.
  • "client_mutation_id": "2": the same bookkeeping label that was sent, echoed back so the browser can match request and reply.
  • "living_room": the object that was created, the Watch Party session.
  • "__typename": "LivingRoomSession": the type of that object, Facebook's internal name for a Watch Party session.
  • "id": "199255894011111": the ID of the newly created session. This is the LivingRoomSession ID, and it is what you need in the next step.

Why this step matters: the response shows a created session after the group_id was changed to the victim group ID. The reply is proof: a session now exists inside a group where the attacker should not have been able to create anything.

Step 5: Use the session in the victim group

Visit the following address, putting in the victim group ID and the LivingRoomSession ID returned in the previous step:

Text
https://www.facebook.com/groups/[victim-group-id]/wp/[LivingRoomSession id]

In plain words: https://www.facebook.com/groups/ is the normal address for a group, [victim-group-id] is the ID of the group the session was created in, and /wp/[LivingRoomSession id] points at the Watch Party session itself. Because the session really exists on the server, the page opens.

Watch the video and invite all group members. This gets around all the group settings the admin put in place: a muted member has created content in the group, and neither the post approval rule nor the admin-only posting rule was applied.

From the original on blog.flawminers.com

Why it worked

The Watch Party creation operation takes the target group_id from input supplied by the browser and creates the LivingRoomSession for that group. The report shows that the three group controls could be bypassed through this operation. In other words, the permission check that should tie the person making the request to the group named in group_id was missing or incomplete on this particular path. Because the identifier (group_id) is accepted directly, the flaw is classed as an IDOR. The report does not describe how the server is built, so the exact place where the check was missing is not stated.

What an attacker could do

Someone who is a member of a group can create a Watch Party inside that group regardless of the group's settings. Concretely, they can bypass posting admin approval, bypass being muted, and bypass posting permissions that are restricted to admins. Once the session exists, they can watch the video and invite all group members through the group address, so the unauthorised content reaches the whole membership. The report does not state any further impact, such as what else the session could be used for.

How it was fixed

The report records the timeline of the fix rather than the code change:

Date Actor Event
03 Jun 2018 Sarmad Initial report
14 Jun 2018 Meta Bug Bounty Report triaged
27 Jun 2018 Meta Bug Bounty Fixed the first two impacts
17 Jul 2018 Meta Bug Bounty Complete fix
18 Jul 2018 Sarmad Fix confirmed
18 Jul 2018 Meta Bug Bounty Bounty awarded

Meta fixed it in two stages: the first two impacts on 27 Jun 2018, and the complete fix on 17 Jul 2018. The researcher confirmed the fix on 18 Jul 2018.

Things worth testing next

These are variations on the same idea, useful for learning how far a missing permission check can reach:

  1. Swap the group identifier in other group-related GraphQL operations (for example, anything that creates content or sessions in a group) and see whether the reply returns a created object for a group where the caller is muted or restricted. A positive result is a successful creation reply for a group the caller should not be able to post in.
  2. Repeat the Watch Party creation while muted in the target group and check whether the returned LivingRoomSession ID opens at the group address. A positive result is a working session page under the victim group ID.
  3. Try the same operation with a group_id for a group the attacker is not a member of, and see whether the server rejects it. A positive result is a created session for a group the attacker does not belong to.
  4. Check whether the session, once created, can be used to invite members or show content without the usual approval step. A positive result is content visible to group members without admin or moderator approval.

Glossary

  • API: the set of doors a service offers to programs, including your browser, so they can ask for data and give instructions without a human clicking through pages.
  • Browser: the program you use to visit websites, such as Chrome or Firefox.
  • Client: the program making a request, usually your browser, as opposed to the server that answers it.
  • Composer: the part of a Facebook page where you write a post or set up a Watch Party.
  • Cookie: a small piece of data a website stores in your browser, often used to remember who you are between requests.
  • GraphQL: a style of API with a single address where each request names the operation it wants and carries its details.
  • Header: extra information attached to a request or reply, such as what kind of data is being sent.
  • HTTP: the language browsers and servers use to exchange requests and replies.
  • ID: a unique label for a thing, such as a user, a group, a video or a session.
  • IDOR (Insecure Direct Object Reference): a flaw where the server accepts an identifier supplied by the client and acts on it without checking that the caller is allowed to touch the object it names.
  • Intercept: to pause a request between the browser and the server so it can be read or changed before it is sent on.
  • JSON: a text format for structured data, where names are paired with values inside curly braces.
  • LivingRoomSession: Facebook's internal name for a Watch Party session, the object created by the group_living_room_create operation.
  • Method: the kind of action a request asks for, such as POST (send data and do something) or GET (fetch something).
  • Moderator: a group member given some admin powers, such as approving posts.
  • Mutation: in GraphQL, an operation that changes something, such as creating a session.
  • Muting: a group control that stops a specific member from posting in the group.
  • Operation: the named task a GraphQL request asks the server to run, identified here by doc_id.
  • Path: the part of a request that says which service or resource it is aimed at, such as /api/graphql/.
  • Post approval: a group setting where every post must be approved by an admin or a moderator before it appears.
  • Posting permissions: a group setting that decides who may post, for example only admins.
  • Proxy: a program that sits between your browser and the server, letting you see and edit requests.
  • Request: a message from your browser to a server asking for data or asking it to do something.
  • Response: the server's reply to a request.
  • Server: the computer that stores the data and enforces the rules, as opposed to your browser.
  • Session: a period of activity tied to a logged-in user, usually identified by a session identifier.
  • Session identifier: a long string that proves who you are on each request; treat it like a password.
  • Variables: in GraphQL, the block of data carrying the details for the named operation.
  • Watch Party: a Facebook feature that lets a group watch a public video together at the same time.

More by Sarmad Hassan

View all

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

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.