Skip to content
IDOR Write-up Intermediate

Persistent Distorted Posts Issue and Unremovable Content in Facebook Group

An IDOR in the 'post_id' parameter when adding a post to a group unit allowed an attacker to include any post from another group into their own unit. This could distort text-only posts to show 'Attachment not available' and make posts undeletable by adding a title, if the post owner was invited to the attacker's group.

Sarmad Hassan Follow

Published on blog.flawminers.com

Facebook recently added a new group type option called “Social Learning”. Groups classified in this way gain access to the new “Units feature”, which allows you to leverage the group as a platform for online course content or to simply organize your posts by topic. for more details see…

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 introduced a new group type called "Social Learning". Groups set to this type gain access to a feature called "Units", which lets the group act as a platform for online course content or simply organise posts by topic. The feature is documented by Facebook at https://www.facebook.com/help/184985882229224.

When a group post is added to a unit, the browser sends a POST request to an endpoint under /groups/learning/. That request carries the group identifier and the identifier of the post being added, alongside the unit's name, description and post title. The finding is that the post identifier in that request is not validated against the group it is supposed to belong to.

Setup

The researcher needed two things to test this:

  1. A Facebook group that he owned, switched to the "Social learning" group type.
  2. Membership in at least one other group containing posts by other users.

For the second impact variant, the attacker also needs to be able to invite the owner of the target post to his own group. The report notes that only an invitation is required.

Burp Suite was used to intercept and modify the request. No version numbers are given in the report.

Finding it

While testing the Units feature, the researcher looked at the POST request that fires when a group post is added to a new unit. The interesting parameter is post_id. Facebook did not validate the value of post_id, so an attacker could supply the identifier of any post from a different group and have it pulled into a unit inside a group the attacker owns.

That is a classic Insecure Direct Object Reference: the server trusts a client-supplied object identifier without checking that the caller has any relationship to that object. The report describes two consequences of the missing check:

  1. A post whose content is text only is rendered as "Attachment not available", distorting it.
  2. A title can be placed on the attacker's unit above posts belonging to other users, which both distorts the original content and makes it undeletable. This second variant requires the attacker to invite the owner of the post to the attacker's group.

Exploitation

Step 1: switch the attacker's group to Social learning

Navigate to the group owned by the attacker, open Edit group settings, then Group type, and select Social learning.

Step 2: create a unit from a post

Make any post in the attacker-owned group, click the three dots, choose Add to new Unit, fill in the requirements, intercept the request with Burp Suite, and create the unit.

Step 3: inspect the request

The intercepted request looks like this:

HTTP
POST /groups/learning/create_with_post/?group_id=[Attacker_Group_ID]&post_id=[Attacker_Post_ID]&dpr=1 HTTP/1.1

jazoest=[number]&fb_dtsg=[anti_csrft]&unit name=bla&unit description=bla&post title=bla

The query string carries three parameters:

  • group_id: the identifier of the attacker's own group, which is legitimate here.
  • post_id: the identifier of the post being added to the unit. This is the parameter that is not validated.
  • dpr: a display-related parameter sent by the browser.

The body carries jazoest and fb_dtsg, Facebook's anti-CSRF values, plus the unit name, unit description and post title fields.

Step 4: swap in a foreign post ID

Go to any group where the attacker is a member, then choose the target depending on the desired effect:

  • To distort a post, find posts with "Text only".
  • To add a title to the unit on the post and make it undeletable, invite the owner of that post to the attacker's group (only invite).

Obtain the post ID, replace post_id in the Step 3 request with it, and forward the request.

Step 5: observe the victim's side

Once the attacker performs the attack, the owner of the post is unable to delete their post. The group admin is also unable to delete the attacked post, regardless of their administrative privileges.

From the original on blog.flawminers.com

Root cause

The server accepted a client-supplied post_id without validating it, so a post from another group could be attached to a unit. The report does not describe the server-side code, so the exact check that was missing is not stated; the observable behaviour is that the value of post_id was trusted.

Impact

An attacker who owns a Social learning group and is a member of another group can pull any post from that other group into a unit in his own group. The effects described in the report are:

  • Text-only posts are rendered as "Attachment not available", distorting the original content.
  • With an invitation to the post owner, a title can be placed on the attacker's unit above posts from other users, distorting the content and making it undeletable by either the post owner or the group admin, whatever their privileges.

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

Fix

Facebook fixed the bug.

Variants to test

  1. Other object-reference parameters on the same endpoint. Try swapping any identifier in the request (group, post, unit) for one belonging to another account. A positive result is the server accepting the foreign identifier and the object appearing in your own context.
  2. Same feature, different actions. Look at other requests the Units feature makes, such as editing or removing a unit, and try foreign identifiers there. A positive result is a change to an object you do not own.
  3. Cross-tenant identifiers in bulk operations. Where an endpoint accepts a list of IDs, submit IDs from another tenant. A positive result is any of them being processed.
  4. Invitation-gated effects. Where an effect only appears after some relationship exists (as with the invitation here), test whether the relationship check is enforced on the server or only in the UI. A positive result is the effect occurring without the relationship being genuinely established.

Timeline

Date Actor Event
18 Jun 2018 Sarmad Initial report
20 Jun 2018 Meta Bug Bounty Report triaged
31 Jul 2018 Meta Bug Bounty Bug fixed
31 Jul 2018 Sarmad Fix confirmed
02 Aug 2018 Meta Bug Bounty Bounty awarded

A note on prior discovery

After reporting the bug, the researcher recalled having seen information about an undeletable post issue on Facebook. A search led him to a YouTube video demonstrating the same bug from a different endpoint. He contacted the original researcher, Richard Telleng, to check whether it had been fixed. Telleng said the bug had been fixed and that Facebook had already rewarded him a bounty for it. The researcher then shared the full story with the Facebook Security Team. The report credits Telleng for his honesty and support.

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

What happened, in plain words

Facebook lets people create groups, and groups come in different types. One of those types is called "Social Learning". When a group is set to that type, it gets a feature called "Units", which lets the group act like a small online classroom: you can organise posts into topics or course sections. Facebook documents the feature at https://www.facebook.com/help/184985882229224.

When you add a post to a unit, your browser sends a message to Facebook's servers asking them to do it. That message includes a number that identifies the post. The researcher found that Facebook did not check whether that number really belonged to the group you were working in. You could put in the number of a post from a completely different group, and Facebook would happily pull that post into your unit.

This kind of mistake has a name: Insecure Direct Object Reference, or IDOR. The server trusts a number that the browser hands it, without checking whether the person sending the request is allowed to touch the thing that number points to. The report describes two things an attacker could do with this:

  1. A post that contains only text gets shown as "Attachment not available", which distorts what the original author wrote.
  2. A title can be placed on the attacker's unit above posts belonging to other people, which distorts the content and makes it impossible to delete. This second one needs the attacker to invite the post's owner to the attacker's group.

Below I walk through the setup, the exact request, each step of the attack, what the victim sees, why it worked, and what should have been checked.

Background you need first

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

A request and a response. When you click something on a website, your browser sends a request to a server (a computer somewhere that holds the website's data), and the server sends back a response. Think of it like posting a form to a office: you fill in the form, post it, and wait for a reply.

HTTP and POST. HTTP is the language browsers and servers use to talk. A POST request is the kind you use when you are sending data that should change something on the server, like submitting a form or creating a post. A GET request is more like asking to read a page.

URL, query string and parameters. A URL is the address of a page. Sometimes it has a question mark followed by name=value pairs, separated by &. That part is the query string, and each name=value pair is a parameter. Think of a URL as an address plus a short list of instructions attached to it, like "deliver to this street, flat 3, second floor".

The request body. Besides the URL, a POST request can carry a body: extra data sent after the headers. If the URL is the address on the envelope, the body is the letter inside.

An identifier (ID). Websites store things like posts, groups and photos, and each one gets a unique number so the site can tell them apart. That number is an identifier. It is like a passport number: it points to exactly one thing.

An API and an endpoint. An API is the set of doors a website offers for programs (including your browser) to ask it to do things. Each door is called an endpoint, and it is usually described by a path such as /groups/learning/create_with_post/. When you use Facebook normally, your browser is knocking on these doors behind the scenes.

Cookies and tokens. When you log in, the server gives your browser a small piece of data (a cookie) so it can recognise you on the next request. Separately, many sites include hidden tokens in forms to prove the request really came from their own pages and not from a malicious site. Facebook uses two such values, jazoest and fb_dtsg. These are anti-CSRF tokens: CSRF stands for Cross-Site Request Forgery, an attack where another website tries to make your browser send a request you did not intend. The tokens make that harder.

Burp Suite. A tool that sits between your browser and the server and lets you pause a request, look at it, change it, and then send it on. Think of it as a post office that lets you open an envelope, swap the contents, and seal it again before delivery. The report does not give a version number for it.

IDOR. Insecure Direct Object Reference. The server takes an identifier from the browser and acts on it without checking that the person asking has any right to that object. If a website lets you view your own receipt at /receipt?id=1001 and you can change it to id=1002 to see someone else's, that is an IDOR. The bug here is the same idea, applied to posts and groups.

Authorisation versus authentication. Authentication is proving who you are (logging in). Authorisation is whether you are allowed to do a particular thing. The anti-CSRF tokens prove the request came from your own logged-in session; they say nothing about whether you are allowed to touch someone else's post. That gap is the heart of this bug.

Setup

To test this, the researcher needed two things:

  1. A Facebook group that he owned, switched to the "Social learning" group type.
  2. Membership in at least one other group that contains posts by other users. That other group is where the target posts come from.

For the second impact variant, the attacker also needs to be able to invite the owner of the target post to his own group. The report notes that only an invitation is required.

Burp Suite was used to intercept and modify the request.

Finding it

While testing the Units feature, the researcher watched the POST request that fires when a group post is added to a new unit. The parameter that stood out was post_id. Facebook did not validate the value of post_id, so an attacker could supply the identifier of any post from a different group and have it pulled into a unit inside a group the attacker owns.

That is a classic IDOR: the server trusts a client-supplied object identifier without checking that the caller has any relationship to that object. The report describes two consequences of the missing check:

  1. A post whose content is text only is rendered as "Attachment not available", distorting it.
  2. A title can be placed on the attacker's unit above posts belonging to other users, which both distorts the original content and makes it undeletable. This second variant requires the attacker to invite the owner of the post to the attacker's group.

Exploitation

Step 1: switch the attacker's group to Social learning

Navigate to the group owned by the attacker, open Edit group settings, then Group type, and select Social learning.

Step 2: create a unit from a post

Make any post in the attacker-owned group, click the three dots, choose Add to new Unit, fill in the requirements, intercept the request with Burp Suite, and create the unit.

Why: this is the normal, legitimate way to use the feature.

Step 3: inspect the request

The intercepted request looks like this:

HTTP
POST /groups/learning/create_with_post/?group_id=[Attacker_Group_ID]&post_id=[Attacker_Post_ID]&dpr=1 HTTP/1.1

jazoest=[number]&fb_dtsg=[anti_csrft]&unit name=bla&unit description=bla&post title=bla

Line by line:

  • POST /groups/learning/create_with_post/ is the method and the endpoint. The method says "this changes something"; the path says "create a unit together with a post, under the learning feature".
  • ?group_id=[Attacker_Group_ID] is the first parameter. It tells Facebook which group the unit belongs to. Here it is the attacker's own group, so this part is entirely legitimate.
  • &post_id=[Attacker_Post_ID] is the second parameter. It tells Facebook which post to put into the unit. This is the parameter that is not validated, and the one the attacker will later swap.
  • &dpr=1 is a display-related parameter sent by the browser. It is not part of the attack.
  • HTTP/1.1 is the version of the HTTP protocol being used.
  • The blank line separates the URL and headers from the body.
  • jazoest=[number] and fb_dtsg=[anti_csrft] are Facebook's anti-CSRF values. They prove the request came from the attacker's own logged-in session.
  • unit name=bla, unit description=bla and post title=bla are the fields the attacker filled in when creating the unit. bla is just placeholder text.

Step 4: swap in a foreign post ID

Go to any group where the attacker is a member, then choose the target depending on the desired effect:

  • To distort a post, find posts with "Text only".
  • To add a title to the unit on the post and make it undeletable, invite the owner of that post to the attacker's group (only invite).

Obtain the post ID, replace post_id in the Step 3 request with it, and forward the request.

Why: the attacker is a member of the other group, so he can see its posts and read their identifiers. He takes one of those identifiers and puts it where his own post's identifier was. Because Facebook never validates the post identifier, it accepts the foreign post and attaches it to the attacker's unit.

Step 5: observe the victim's side

Once the attacker performs the attack, the owner of the post is unable to delete their post. The group admin is also unable to delete the attacked post, regardless of their administrative privileges.

From the original on blog.flawminers.com

Root cause

The server accepted a client-supplied post_id without validating it, so a post from another group could be attached to a unit. The report does not describe the server-side code, so the exact check that was missing is not stated; the observable behaviour is that the value of post_id was trusted.

Impact

An attacker who owns a Social learning group and is a member of another group can pull any post from that other group into a unit in his own group. The effects described in the report are:

  • Text-only posts are rendered as "Attachment not available", distorting the original content.
  • With an invitation to the post owner, a title can be placed on the attacker's unit above posts from other users, distorting the content and making it undeletable by either the post owner or the group admin, whatever their privileges.

Fix

Facebook fixed the bug.

Variants to test

  1. Other object-reference parameters on the same endpoint. Try swapping any identifier in the request (group, post, unit) for one belonging to another account. A positive result is the server accepting the foreign identifier and the object appearing in your own context.
  2. Same feature, different actions. Look at other requests the Units feature makes, such as editing or removing a unit, and try foreign identifiers there. A positive result is a change to an object you do not own.
  3. Cross-tenant identifiers in bulk operations. Where an endpoint accepts a list of IDs, submit IDs from another tenant. A positive result is any of them being processed.
  4. Invitation-gated effects. Where an effect only appears after some relationship exists (as with the invitation here), test whether the relationship check is enforced on the server or only in the UI. A positive result is the effect occurring without the relationship being genuinely established.

Timeline

Date Actor Event
18 Jun 2018 Sarmad Initial report
20 Jun 2018 Meta Bug Bounty Report triaged
31 Jul 2018 Meta Bug Bounty Bug fixed
31 Jul 2018 Sarmad Fix confirmed
02 Aug 2018 Meta Bug Bounty Bounty awarded

A note on prior discovery

After reporting the bug, the researcher recalled having seen information about an undeletable post issue on Facebook. A search led him to a YouTube video demonstrating the same bug from a different endpoint. He contacted the original researcher, Richard Telleng, to check whether it had been fixed. Telleng said the bug had been fixed and that Facebook had already rewarded him a bounty for it. The researcher then shared the full story with the Facebook Security Team. The report credits Telleng for his honesty and support.

Glossary

  • API: the set of doors a website offers for programs, including your browser, to ask it to do things.
  • Authentication: proving who you are, usually by logging in.
  • Authorisation: whether you are allowed to do a particular thing once you are logged in.
  • Anti-CSRF token: a hidden value in a request that proves it came from the site's own pages rather than from a malicious site.
  • Burp Suite: a tool that sits between your browser and a server so you can pause, inspect and change requests.
  • Cookie: a small piece of data a site stores in your browser so it can recognise you on later requests.
  • CSRF (Cross-Site Request Forgery): an attack where another website tries to make your browser send a request you did not intend.
  • Endpoint: a specific path on a server that accepts requests, such as /groups/learning/create_with_post/.
  • GET: an HTTP method used when you want to read something.
  • HTTP: the language browsers and servers use to talk to each other.
  • IDOR (Insecure Direct Object Reference): when a server takes an identifier from the browser and acts on it without checking that the caller is allowed to touch that object.
  • Identifier (ID): a unique number or string that points to one specific thing, such as a post or a group.
  • Parameter: a name=value pair in a URL or request body that passes information to the server.
  • POST: an HTTP method used when you want to change something on the server, such as creating a post.
  • Query string: the part of a URL after the question mark, made of parameters separated by &.
  • Request body: the extra data sent after the headers in a POST request.
  • Response: what the server sends back after a request.
  • Social Learning: a Facebook group type that unlocks the Units feature.
  • Units: a Facebook feature that lets a group organise posts into topics or course sections.
  • URL: the address of a page or endpoint.

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.