Skip to content
CSRF Write-up Intermediate

How I bypassed Facebook CSRF Protection

Facebook's AsyncDialog feature generated an internal POST request to a path controlled by the show_dialog_uri parameter, automatically including a valid anti-CSRF token. An attacker could use this to send authenticated requests to other Facebook endpoints, bypassing CSRF protection and potentially enabling account takeover.

Pouya Follow

Published on darabi.me

I discovered a vulnerability in Facebook's Ads Manager flow that could be abused to bypass Facebook's CSRF protection and trigger authenticated actions on behalf of a logged-in user.

Pouya, on darabi.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.

Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.

How it worked

Root cause

Likely the AsyncDialog functionality trusted the user-supplied show_dialog_uri parameter to construct an internal request and automatically attached a valid CSRF token, without properly restricting the destination path.

Impact

An attacker could trigger security-sensitive authenticated actions such as changing account language, adding a new email address (potentially leading to account takeover), disabling login approvals, or logging out sessions.

What the attacker needed

Victim is logged in to Facebook; victim visits a crafted link

The fix

Facebook initially restricted show_dialog_uri to a specific prefix, then after a bypass, blocked the second technique and ultimately removed the vulnerable show_dialog_uri behavior.

How it was found

  1. Visit a crafted Facebook URL with a show_dialog_uri parameter pointing to a different Facebook endpoint.
  2. The page loads and Facebook generates an internal POST request to the path in show_dialog_uri, including a valid fb_dtsg token.
  3. The request performs the action on the target endpoint (e.g., adding an email address) as the logged-in user.

Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.

Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.

CSRF (Cross-Site Request Forgery) is when a malicious site tricks a logged-in user's browser into sending a request to another site, like changing their email. Facebook uses a secret token (fb_dtsg) to block such requests. The researcher found a way to make Facebook itself send a request with that token to a destination the attacker chose, so the protection was bypassed.

What is CSRF?

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

More by Pouya

View all

5 more disclosed reports, best first.

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.