Skip to content
IDOR Write-up Beginner

Adding anyone including non-friend and blocked people as co-host in personal event!

The Facebook Events co-host selection did not verify that the chosen profile was a friend or not blocked, so an attacker could add any user as co-host by swapping the profile ID in the request. The victim would receive a notification and be publicly listed as co-host without consent.

Binit Ghimire Follow

Published on publish.whoisbinit.me

Bounty$750 View original

·Jan 28, 2020·

Binit Ghimire (@WHOISbinit), on publish.whoisbinit.me

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 Events lets a personal profile create an event and invite other people to help run it. When you create an event from your personal profile, Facebook asks you to pick friends to add as co-hosts. The co-host list is submitted to the server as part of the event creation request, and the server is supposed to check that each submitted profile is eligible to be a co-host for that host.

The report describes an IDOR in that co-host selection flow. An attacker profile could add anyone as a co-host of a personal event, including non-friends, non-friends-of-friends, and people who had blocked the attacker or whom the attacker had blocked. The Facebook Security Team paid a bounty of $750 for the report.

Adding anyone including non-friend and blocked people as co-host in personal event!
Adding anyone including non-friend and blocked people as co-host in personal event! From the original on publish.whoisbinit.me

Setup

The reproduction needs:

  • A PC with a web browser.
  • An Internet connection, with no geographical restriction on the use of Facebook.
  • Three Facebook accounts: User A, User B and User C.
Users User ID
User A 1337
User B 1008
User C 31337
  • User A is the event host.
  • User B is a friend of User A with no role in the event. User B exists so that a legitimate co-host can be selected and the request intercepted.
  • User C is a total stranger to both User A and User B, and is not a friend of either.

A proxy such as Burp Suite, OWASP ZAP or a similar tool is used to intercept and modify the event creation request.

Finding it

When creating an event, Facebook asks you to select friends to add as co-hosts, and the selected profile ID travels to the server as a request parameter. The value of that parameter could be swapped for the ID of someone who is not a friend, and the server accepted it. That is the IDOR: the server trusts the client-supplied profile ID without checking the relationship between the host and the proposed co-host.

Exploitation

Step 1

Log in to User A's account on the web version of Facebook and visit facebook.com/events.

Step 2

Click "Create Event" and select any of the options among private and public events.

Step 3

Select User A in the Event Host drop-down list. If User A has pages, the drop-down appears; otherwise only User A is shown and is selected by default, so no action is needed.

Step 4

Fill in all the fields in any way you want, and in the Co-hosts field enter "User B" and select User B.

Step 5

Before clicking "Create", start intercepting in Burp Suite, OWASP ZAP or any similar tool.

Step 6

Click "Create" and keep forwarding requests until you see one that looks like this:

HTTP
POST /ajax/create/event/submit/?title=[EventName]&description=[Description]&location=...&location_id=....&location_latlong[latitude]=...&location_latlong[longitude]=...&cover_focus[x]=0.5&cover_focus[y]=0.5&only_admins_can_post=true&post_approval_required=false&co_hosts[0]=1008&start_date=11%2F25%2F2019&start_time=7200&end_date=11%2F25%2F2019&end_time=18000&timezone=........ HTTP/1.1

The parameter of interest is co_hosts[0]=1008, where 1008 is the user ID of User B. The rest of the query string carries the event title, description, location, cover focus, posting permissions, dates, times and timezone.

Step 7

Replace the value of co_hosts[0] with the user ID of the non-friend, User C (31337), and forward the request. The event is then created.

Step 8

Clicking "1 co-host pending" shows that User C has been successfully added as a co-host of the event.

Step 9

Log in to User C's account. A notification appears saying "User A made you a host of his/her event [EventName]."

Exceptional case

If User C has blocked User A, the same steps still work. In that case User C cannot see the event because User A is blocked, but User A still sees User C in the pending co-host list.

Root cause

The server accepts the profile ID in co_hosts[0] from the client and adds that profile as a co-host without verifying that the profile is a friend of the host or otherwise eligible. The client-side picker only offers friends, but that restriction is not enforced server-side, so changing the ID in the request is enough to bypass it. The report does not describe the server-side code, so the exact check that was missing is not stated.

Impact

An attacker could add anyone as a co-host of a personal event, including non-friends, non-friends-of-friends, people the attacker had blocked, and people who had blocked the attacker. The victim could not reject the request to be added as co-host, and would be automatically visible to the public as co-host of the event right after clicking "Interested" or "Going". When the victim had blocked the attacker, the victim could not see the event, but the attacker still saw the victim in the pending co-host list.

Fix

The report does not describe the change that was made. The patch was confirmed on January 21, 2020, and the bounty was rewarded on January 24, 2020. A fix would be to validate server-side, at event creation, that every profile in co_hosts is eligible to be a co-host of the requesting host, rather than relying on the client-side friend picker.

Variants to test

  • A positive result is the stranger appearing in the pending co-host list and receiving a notification.
  • A positive result is the same acceptance, with the blocked user unable to see the object but still listed as pending.

Timeline

  • November 25, 2019: vulnerability reported.
  • November 28, 2019: more information requested; the researcher responded with the information and a proof-of-concept video.
  • December 4, 2019: whitehat test account credentials requested and provided.
  • December 7, 2019: more information requested and provided.
  • December 10, 2019: the team reported the exact error in the response and asked for a new PoC video showing all steps from the creation of the whitehat test account.
  • December 11, 2019: the new PoC video was provided.
  • December 14, 2019: the team asked whether the victim could remove themselves as co-host; the researcher said the victim could not reject the request and would be publicly visible as co-host after clicking "Interested" or "Going".
  • December 18, 2019: successful reproduction and triage; the report was sent to the product team.
  • January 8, 2020: the researcher asked for an update.
  • January 10, 2020: the team said they would notify the researcher of any change.
  • January 21, 2020: patch confirmation requested; the researcher did not see the message.
  • January 24, 2020: bounty of $750 rewarded.
  • January 28, 2020: the team replied about the name to be included in the Thanks page.
  • February 6, 2020: the hall of fame page was updated, and the researcher confirmed the name was included in the Thanks page of 2019.

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

What happened, in plain words

Facebook lets you create events from your personal profile. An event is a page with a name, a date, a place and a list of people who are coming. When you create one, Facebook also lets you pick co-hosts: friends who help you run the event, the way a second organiser helps run a party.

The form only lets you pick your friends. But the form is just a web page, and a web page can be changed. The researcher found that the list of chosen co-hosts is sent to Facebook's servers as part of the request that creates the event, and the server accepted a co-host who was not a friend. By editing the request before it left the browser, the researcher could put in the ID of anyone at all: a non-friend, a non-friend-of-a-friend, or even someone who had blocked the attacker.

This kind of bug is called an IDOR (Insecure Direct Object Reference). In plain terms: the server takes an identifier that the browser sends and acts on it without checking whether the person sending it is allowed to use that identifier. It is like a hotel receptionist who hands out a room key to anyone who says a room number, without checking that the person is the guest.

Facebook's security team paid $750 for the report. The report was submitted on November 25, 2019, triaged on December 18, 2019, the fix was confirmed on January 21, 2020, and the bounty was paid on January 24, 2020.

Adding anyone including non-friend and blocked people as co-host in personal event!
Adding anyone including non-friend and blocked people as co-host in personal event! From the original on publish.whoisbinit.me

Background you need first

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

What an event is on Facebook. An event is a page for something happening at a time and place. It has a host (the person who made it), a list of guests, and optionally co-hosts. Co-hosts can help manage the event. When someone is added as a co-host, Facebook sends them a notification.

What a request is. When you click a button in a browser, the browser sends a message to a server. That message is an HTTP request. It has a method (like POST, meaning "here is some data, please create something"), a path (which part of the site it is talking to), and often a body or a query string carrying the data. The server replies with a response.

What an API is. An API is the set of addresses and rules a program uses to talk to a server. When the Facebook web page creates an event, it does not reload the whole page; it quietly sends a request to an address like /ajax/create/event/submit/ and the server answers with data. That address is part of Facebook's API. Think of it as the service counter at a shop: the form on the page is the shop window, and the API is the counter where the actual transaction happens.

What a parameter is. A parameter is a named value inside a request. In co_hosts[0]=1008, the name is co_hosts[0] and the value is 1008. Parameters are how the browser tells the server what the user chose.

What a user ID is. Every Facebook account has a number that identifies it. The report uses made-up numbers: User A is 1337, User B is 1008, User C is 31337. These are placeholders, not real accounts.

What a proxy is. A proxy is a tool that sits between your browser and the server. Instead of the browser talking straight to Facebook, it talks to the proxy, and the proxy passes the message on. Because everything passes through the proxy, you can pause a request, read it, change it, and then let it continue. Burp Suite and OWASP ZAP are two well-known proxies used for this. Think of it as a postal worker who lets you open a letter, rewrite a line, and seal it again before delivery.

What intercepting means. Intercepting is turning on that pause. The proxy holds each request until you tell it to forward it. This is how the researcher stopped the event creation request before it reached Facebook and edited the co-host ID.

What a cookie or token is. When you log in, the server gives your browser a small piece of data (a cookie or token) that proves who you are on later requests. You do not need to touch it here; the proxy keeps it attached automatically. It is the equivalent of a wristband at a festival: you show it once at the gate, and after that staff let you in and out.

What server-side and client-side mean. Client-side is everything that happens in your browser: the page, the form, the drop-down that only lists friends. Server-side is everything that happens on Facebook's computers. A rule enforced only client-side can be bypassed by anyone who can edit the request, because the browser is under the user's control. A rule enforced server-side cannot, because the user never gets to change it. This bug is exactly that gap.

What the researcher needed

  • A PC with a web browser.
  • An Internet connection, with no geographical restriction on the use of Facebook.
  • Three Facebook accounts, labelled User A, User B and User C.
Users User ID
User A 1337
User B 1008
User C 31337
  • User A is the event host, the person creating the event.
  • User B is a friend of User A. User B has no role in the event. User B exists only so that a legitimate co-host can be picked in the form, which makes the request look normal and lets the researcher catch it.
  • User C is a total stranger to both User A and User B, and is not a friend of either. User C is the person the attacker should not be able to add.

A proxy such as Burp Suite, OWASP ZAP or a similar tool is used to intercept and modify the event creation request.

How the researcher found it

When creating an event, Facebook asks you to select friends as co-hosts. That is the client-side restriction. But the profile ID of the selected co-host travels to the server as a request parameter. The value of that parameter could be swapped for the ID of someone who is not a friend, and the server accepted it. That is the IDOR: the server trusts the client-supplied profile ID without checking the relationship between the host and the proposed co-host.

Reproducing it, step by step

Step 1

Log in to User A's account on the web version of Facebook and visit facebook.com/events.

Why: you need to be the host, because only the host can create an event and choose co-hosts. The events page is where the creation flow starts.

Step 2

Click "Create Event" and select any of the options among private and public events.

Why: the bug is in the co-host handling, not in the privacy setting, so either kind of event works. Picking one is just to get to the form.

Step 3

Select User A in the Event Host drop-down list. If User A has pages, the drop-down appears; otherwise only User A is shown and is selected by default, so no action is needed.

Step 4

Fill in all the fields in any way you want, and in the Co-hosts field enter "User B" and select User B.

Why: the form will only let you pick a friend here. User B is a friend, so the form accepts the choice and the browser builds a request containing User B's ID. That gives you a valid request to edit in the next steps.

Step 5

Before clicking "Create", start intercepting in Burp Suite, OWASP ZAP or any similar tool.

Why: you want the proxy to catch the request as it leaves the browser, before Facebook's server sees it. If you click Create first, the request is already gone.

Step 6

Click "Create" and keep forwarding requests until you see one that looks like this:

HTTP
POST /ajax/create/event/submit/?title=[EventName]&description=[Description]&location=...&location_id=....&location_latlong[latitude]=...&location_latlong[longitude]=...&cover_focus[x]=0.5&cover_focus[y]=0.5&only_admins_can_post=true&post_approval_required=false&co_hosts[0]=1008&start_date=11%2F25%2F2019&start_time=7200&end_date=11%2F25%2F2019&end_time=18000&timezone=........ HTTP/1.1

Line by line, in plain words:

  • POST is the method: the browser is asking the server to create something.
  • /ajax/create/event/submit/ is the API address that handles event creation.
  • Everything after the ? is the query string: a list of name=value pairs joined by &.
  • title=[EventName] is the event title, shown here as a placeholder.
  • description=[Description] is the event description, also a placeholder.
  • location=..., location_id=...., location_latlong[latitude]=... and location_latlong[longitude]=... carry the place and its coordinates. The dots stand for values the report does not show.
  • cover_focus[x]=0.5 and cover_focus[y]=0.5 say which part of the cover image to centre on.
  • only_admins_can_post=true and post_approval_required=false are posting permissions for the event.
  • co_hosts[0]=1008 is the important one: the first co-host in the list, with the user ID of User B. The [0] is an index, so a second co-host would be co_hosts[1], and so on.
  • start_date=11%2F25%2F2019 and end_date=11%2F25%2F2019 are the dates. %2F is the encoded form of the / character, so this reads 11/25/2019.
  • start_time=7200 and end_time=18000 are the times.
  • timezone=........ is the timezone, with the value left out in the report.
  • HTTP/1.1 is the version of the HTTP protocol being used.

The parameter of interest is co_hosts[0]=1008, where 1008 is the user ID of User B. The rest of the query string carries the event title, description, location, cover focus, posting permissions, dates, times and timezone.

Step 7

Replace the value of co_hosts[0] with the user ID of the non-friend, User C (31337), and forward the request. The event is then created.

Why: this is the whole attack. The form would not let you pick User C, because Facebook asks you to select friends. But putting 31337 in co_hosts[0] asks the server to add User C, and the server accepted it, so the event was created with User C as co-host.

Step 8

Clicking "1 co-host pending" shows that User C has been successfully added as a co-host of the event.

Seeing User C there is the first sign the server accepted the swapped ID.

Step 9

Log in to User C's account. A notification appears saying "User A made you a host of his/her event [EventName]."

Why: this confirms the effect from the victim's side. User C, a complete stranger, received a real co-host invitation from someone they do not know.

Exceptional case

If User C has blocked User A, the same steps still work. In that case User C cannot see the event because User A is blocked, but User A still sees User C in the pending co-host list.

Why this matters: blocking is supposed to stop interaction between two accounts. Here the server still accepted the co-host addition. The block stopped User C from viewing the event, but it did not stop the attacker from adding them.

Why it worked

The server accepts the profile ID in co_hosts[0] from the client and adds that profile as a co-host without verifying that the profile is a friend of the host or otherwise eligible. The client-side picker only offers friends, but that restriction is not enforced server-side, so changing the ID in the request is enough to bypass it. The report does not describe the server-side code, so the exact check that was missing is not stated.

What an attacker could do with it

An attacker could add anyone as a co-host of a personal event, including non-friends, non-friends-of-friends, people the attacker had blocked, and people who had blocked the attacker. The victim could not reject the request to be added as co-host, and would be automatically visible to the public as co-host of the event right after clicking "Interested" or "Going". When the victim had blocked the attacker, the victim could not see the event, but the attacker still saw the victim in the pending co-host list.

In everyday terms: someone you have never met, or someone you have blocked, could put your name on their event as an organiser, and you could not say no. Once you showed any interest in the event, your name would appear publicly next to theirs.

How it was fixed

The patch was confirmed on January 21, 2020, and the bounty was rewarded on January 24, 2020. A fix would be to validate server-side, at event creation, that every profile in co_hosts is eligible to be a co-host of the requesting host, rather than relying on the client-side friend picker.

In plain words: the server should repeat the check the form does. Before saving the event, it should look at each ID in the co-host list and ask "is this person allowed to be a co-host for this host?" If not, it should refuse.

Similar things to test elsewhere

  • A positive result is the stranger appearing in the pending co-host list and receiving a notification.
  • A positive result is the same acceptance, with the blocked user unable to see the object but still listed as pending.

Timeline

  • November 25, 2019: vulnerability reported.
  • November 28, 2019: more information requested; the researcher responded with the information and a proof-of-concept video.
  • December 4, 2019: whitehat test account credentials requested and provided.
  • December 7, 2019: more information requested and provided.
  • December 10, 2019: the team reported the exact error in the response and asked for a new PoC video showing all steps from the creation of the whitehat test account.
  • December 11, 2019: the new PoC video was provided.
  • December 14, 2019: the team asked whether the victim could remove themselves as co-host; the researcher said the victim could not reject the request and would be publicly visible as co-host after clicking "Interested" or "Going".
  • December 18, 2019: successful reproduction and triage; the report was sent to the product team.
  • January 8, 2020: the researcher asked for an update.
  • January 10, 2020: the team said they would notify the researcher of any change.
  • January 21, 2020: patch confirmation requested; the researcher did not see the message.
  • January 24, 2020: bounty of $750 rewarded.
  • January 28, 2020: the team replied about the name to be included in the Thanks page.
  • February 6, 2020: the hall of fame page was updated, and the researcher confirmed the name was included in the Thanks page of 2019.

Glossary

  • API: the set of addresses and rules a program uses to talk to a server; the service counter behind a web page.
  • Burp Suite: a tool that sits between browser and server so you can pause, read and edit requests.
  • Client-side: anything that happens in your browser, such as the form that only lists friends.
  • Co-host: a person added to help run an event, alongside the host.
  • Cookie: a small piece of data the server gives your browser after login so later requests can be tied to your account.
  • CVSS: a scoring system for the severity of a vulnerability; not used in this report.
  • Event: a Facebook page for something happening at a time and place, with a host, guests and optionally co-hosts.
  • HTTP: the protocol browsers and servers use to exchange requests and responses.
  • IDOR (Insecure Direct Object Reference): a bug where the server acts on an identifier sent by the browser without checking that the sender is allowed to use it.
  • Intercept: to pause a request in a proxy before it reaches the server, so it can be inspected or changed.
  • OWASP ZAP: a free tool, like Burp Suite, for intercepting and editing requests.
  • Parameter: a named value inside a request, such as co_hosts[0]=1008.
  • Patch: a change to the software that fixes the bug.
  • Pending: a co-host invitation that has been sent but not yet accepted.
  • PoC (proof of concept): a demonstration, often a video, showing the bug actually happening.
  • POST: an HTTP method meaning "here is some data, please create something".
  • Proxy: a tool that sits between your browser and the server and passes messages through, so you can inspect them.
  • Query string: the part of a URL after the ?, made of name=value pairs joined by &.
  • Request: the message a browser sends to a server when you do something on a page.
  • Response: the message the server sends back.
  • Server-side: anything that happens on the company's computers, where the user cannot change it.
  • Token: a piece of data, like a cookie, that proves who you are on later requests.
  • Triage: the security team's first review, where they confirm the bug is real and pass it on.
  • User ID: the number that identifies a Facebook account.
  • Whitehat test account: an account the security team provides so a researcher can demonstrate a bug under controlled conditions.

More by Binit Ghimire

View all

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