Disclose Private Video Thumbnail from Facebook WorkPlace
A video ID parameter in Facebook's Canvas feature was vulnerable to an IDOR, allowing an attacker to reference any video by its ID. By sending a Canvas preview to a mobile device, the attacker could view the thumbnail of a private Workplace video.
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
This is a story about Facebook Pages and the CANVAS ad format. A Page admin, or even an advertiser, can create a CANVAS and add elements to it, including uploading a photo or a video. The researcher's interest was in the video element and in the identifier that ties a CANVAS video element to an uploaded video.
The report was submitted through Facebook's BugBounty Program and was later fixed. The researcher is Sarmad Hassan (JubaBaghdad), and this was his second bug found in Facebook.


Setup
The researcher created a test Page and went through every option on it. He also had a second test account running in a virtual box, and a Workplace test account. Burpsuite was used to intercept requests. The report does not give browser, Burp or operating system versions.
The precondition for the interesting part is a CANVAS with a video element, plus a video posted from another account whose video_id the attacker can learn or guess.
Finding it
While checking the Page options, the CANVAS feature stood out because it allows uploading a photo or a video inside it.

He uploaded a test video into the CANVAS and saved it. Then he edited the CANVAS, changed its title, and intercepted the request with Burpsuite to see how the CANVAS is built and which parameters it carries:
POST /v2.11/{My_Page_ID}?access_token={My_page _Access _Token} HTTP/1.1
Host: graph.facebook.com
User-Agent:
Accept: */*
Accept-Language: en-US,en;q=0.5
Referer: https://www.facebook.com/
Content-type: application/x-www-form-urlencoded
Content-Length: 206
Origin: https://www.facebook.com
Connection: close
_reqName=object%3Acanvas_video&_reqSrc=AdsCanvasElementDataLoader&bottom_padding=0&locale=en_US&method=post&name=Video&pretty=0&style=FIT_TO_WIDTH&suppress_http_code=1&top_padding=0&video_id=956034724555363
The request goes to graph.facebook.com on API version v2.11, authenticated with the Page access token in the query string. The body is form-encoded and describes a CANVAS video element: _reqName=object%3Acanvas_video (that is object:canvas_video), _reqSrc=AdsCanvasElementDataLoader, name=Video, style=FIT_TO_WIDTH, and the padding and locale fields. The parameter that matters is video_id=956034724555363, which selects the video shown in the CANVAS.
Exploitation
Step 1: swap the video_id for a video from another account
He opened his second test account, made a post, uploaded a test video, and copied its video_id:
video-id=130146294495198
He replaced video_id=956034724555363 in the request above with that value. The video was uploaded successfully into his Page CANVAS.

At this point he could put into his own CANVAS any public video from users who are not his friends, and any video from his friends' posts even when those posts are set to friends only. The cause is an IDOR in the video_id parameter: the CANVAS accepts a video identifier that does not belong to the caller.
Step 2: test whether the reference is shared
Because both the CANVAS video and the second account's video now carried the same video_id, he reasoned that deleting the CANVAS video should delete the video in the second account's post. He tried it and it did not work. He tried it and it did not work.
Step 3: move the target to Workplace
He then thought about the Facebook Workplace sub-domain. Every post in Workplace is treated as private: only members of a company with the same email domain should see their posts, including photos and videos.
He made a video post in his Workplace test account and copied its identifier:
video_id=168712210608619
He replaced video_id in the same CANVAS request with this value, and the video was accepted into the CANVAS.

Step 4: the preview is blocked, but something leaks
He refreshed the page and clicked view to see whether the Workplace video would play. The video itself did not play, but he noticed something in the preview: a spinning icon for the video. The upload had succeeded, and something was stopping the video from being previewed.

Step 5: send the CANVAS preview to a phone
CANVAS has an option to send a preview of the CANVAS to a mobile device. He used it.

His phone received a notification saying that the canvas was ready to preview. He opened it and saw the video on the device. He could not play the whole video, but he could see the video thumbnail. That thumbnail came from a private Workplace post.
Root cause
The CANVAS video element takes a video_id from the client and loads the referenced video without checking that the caller is allowed to see that video. The identifier is a direct object reference, so any video whose id is known or guessable can be attached to a CANVAS the attacker controls. The web preview showed a spinning icon and did not play the video, but the mobile preview displayed the thumbnail. The report does not describe the server-side code, so the exact check that is missing is not stated.
Impact
An attacker with a Page, or an advertiser role, can attach a video from another account to their own CANVAS. For ordinary Facebook posts this covers public videos from non-friends and videos from friends' posts that are set to friends only. For Workplace, where every post is considered private to the company or organisation, the attacker can obtain the thumbnail of a private video. The video itself could not be played in the researcher's test, only the thumbnail was visible. The researcher's concern is that Workplace videos can contain private information such as meeting places, private emails, private titles for the company, prices, budgets, product sales figures, and the private content of the video itself.
Fix
Facebook fixed the issue and confirmed the fix.
Timeline
| Date | Event |
|---|---|
| March 30, 2018 | Initial report |
| April 5, 2018 | Report triaged |
| April 10, 2018 | Fixed by Facebook |
| April 10, 2018 | Fix confirmed |
| May 3, 2018 | Bounty of $3000 awarded |

Variants to test
- Other CANVAS element types that reference an object by id, such as photo elements. A positive result is an element accepting an id from another account and rendering it.
- Other preview and share paths for a CANVAS, for example email preview or any other delivery channel. A positive result is a channel that renders content the web preview blocks.
- The same
video_idswap against other Graph API versions and other Page endpoints that accept a video reference. A positive result is the same acceptance of a foreign id. - Video and photo ids in other products that treat posts as private, such as Workplace groups. A positive result is a thumbnail or metadata from a private post appearing in an object the attacker controls.
- Deletion and edit operations on the referenced id, to see whether the reference is shared beyond display. A positive result is a change on the victim's object caused by the attacker's request.
What happened, in plain words
A security researcher found a way to make Facebook show him the thumbnail (the small still picture that represents a video) of a private video from Facebook Workplace. Workplace is the version of Facebook that companies use internally, and everything posted there is meant to be visible only to colleagues inside the same company. He could not play the video, but he could see its thumbnail, and a thumbnail can already reveal private information. Facebook fixed the problem and paid him 3000 USD.
This article walks through the whole story slowly, assuming you have never done security testing before. Every technical word is explained the first time it appears, and there is a glossary at the end.


The pieces you need to understand first
Before the story makes sense, here are a few ideas in everyday terms.
A web page versus an API. When you open Facebook in your browser, you get a page full of buttons, pictures and text. Behind that page, the browser is constantly talking to Facebook's servers through a second channel called an API (Application Programming Interface). Think of the page as the counter of a shop and the API as the back door where the staff actually fetch and store things. The page shows you a form; the API is what receives the filled-in form.
A request. Every time your browser asks a server to do something, it sends a request. A request has a few parts:
- a method and a URL, which say what kind of action you want and where (for example
POSTmeans "create or send something"); - headers, which are small labels with extra information, such as what kind of data is being sent;
- a body, which is the actual data, for example the fields of a form.
A token. Facebook does not want anyone to be able to act on your account just by knowing your username. So after you log in, the browser holds a token (also called an access token or a session cookie): a long random string that proves "this request comes from the person who logged in". It works like a coat-check ticket: whoever holds the ticket can collect the coat. If someone else gets your token, they can act as you, which is why tokens are secrets.
Burpsuite. A normal browser sends requests and you never see them. Burpsuite is a tool that sits between your browser and the server like a mail intercept officer: it catches each request, lets you read it, change it, and then send it on. That is how the researcher could look inside what Facebook's page was really sending.
An identifier (ID). Most things stored on a service have a number that identifies them: a video has a video_id, a page has a page ID. It is like a locker number. The number itself is not secret; what matters is whether the server checks that you are allowed to open that locker.
IDOR. IDOR stands for Insecure Direct Object Reference. It is the bug that happens when a server takes an ID from the user and hands over whatever that ID points to, without checking whether this particular user is allowed to see it. Everyday comparison: a hotel receptionist gives you a key when you say "room 214", without checking that room 214 is yours. If you can change the number and still get a key, the reference is insecure.
Facebook Pages and CANVAS. A Page is the public profile a business or brand uses on Facebook, as opposed to a personal profile. CANVAS is an advertising format: a full-screen page that opens after you tap an ad, and the person who runs the Page can build it out of elements, including a photo or a video.
Facebook Workplace. Workplace is Facebook for companies. Each company has its own space, and posts there are treated as private to that company: only members whose email belongs to the company's domain are supposed to see them.
Setting up
The researcher created a test Page of his own and clicked through every option on it, looking for anything interesting. He also had a second test account (a separate Facebook user) running inside a virtual box, which is a program that runs a whole computer inside your computer, handy for keeping test accounts separate. He had a Workplace test account too. He used Burpsuite to intercept requests. The report does not mention browser, Burp or operating system versions.
For the interesting part to work, two things are needed: a CANVAS with a video element in it, and a video posted from another account whose video_id the attacker can learn or guess.
Finding it
While going through the Page options, the CANVAS feature caught his attention, because it lets you upload a photo or a video inside it.

He uploaded a test video into the CANVAS and saved it. Then he edited the CANVAS, changed its title, and intercepted the request with Burpsuite, to see how a CANVAS is put together and which fields it carries:
POST /v2.11/{My_Page_ID}?access_token={My_page _Access _Token} HTTP/1.1
Host: graph.facebook.com
User-Agent:
Accept: */*
Accept-Language: en-US,en;q=0.5
Referer: https://www.facebook.com/
Content-type: application/x-www-form-urlencoded
Content-Length: 206
Origin: https://www.facebook.com
Connection: close
_reqName=object%3Acanvas_video&_reqSrc=AdsCanvasElementDataLoader&bottom_padding=0&locale=en_US&method=post&name=Video&pretty=0&style=FIT_TO_WIDTH&suppress_http_code=1&top_padding=0&video_id=956034724555363
Line by line, in plain words:
POST /v2.11/{My_Page_ID}?access_token={My_page _Access _Token} HTTP/1.1is the first line of the request.POSTis the action (send something)./v2.11/{My_Page_ID}is the address on the server: version 2.11 of the API, and the ID of the researcher's Page. After the?come the query parameters, hereaccess_token, the secret token that proves who is calling. The placeholders in curly brackets are where his own values went.Host: graph.facebook.comsays which server the request is for.graph.facebook.comis Facebook's API server, the back door mentioned earlier.User-Agent:is empty here; normally it says which browser is calling.Accept: */*means "I can accept any kind of answer".Accept-Language: en-US,en;q=0.5says the caller prefers English.Referer: https://www.facebook.com/says which page the request came from.Content-type: application/x-www-form-urlencodedsays the body is a classic web form, the same format asname=value&name=value.Content-Length: 206says the body is 206 bytes long.Origin: https://www.facebook.comsays which site the request originates from.Connection: closeasks the server to close the connection after answering.- The blank line separates headers from body.
- The body is one long line of form fields joined by
&._reqName=object%3Acanvas_videois the name of the thing being created;%3Ais the encoded form of a colon, so it readsobject:canvas_video._reqSrc=AdsCanvasElementDataLoadersays which internal component is sending it.name=Videoandstyle=FIT_TO_WIDTHdescribe the element (a video, stretched to the width).bottom_padding,top_padding,locale,method,prettyandsuppress_http_codeare supporting settings. The one that matters isvideo_id=956034724555363: it says which video the CANVAS element should show.
Exploiting it
Step 1: swap the video_id for a video from another account
He opened his second test account, made a post, uploaded a test video, and copied its identifier:
video-id=130146294495198
He then replaced video_id=956034724555363 in the request above with this new number and sent it. The video was accepted into his Page CANVAS.

Why this matters: the CANVAS now showed a video that belonged to a different account. At this point he could put into his own CANVAS any public video from users who are not his friends, and any video from his friends' posts even when those posts were set to friends only. The cause is the IDOR described earlier: the CANVAS accepts a video identifier that does not belong to the person making the request, and never asks whether that person is allowed to see the video.
Step 2: test whether the reference is shared
Because the CANVAS video and the second account's video now carried the same video_id, he reasoned that deleting the CANVAS video should also delete the video in the second account's post. He tried it and it did not work. He tried it and it did not work. This is a useful lesson: a bug that lets you read something does not automatically let you change or delete it.
Step 3: move the target to Workplace
He then thought about the Facebook Workplace sub-domain. Every post in Workplace is treated as private: only members of a company with the same email domain should see their posts, including photos and videos.
He made a video post in his Workplace test account and copied its identifier:
video_id=168712210608619
He replaced video_id in the same CANVAS request with this value, and the video was accepted into the CANVAS.

Why this step matters: the first swap showed a design flaw, but the videos involved were ones he could already see. Workplace raises the stakes, because a Workplace video is private by design. If the same swap works there, the flaw leaks something that was never meant to be public.
Step 4: the preview is blocked, but something leaks
He refreshed the page and clicked view to see whether the Workplace video would play. The video itself did not play, but he noticed something in the preview: a spinning icon for the video. The upload had succeeded, and something was stopping the video from being previewed.

A spinning icon told him the video was uploaded but something was blocking the preview. That is a partial defence, and partial defences are worth testing from another angle.
Step 5: send the CANVAS preview to a phone
CANVAS has an option to send a preview of the CANVAS to a mobile device. He used it.

His phone received a notification saying that the canvas was ready to preview. He opened it and saw the video on the device. He could not play the whole video, but he could see the video thumbnail. That thumbnail came from a private Workplace post.
The web preview did not play the video, but the mobile preview showed the thumbnail.
Why it worked
The CANVAS video element takes a video_id from the client and loads the referenced video without checking that the caller is allowed to see that video. The identifier is a direct object reference, so any video whose ID is known or guessable can be attached to a CANVAS the attacker controls. The web preview showed a spinning icon and did not play the video, but the mobile preview displayed the thumbnail. The report does not describe the server-side code, so the exact check that is missing is not stated.
What the impact was
An attacker with a Page, or an advertiser role, can attach a video from another account to their own CANVAS. For ordinary Facebook posts this covers public videos from non-friends and videos from friends' posts that are set to friends only. For Workplace, where every post is considered private to the company or organisation, the attacker can obtain the thumbnail of a private video. The video itself could not be played in the researcher's test, only the thumbnail was visible. The researcher's concern is that Workplace videos can contain private information such as meeting places, private emails, private titles for the company, prices, budgets, product sales figures, and the private content of the video itself.
The fix
Facebook fixed the issue and confirmed the fix.
Timeline
| Date | Event |
|---|---|
| March 30, 2018 | Initial report |
| April 5, 2018 | Report triaged |
| April 10, 2018 | Fixed by Facebook |
| April 10, 2018 | Fix confirmed |
| May 3, 2018 | Bounty of $3000 awarded |

Other places to try the same idea
- Other CANVAS element types that reference an object by ID, such as photo elements. A positive result is an element accepting an ID from another account and rendering it.
- Other preview and share paths for a CANVAS, for example email preview or any other delivery channel. A positive result is a channel that renders content the web preview blocks.
- The same
video_idswap against other Graph API versions and other Page endpoints that accept a video reference. A positive result is the same acceptance of a foreign ID. - Video and photo IDs in other products that treat posts as private, such as Workplace groups. A positive result is a thumbnail or metadata from a private post appearing in an object the attacker controls.
- Deletion and edit operations on the referenced ID, to see whether the reference is shared beyond display. A positive result is a change on the victim's object caused by the attacker's request.
Glossary
- API: the back door through which a website's pages talk to its servers; a set of addresses and rules for sending and receiving data.
- Access token: a long random string that proves a request comes from a logged-in user or page; like a coat-check ticket, whoever holds it can act as that account.
- Body: the part of a request that carries the actual data, such as form fields.
- Burpsuite: a tool that sits between browser and server, letting you read, change and resend requests.
- CANVAS: a full-screen advertising format on Facebook that a Page admin or advertiser builds from elements such as photos and videos.
- Content-type: a header that says what format the body is in, for example a web form.
- Form-encoded: a body format of
name=valuepairs joined by&, the same as a classic web form. - Graph API: Facebook's API server, reached at
graph.facebook.com. - Header: a small label attached to a request with extra information, such as the preferred language or the data format.
- ID: a number that identifies a stored object, such as a video or a page; like a locker number.
- IDOR (Insecure Direct Object Reference): a bug where the server takes an ID from the user and returns whatever it points to without checking that this user is allowed to see it.
- Method: the kind of action a request asks for, such as
POSTto send or create something. - Page: the public profile a business or brand uses on Facebook, separate from a personal profile.
- Parameter: a named value in a request, such as
video_id=.... - Query string: the part of a URL after the
?, carrying parameters such as the access token. - Request: the message a browser sends to a server asking it to do something.
- Thumbnail: the small still picture that represents a video.
- Token: see access token.
- Triaged: reviewed by the security team and accepted as a real issue to work on.
- URL: the address of something on a server.
- Virtual box: a program that runs a whole computer inside your computer, useful for keeping test accounts separate.
- Workplace: Facebook for companies, where posts are private to the company and its email domain.