Skip to content
CSRF Write-up Advanced

Facebook Instant Experiences Vulnerability

A button element in Facebook Instant Experiences accepted non-exported deeplinks, allowing an attacker to trigger internal app actions. Chaining with a deeplink that accepted a javascript: URI led to script execution and webview takeover, enabling phishing.

Ash King Follow

Published on ash-king.co.uk

Everyone who uses Facebook has seen them: slick, fast-loading ads that open up into a full-screen experience without ever leaving the app. These are called "Instant Experiences", a powerful tool for advertisers to create immersive landing pages.

Ash King, on ash-king.co.uk

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

Context

Facebook's Instant Experiences (formerly Canvas Ads) are full-screen, mobile-optimised landing pages that load inside the Facebook app when a user taps an ad. Advertisers build them with a drag-and-drop interface or through the Graph API, composing components such as videos, images and buttons. A button is meant to send the user to the advertiser's own website, so the security assumption behind the feature is that a button's target is an external, standard web page (https://...).

The write-up describes a flaw in that assumption: a button could be pointed at an internal Facebook deeplink instead, and one particular deeplink could then be used to run JavaScript inside a Facebook webview. The chain is CSRF through an Instant Experience button, a private deeplink launch, a javascript: injection, and finally takeover of the in-app webview.

Setup

The researcher explored the Graph API endpoints used to create canvases and their elements, and the attack scenario is described as achievable through Facebook's own Graph API Explorer with three API calls. The proof of concept redirected the webview to ash-king.co.uk/webview/. No versions or build numbers are given.

Finding it

While exploring the Graph API endpoints for creating canvases, the researcher noticed that the button element had a parameter called open_url_action, which dictates what happens when a user clicks the button:

JSON
"open_url_action": {
    "type": "OPEN_URL",
    "url": "https://example.com"
}

The documentation implies standard web links, but the question was what the API would actually accept. Deeplinks are URLs for mobile apps; instead of https:// they often use a custom scheme such as fb:// or fbinternal://, and they can tell the app to open a profile, a feature or perform an internal action. Most of these deeplinks are not exported, meaning they are not supposed to be triggerable by external sources.

The researcher created a button through the API with a Facebook deeplink in place of a normal URL:

JSON
"url": "fb://some-internal-feature"

The API accepted it without validation. That is the first crack: an advertiser can create an Instant Experience button that, when tapped, triggers an internal Facebook function. The report frames this as a classic CSRF, because an attacker can craft the request and have a victim execute it unknowingly.

Exploitation

A CSRF is only as useful as the actions it can force, and the missing validation exposed potentially thousands of internal deeplinks. The next task was to find a gadget, a deeplink powerful enough to escalate the impact. The researcher found one:

This internal deeplink appeared to be related to a Marketplace feature. More importantly, it accepted a parameter called link_url, designed to load a URL inside a specific, restricted webview within the Facebook app. The question was what values link_url would take, and in particular whether it would accept a javascript: URI. The final payload was:

The report breaks the payload down into four parts:

  1. fb://...: the entry point, the CSRF that lets a private deeplink be launched from an Instant Experience button.
  2. marketplace_byog_amazon_taskless_link: the gadget, the specific vulnerable deeplink chosen to launch.
  3. ?link_url=: the parameter inside the gadget deeplink that is vulnerable to injection.
  4. javascript:window.location.href='...': the second vulnerability, a script injection. The link_url parameter may have had restrictions on loading external domains directly, but it failed to block the javascript: scheme. The injected code's first instruction was to navigate the webview to the attacker's external site, bypassing any domain restrictions.

The chain is: CSRF via an Instant Experience button, launch a private deeplink, JS injection via link_url, webview takeover.

Step 1: Create the malicious button element

The attacker makes a POST request to /PAGE_ID/canvas_elements to create a button element containing the malicious deeplink payload.

Step 2: Create the canvas

The attacker creates an empty Instant Experience canvas with a POST request to /PAGE_ID/canvases.

Step 3: Link them together

The attacker associates the malicious button with the empty canvas. The result is a seemingly harmless Instant Experience page with a single button, which the attacker can publish and attach to an ad campaign through the Facebook Ad Network, targeting any audience.

What the victim sees

When a victim taps the ad and then the button ("Click Me!"), three things happen in the background:

  1. The Facebook app triggers the fb://marketplace... deeplink.
  2. The deeplink's handler executes the javascript: payload from the link_url parameter.
  3. The JavaScript redirects the internal webview to the attacker's site (ash-king.co.uk/webview/ in the proof of concept).

The victim is now viewing the attacker's website rendered inside the trusted UI of the Facebook app, which the report describes as a perfect setup for a convincing phishing attack to steal credentials or deanonymise the user. The video sent to Meta with the report to assist triage shows the chain in action:

Or watch on YouTube
YouTube video player From the original on ash-king.co.uk

Root cause

The button's open_url_action accepted a deeplink scheme without validating that the target was an external web URL, so an advertiser-controlled canvas element could invoke non-exported internal deeplinks. The gadget deeplink then passed its link_url parameter into a webview without blocking the javascript: scheme. The report notes that link_url may have had restrictions on loading external domains directly, but the scheme check was missing, so script execution was possible and the script could then navigate the webview anywhere. The design assumption that canvas buttons only point at https:// pages was never enforced at the API boundary.

Impact

  • CSRF and unauthorised actions: an attacker could force a user's app to perform internal actions without consent.
  • Webview takeover and phishing: chained with the JS injection, an attacker could load any website inside Facebook's in-app browser, making phishing hard to spot.
  • Massive attack surface: the initial flaw exposed a large number of internal deeplinks, each a potential new vector.

Fix

The fix was logical: if you click a canvas button in an Instant Experience that contains a non-exported deeplink, you are now redirected back to the home screen. fb:// deeplinks can still be used in the canvas_elements POST request, but only exported deeplinks will actually open when the button is tapped in the mobile app.

Timeline as reported:

Stage Date
Reported April 28 2025
Triaged May 1 2025
Bounty awarded June 11 2025 (+$X,XXX)
Fixed July 17 2025
  • Other button actions and parameters: try deeplink schemes in any field that takes a URL, such as open_url_action.url. A positive result is the API accepting fb:// or fbinternal:// where an https:// URL is expected.
  • Other deeplink gadgets: enumerate internal deeplinks that take a URL parameter like link_url. A positive result is a deeplink that loads the supplied value in a webview.
  • Scheme filtering on URL parameters: supply javascript:, data: and other non-HTTP schemes to parameters that load URLs. A positive result is script execution or navigation to an attacker-controlled origin.
  • Exported versus non-exported deeplinks: check whether non-exported deeplinks can be launched from advertiser-controlled content. A positive result is a non-exported deeplink opening from a canvas button.
  • Other advertiser-controlled surfaces: apply the same test to any component that accepts a URL and renders it in an in-app browser. A positive result is a redirect to an external site inside the trusted app UI.

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

What happened, in plain words

Facebook shows ads that, when you tap them, open into a full-screen page without leaving the app. These pages are called Instant Experiences (they used to be called Canvas Ads). Advertisers build them out of pieces: videos, images and buttons. A button is supposed to send you to the advertiser's own website, a normal web address starting with https://.

Ash King found that this rule was not actually enforced. An advertiser could build a button that pointed not at a website but at an internal Facebook command, a so-called deeplink. One of those internal commands could then be tricked into running JavaScript, the programming language that web pages use to make things happen. The JavaScript could then load any website the attacker wanted inside Facebook's own in-app browser, where it looks trustworthy. That is a strong setup for phishing, where a fake page steals your password because it appears to be the real thing.

The chain of problems was: a button that accepts an internal command (a CSRF), that command launching a private deeplink, that deeplink running injected JavaScript, and finally the attacker controlling the in-app browser window (a webview takeover). Meta fixed it and paid a bounty.

Before going further, a few words that come up constantly:

  • An API (Application Programming Interface) is a way for one program to talk to another. Think of a restaurant: you do not walk into the kitchen, you order from a menu and a waiter carries the request. The API is the menu plus the waiter. Facebook's Graph API is the menu that lets advertisers create ads, pages and canvases by sending requests instead of clicking around in a website.
  • A request is one message sent to that API, for example "create a button with this link". A POST request is the kind that creates or changes something, as opposed to GET, which only asks to read something.
  • A parameter is a named value inside a request, like a form field: url is the name, https://example.com is the value.
  • A webview is a small browser window embedded inside a mobile app. When an app shows you a web page without kicking you out to Chrome or Safari, that is a webview.
  • JavaScript is the language that runs inside web pages. javascript: at the start of a link is a special trick: instead of going to a page, the browser runs the code that follows.
  • CSRF (Cross-Site Request Forgery) means making someone else's browser or app perform an action they did not intend, usually by getting them to click something. The victim is logged in and trusted, so the action succeeds.
  • A deeplink is a link that opens a specific place inside an app rather than a website. Instead of https:// it often starts with a custom prefix such as fb://.

The feature: what Instant Experiences are

Instant Experiences are full-screen, mobile-optimised landing pages that load inside the Facebook app when someone taps an ad. Advertisers build them either with a drag-and-drop editor or through the Graph API, putting together videos, images and buttons. A button is meant to send the user to the advertiser's own website, so the whole feature rests on one assumption: a button's target is an external, standard web page starting with https://.

The write-up shows that this assumption was not enforced. A button could be pointed at an internal Facebook deeplink instead, and one particular deeplink could then be used to run JavaScript inside a Facebook webview. The full chain is: CSRF through an Instant Experience button, a private deeplink launch, a javascript: injection, and finally takeover of the in-app webview.

Setup

The researcher explored the Graph API endpoints used to create canvases and their elements, and the attack is described as achievable through Facebook's own Graph API Explorer (a web page where you can send Graph API requests by hand) with three API calls. The proof of concept redirected the webview to ash-king.co.uk/webview/. No versions or build numbers are given.

Finding it

While exploring the Graph API endpoints for creating canvases, the researcher noticed that the button element had a parameter called open_url_action. This parameter decides what happens when a user clicks the button:

JSON
"open_url_action": {
    "type": "OPEN_URL",
    "url": "https://example.com"
}

Line by line:

  • "open_url_action" is the name of the setting. The curly braces after it mean its value is a group of smaller settings.
  • "type": "OPEN_URL" says what kind of action this is: open a URL.
  • "url": "https://example.com" is the address to open. example.com is a placeholder domain reserved for examples, not a real site.

The documentation implies that only standard web links belong here. The real question was what the API would actually accept, because documentation describes intent and the code enforces (or fails to enforce) it.

Deeplinks are URLs for mobile apps. Instead of https:// they often use a custom scheme such as fb:// or fbinternal://, and they can tell the app to open a profile, open a feature, or perform an internal action. Most of these deeplinks are not exported, meaning they are not supposed to be triggerable by outside sources. Think of a building: the front door is exported, the staff-only corridors are not. A deeplink is a corridor address, and most of them should only be usable from inside.

The researcher created a button through the API with a Facebook deeplink in place of a normal URL:

JSON
"url": "fb://some-internal-feature"

Line by line:

  • "url" is the same setting as before, the address the button opens.
  • "fb://some-internal-feature" is not a website. fb:// is Facebook's own scheme, and some-internal-feature names an internal function. The value is a placeholder for whichever internal command the researcher tried.

The API accepted it without validation. That is the first crack: an advertiser can create an Instant Experience button that, when tapped, triggers an internal Facebook function. The report calls this a classic CSRF, because an attacker can craft the request and have a victim execute it unknowingly. The victim does the clicking; the attacker chose what the click does.

Exploitation

A CSRF is only as useful as the actions it can force. The missing validation exposed potentially thousands of internal deeplinks, so the next task was to find a gadget: a deeplink powerful enough to escalate the impact. A gadget here means a small internal feature that, on its own, looks harmless, but can be combined with the first flaw to do something much bigger. The researcher found one:

This internal deeplink appeared to be related to a Marketplace feature. More importantly, it accepted a parameter called link_url, designed to load a URL inside a specific, restricted webview within the Facebook app. The question was what values link_url would take, and in particular whether it would accept a javascript: URI. A javascript: URI is a link whose "address" is code: the browser runs it instead of navigating. The final payload was:

The report breaks the payload down into four parts:

  1. fb://...: the entry point, the CSRF that lets a private deeplink be launched from an Instant Experience button.
  2. marketplace_byog_amazon_taskless_link: the gadget, the specific vulnerable deeplink chosen to launch.
  3. ?link_url=: the parameter inside the gadget deeplink that is vulnerable to injection. The ? starts the list of parameters and link_url is the name of this one.
  4. javascript:window.location.href='...': the second vulnerability, a script injection. window.location.href is the webview's current address; assigning to it tells the webview to go somewhere else. The link_url parameter may have had restrictions on loading external domains directly, but it failed to block the javascript: scheme. The injected code's first instruction was to navigate the webview to the attacker's external site, bypassing any domain restrictions.

The chain is: CSRF via an Instant Experience button, launch a private deeplink, JS injection via link_url, webview takeover.

Step 1: Create the malicious button element

The attacker makes a POST request to /PAGE_ID/canvas_elements to create a button element containing the malicious deeplink payload.

Why: a canvas is built from elements, and the button is the element the victim will tap. PAGE_ID stands for the numeric identifier of the Facebook page the attacker controls; the report uses it as a placeholder. canvas_elements is the part of the API that manages those building blocks.

Step 2: Create the canvas

The attacker creates an empty Instant Experience canvas with a POST request to /PAGE_ID/canvases.

Why: the button has to live inside a canvas before it can be shown to anyone. Creating the canvas empty first keeps the two steps separate and simple.

Step 3: Link them together

The attacker associates the malicious button with the empty canvas. The result is a seemingly harmless Instant Experience page with a single button, which the attacker can publish and attach to an ad campaign through the Facebook Ad Network, targeting any audience.

Why: an ad is what gets the page in front of people. The attacker does not need to break into anyone's account; they only need to buy an ad like any advertiser and let people tap it.

What the victim sees

When a victim taps the ad and then the button ("Click Me!"), three things happen in the background:

  1. The Facebook app triggers the fb://marketplace... deeplink.
  2. The deeplink's handler executes the javascript: payload from the link_url parameter.
  3. The JavaScript redirects the internal webview to the attacker's site (ash-king.co.uk/webview/ in the proof of concept).

The victim is now viewing the attacker's website rendered inside the trusted UI of the Facebook app. The report describes this as a perfect setup for a convincing phishing attack to steal credentials or to deanonymise the user. Phishing works because people check whether a page looks like Facebook, not whether it truly is Facebook; a page inside the app's own window passes that check easily. Deanonymising means learning who the user really is, for example by getting them to reveal an identity the attacker did not have.

The video sent to Meta with the report to assist triage shows the chain in action:

Or watch on YouTube
YouTube video player From the original on ash-king.co.uk

Root cause

The button's open_url_action accepted a deeplink scheme without validating that the target was an external web URL, so an advertiser-controlled canvas element could invoke non-exported internal deeplinks. The gadget deeplink then passed its link_url parameter into a webview without blocking the javascript: scheme. The report notes that link_url may have had restrictions on loading external domains directly, but the scheme check was missing, so script execution was possible and the script could then navigate the webview anywhere. The design assumption that canvas buttons only point at https:// pages was never enforced at the API boundary.

In everyday terms: the front desk was told "visitors only go to the public showroom", but nobody checked the visitor's pass, so a visitor could walk into the staff corridors, and one corridor had a door that opened onto any street the visitor chose.

Impact

  • CSRF and unauthorised actions: an attacker could force a user's app to perform internal actions without consent.
  • Webview takeover and phishing: chained with the JS injection, an attacker could load any website inside Facebook's in-app browser, making phishing hard to spot.
  • Massive attack surface: the initial flaw exposed a large number of internal deeplinks, each a potential new vector. Attack surface simply means the total number of places an attacker can try to get in.

Fix

The fix was logical: if you click a canvas button in an Instant Experience that contains a non-exported deeplink, you are now redirected back to the home screen. fb:// deeplinks can still be used in the canvas_elements POST request, but only exported deeplinks will actually open when the button is tapped in the mobile app. In the building comparison: the front desk now checks the pass, and anyone heading for a staff corridor is sent back to the lobby.

Timeline as reported:

Stage Date
Reported April 28 2025
Triaged May 1 2025
Bounty awarded June 11 2025 (+$X,XXX)
Fixed July 17 2025

Triaged means the security team confirmed the report was worth investigating. The report lists the bounty as +$X,XXX.

These are the follow-up checks the write-up suggests, useful if you want to look for similar problems yourself:

  • Other button actions and parameters: try deeplink schemes in any field that takes a URL, such as open_url_action.url. A positive result is the API accepting fb:// or fbinternal:// where an https:// URL is expected.
  • Other deeplink gadgets: enumerate internal deeplinks that take a URL parameter like link_url. A positive result is a deeplink that loads the supplied value in a webview.
  • Scheme filtering on URL parameters: supply javascript:, data: and other non-HTTP schemes to parameters that load URLs. A positive result is script execution or navigation to an attacker-controlled origin. A scheme is the part before the colon, such as https or javascript; data: is another scheme that can carry content directly in the link.
  • Exported versus non-exported deeplinks: check whether non-exported deeplinks can be launched from advertiser-controlled content. A positive result is a non-exported deeplink opening from a canvas button.
  • Other advertiser-controlled surfaces: apply the same test to any component that accepts a URL and renders it in an in-app browser. A positive result is a redirect to an external site inside the trusted app UI.

Glossary

  • API: a defined way for one program to send requests to another, like a menu and waiter in a restaurant.
  • Attack surface: the total set of places and features an attacker could try to abuse.
  • Bounty: a reward a company pays someone who reports a security problem responsibly.
  • Canvas: Facebook's internal name for an Instant Experience page, built from elements such as buttons, images and videos.
  • CSRF (Cross-Site Request Forgery): making a victim's browser or app carry out an action the victim did not intend, usually by getting them to click something.
  • Deeplink: a link that opens a specific place inside a mobile app, often using a custom scheme such as fb://.
  • Endpoint: one specific address in an API that performs one specific job, such as /PAGE_ID/canvases.
  • Exported deeplink: a deeplink the app allows outside sources to trigger, like a public front door.
  • Gadget: a small internal feature that looks harmless alone but becomes powerful when combined with another flaw.
  • Graph API: Facebook's API for managing pages, ads, canvases and other objects programmatically.
  • Instant Experience: a full-screen, mobile-optimised page that opens inside the Facebook app when someone taps an ad; formerly Canvas Ads.
  • JavaScript: the programming language that runs inside web pages and webviews.
  • javascript: URI: a link whose address is code, which the browser runs instead of navigating to a page.
  • JSON: a text format for structured data, made of names and values in curly braces, used in API requests and responses.
  • Non-exported deeplink: an internal deeplink that is not supposed to be triggerable from outside the app.
  • Parameter: a named value inside a request or link, such as url or link_url.
  • Phishing: a fake page or message that impersonates something trusted in order to steal credentials or identity.
  • POST request: an API request that creates or changes something.
  • Proof of concept: a working demonstration that a vulnerability is real.
  • Scheme: the part of a link before the colon, such as https, fb or javascript, which tells the software how to handle it.
  • Triaged: confirmed by the security team as a genuine issue worth investigating.
  • Validation: checking that input matches what is expected before using it.
  • Webview: a small browser window embedded inside a mobile app.
  • Webview takeover: making an app's embedded browser display content the app's owner did not intend, under the app's trusted appearance.

More by Ash King

View all

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

Cross-site request forgery (CSRF)

The lesson behind this report.

Another site makes a signed-in user's browser perform an action they did not intend.