Make any Unit in Facebook Groups Undeletable
The server only checked the group ID when saving unit settings, not whether each unit ID belonged to that group. An attacker could add another group's unit to their own group, and by inviting that group's admin, make the unit undeletable.
Published on medium.com
{{media:0}}
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.
Context
Facebook Groups have a feature called Units, a way for a group admin to organise content inside the group. The admin can add a description to a unit and re-order the units of the group through a settings dialog. The write-up describes how a logic flaw in the endpoint that saves these unit settings let a researcher attach units belonging to groups he did not administer to his own test group, and then make those units undeletable by the real owner.
The report was published on 9 October 2018 by Sarmad Hassan (JubaBaghdad) and concerns the Meta / Facebook program. The weakness class is a broken authorisation / IDOR style logic flaw in the unit editing flow.

Setup
The researcher used a test group he administered, a Burp Suite proxy to intercept the save request, and a second group whose unit IDs he knew but on which he was not an admin. The precondition for the full impact is that the attacker can invite the admin of the victim group into his own group, which is what turns a cross-group unit reference into an undeletable unit.
Finding it
While confirming a previous bug, the researcher came across the Unit settings option in his test group. The group settings expose a More Settings option for editing units, where a description can be set and the units re-ordered.

He intercepted the save action in Burp Suite to see what the client sends. The request was:
POST /groups/learning/edit_units_dialog/submit/?dpr=1 HTTP/1.1
Host: www.facebook.com
group_id=[my-group-ID]&description=[My-Unit-Description]&unit_ids[0]=[Unit ID no.1]&unit_ids[1]=[Unit ID no.2]…etc
The body carries three things: the group_id the units belong to, a description for the unit, and an array of unit_ids identifying the units being saved. Two questions follow naturally from a request like this: can the group_id be swapped for another group's ID, and can the unit_ids be swapped for unit IDs belonging to other groups?
Exploitation
Step 1: swap the group_id
He changed group_id to another group's ID. This did not work: the server rejected the change.
Step 2: swap the unit_ids
He then changed the unit_ids values to unit IDs belonging to another group, leaving his own group_id in place. The response came back as a normal success:

Step 3: confirm the effect
Checking his test group's units, he found that a unit from the other group, a group he was not an admin of, had been added to his test group.
Step 4: invite the victim admin
Adding the unit alone was not enough to make it undeletable. The trick was to invite the admin of the other group into his test group. Once that invitation was in place, the units from the other group that had been added to his group became undeletable by their owner.
He also noted that units added this way are visible through the Group Insights option, which means they can be downloaded as well.
Root cause
The server validated the group_id in the request but did not validate that each unit_id belonged to that same group. In the researcher's words, Facebook was only checking on group_id not unit_id, so any unit could be attached to any group whose admin made the request. The researcher found that inviting the admin of the other group into his test group was the trick that made their units undeletable.
Impact
An attacker who administers a group can add units from any other group to his own group, view them through Group Insights and download them. By inviting the admin of the victim group into his group, he can also make those units undeletable by their owner. The report does not quantify how many groups or units were affected.
The report and the duplicate
He reported the bug to the Facebook Security Team on 4 August 2018, demonstrating the undeletable unit and mentioning that units from other groups had been added to his group. The team replied that they could not reproduce the undeletable part, because they did not know about the invitation trick.

Their reply stated that in their test, when the attacker adjusts the IDs of the unit, the victim's unit shows on the attacker's page, but the victim is still able to delete that unit. The researcher read this as the team treating the visibility of other groups' units in his unit tab as normal, and since he had focused on the undeletable part, he had not stressed the download path through Group Insights.
On 1 September 2018 he saw a fellow researcher, Richard Telleng, post a bug in the Facebook Bug Bounty Community group. The PoC video showed the same root bug. Telleng had submitted on 18 August, while this report had been triaged on 17 August, and Telleng received a bounty on 1 September. Telleng's report only showed how to download units from other groups using Group Insights and did not cover the undeletable impact. When the researcher raised this with the Facebook Security Team, they told him he had not mentioned downloading other group units from Group Insights, so they rewarded only the first impact, the undeletable unit.
Fix
The bug was fixed on 1 September 2018 and the fix was confirmed the same day. The report does not describe the code change.
Timeline
| Date | Event |
|---|---|
| 4 August 2018 | Initial report |
| 17 August 2018 | Report triaged |
| 1 September 2018 | Bug fixed |
| 1 September 2018 | Fix confirmed |
| 5 October 2018 | Bounty awarded |

Variants to test
- Array parameters with per-element ownership checks. Any endpoint that accepts an array of object IDs alongside a parent ID (units in a group, attachments in a post, items in a playlist) is worth testing by mixing in IDs from another account. A positive result is a success response and the foreign object appearing under the attacker's parent.
- Parent ID swap versus child ID swap. Try changing the parent ID first, then the child IDs. If the parent is rejected but the children are accepted, the ownership check is likely only on the parent.
- Membership as a deletion gate. Where deletion of an object depends on the requester's relationship to a group, test whether adding the victim to the attacker's group changes what the victim can delete. A positive result is the victim losing the ability to delete their own object.
- Insights and export paths. After attaching a foreign object, check reporting or export features for the parent. A positive result is the foreign object's data appearing in the export.
Takeaway
The researcher's own lesson: explain every impact in the report. Because the download path through Group Insights was not spelled out, only the undeletable impact was rewarded, and a later report covering the download path was treated as separate.

What happened, in plain words
Facebook Groups let an admin organise content inside a group using something called Units. A unit is a small block of content in the group, and the admin can give it a description and change the order of the units through a settings screen.
When the admin clicks save on that screen, the browser quietly sends a message to Facebook's servers telling them what to save. That kind of behind-the-scenes message is what people call an API request: the page you see is the shop window, and the request is the note the shop assistant passes to the stockroom. The researcher, Sarmad Hassan (JubaBaghdad), looked at that note and noticed it contained two kinds of identifiers: which group the units belong to, and which units are being saved.
He then tried swapping those identifiers for ones belonging to a group he did not run. Swapping the group identifier was refused. Swapping the unit identifiers was accepted, and units from a group he did not administer appeared in his own test group. He could then see and download those units through the group's reporting feature, and, with one extra trick (inviting the real owner of those units into his group), he could stop that owner from deleting them.
This kind of mistake is called a broken authorisation flaw, or IDOR (Insecure Direct Object Reference): the server checks that you are allowed to do something in general, but not that the specific object you named in the request is one you are allowed to touch. The report was published on 9 October 2018 and concerns the Meta / Facebook bug bounty program.

The pieces you need to understand first
Before the steps, a few everyday ideas that the rest of the article relies on.
- A group and its admin. A Facebook Group is a shared space; the admin is the person who manages it. Only the admin can change the group's settings.
- A unit. A block of content inside a group that the admin can describe and re-order. Each unit has its own identifier, a number that the server uses to tell units apart.
- An identifier (ID). Think of it as a coat-check ticket number. The server does not care what the unit is called; it looks up the number you hand it. If the server does not check that the ticket belongs to you, you can hand in someone else's number.
- A request and its body. When you click a button, your browser sends a request to the server. The request has a method and a path (roughly, the action and the address), and often a body, which is the data being sent, such as the group ID and the unit IDs.
- A proxy. A tool that sits between your browser and the server and lets you read and edit the traffic in both directions. The researcher used Burp Suite, a common proxy for this kind of work. It is like a post office clerk who lets you open every letter before it is delivered, and rewrite it if you like.
- A response code. The server answers each request with a number. A 200 means success. Seeing 200 where you expected an error is a strong hint that the server accepted something it should not have.
Setting up
The researcher used three things:
- A test group that he administered, so he was allowed to change its unit settings.
- Burp Suite, to intercept the save request and edit it before it reached Facebook.
- A second group whose unit IDs he knew, but on which he was not an admin. This is the victim group.
The full impact also needed one more condition: the attacker must be able to invite the admin of the victim group into his own group. That invitation is what turns a cross-group reference into an undeletable unit, as we will see.
Finding the feature
While confirming a previous bug, the researcher came across the Unit settings option in his test group. The group settings expose a More Settings option for editing units, where a description can be set and the units re-ordered.

He then intercepted the save action in Burp Suite to see exactly what the browser sends. The request was:
POST /groups/learning/edit_units_dialog/submit/?dpr=1 HTTP/1.1
Host: www.facebook.com
group_id=[my-group-ID]&description=[My-Unit-Description]&unit_ids[0]=[Unit ID no.1]&unit_ids[1]=[Unit ID no.2]…etc
Line by line, in plain words:
POST /groups/learning/edit_units_dialog/submit/?dpr=1 HTTP/1.1is the first line of the request.POSTmeans "I am sending data to be saved". The path after it is the address of the action on Facebook's server that handles saving unit settings.HTTP/1.1is the version of the web protocol being used.Host: www.facebook.comtells the server which website the request is for. One server can host many sites, so the request names the one it wants.- The blank line separates the headers (the envelope information) from the body (the actual data).
group_id=[my-group-ID]is the identifier of the group whose units are being edited. This is the parent: the group that owns the units.description=[My-Unit-Description]is the text the admin typed as the unit's description.unit_ids[0]=[Unit ID no.1]&unit_ids[1]=[Unit ID no.2]…etcis a list of unit identifiers. The[0],[1]notation is how a browser sends an array, an ordered list of values, in a form. The&separates each field from the next.
Two questions follow naturally from a request like this, and the researcher asked both:
- Can the
group_idbe swapped for another group's ID, so that my units get added to someone else's group? - Can the
unit_idsbe swapped for unit IDs belonging to other groups, so that their units get added to my group?
Trying it out
Step 1: swap the group_id
He changed group_id to another group's ID. This did not work: the server rejected the change. In other words, the server did check that the group named in the request was one he was allowed to edit. That check was doing its job.
Step 2: swap the unit_ids
He then changed the unit_ids values to unit IDs belonging to another group, leaving his own group_id in place. The response came back as a normal success:

A 200 response with no error is the server saying "done". That is the moment the researcher knew something was wrong: he had named units that did not belong to his group, and the server had not objected.
Step 3: confirm the effect
Checking his test group's units, he found that a unit from the other group, a group he was not an admin of, had been added to his test group.
So the server had taken his word for it: it looked at the group ID, saw he was allowed to edit that group, and then saved whatever unit IDs he listed, without checking that those units belonged to the same group.
Step 4: invite the victim admin
Adding the unit alone was not enough to make it undeletable. The trick was to invite the admin of the other group into his test group. Once that invitation was in place, the units from the other group that had been added to his group became undeletable by their owner.
The researcher's own summary of the trick is that inviting the admin of the other group was what made their units undeletable.
He also noted that units added this way are visible through the Group Insights option, which means they can be downloaded as well. Group Insights is the reporting screen for a group; if a foreign unit shows up there, its data can be exported along with everything else.
Why it worked
The server validated the group_id in the request but did not validate that each unit_id belonged to that same group. In the researcher's words, Facebook was only checking on group_id not unit_id, so any unit could be attached to any group whose admin made the request. The researcher found that inviting the admin of the other group into his test group was the trick that made their units undeletable.
A useful comparison: a hotel receptionist checks that you are a guest of the hotel before handing out room keys, but never checks that the room number you ask for is the one you booked.
What an attacker could do
An attacker who administers a group can add units from any other group to his own group, view them through Group Insights and download them. By inviting the admin of the victim group into his group, he can also make those units undeletable by their owner. The report does not quantify how many groups or units were affected.
Reporting it, and the duplicate
He reported the bug to the Facebook Security Team on 4 August 2018, demonstrating the undeletable unit and mentioning that units from other groups had been added to his group. The team replied that they could not reproduce the undeletable part, because they did not know about the invitation trick.

Their reply stated that in their test, when the attacker adjusts the IDs of the unit, the victim's unit shows on the attacker's page, but the victim is still able to delete that unit. The researcher read this as the team treating the visibility of other groups' units in his unit tab as normal, and since he had focused on the undeletable part, he had not stressed the download path through Group Insights.
On 1 September 2018 he saw a fellow researcher, Richard Telleng, post a bug in the Facebook Bug Bounty Community group. The PoC video showed the same root bug. Telleng had submitted on 18 August, while this report had been triaged on 17 August, and Telleng received a bounty on 1 September. Telleng's report only showed how to download units from other groups using Group Insights and did not cover the undeletable impact. When the researcher raised this with the Facebook Security Team, they told him he had not mentioned downloading other group units from Group Insights, so they rewarded only the first impact, the undeletable unit.
The fix
The bug was fixed on 1 September 2018 and the fix was confirmed the same day. The report does not describe the code change.
Timeline
| Date | Event |
|---|---|
| 4 August 2018 | Initial report |
| 17 August 2018 | Report triaged |
| 1 September 2018 | Bug fixed |
| 1 September 2018 | Fix confirmed |
| 5 October 2018 | Bounty awarded |

Similar things to test
These are patterns worth trying on other features, not claims about this report.
- Lists of IDs with a parent ID. Any request that accepts a list of object IDs alongside a parent ID (units in a group, attachments in a post, items in a playlist) is worth testing by mixing in IDs from another account. A positive result is a success response and the foreign object appearing under the attacker's parent.
- Parent ID swap versus child ID swap. Try changing the parent ID first, then the child IDs. If the parent is rejected but the children are accepted, the ownership check is likely only on the parent.
- Membership as a deletion gate. Where deletion of an object depends on the requester's relationship to a group, test whether adding the victim to the attacker's group changes what the victim can delete. A positive result is the victim losing the ability to delete their own object.
- Reporting and export screens. After attaching a foreign object, check reporting or export features for the parent. A positive result is the foreign object's data appearing in the export.
The lesson
The researcher's own lesson: explain every impact in the report. Because the download path through Group Insights was not spelled out, only the undeletable impact was rewarded, and a later report covering the download path was treated as separate.

Glossary
- API: the set of behind-the-scenes addresses and rules a website uses to send data to and from its servers, separate from the pages you see.
- Admin: the person who manages a group and can change its settings.
- Array: an ordered list of values, sent in a form as
name[0],name[1]and so on. - Broken authorisation: a flaw where the server does not properly check that you are allowed to do the specific thing you are asking for.
- Burp Suite: a proxy tool used to read and edit web traffic between a browser and a server.
- Body: the part of a request that carries the actual data being sent, after the headers.
- Bounty: a reward paid by a company for a valid security report.
- Duplicate: a report describing a bug that has already been reported by someone else.
- Group Insights: Facebook's reporting screen for a group, which shows data about the group and allows exporting it.
- Header: envelope information in a request, such as the host name, sent before the body.
- HTTP: the protocol browsers and servers use to exchange requests and responses.
- IDOR (Insecure Direct Object Reference): a flaw where a request names an object by its identifier and the server does not check that the requester is allowed to access that object.
- Identifier (ID): a number or string the server uses to tell one object apart from another.
- Parent and child: in a request, the parent is the container (here, the group) and the children are the objects inside it (here, the units).
- POST: an HTTP method meaning "I am sending data to be saved".
- Proxy: a tool or service that sits between your browser and the server and can read or change the traffic.
- Request: the message your browser sends to a server when you do something on a page.
- Response code: the number a server returns to say how a request went; 200 means success.
- Root cause: the underlying mistake that makes a bug possible.
- Triaged: the stage where a security team has reviewed a report and accepted it as valid for further work.
- Unit: a block of content inside a Facebook Group that an admin can describe and re-order.
- Vulnerability class: a category of bug, such as broken authorisation or IDOR.