How I bypassed Facebook CSRF once again!
Facebook's Lead Ads Continued Flow feature automatically added the user's anti-CSRF token (fb_dtsg) to POST requests it sent to a destination URL. An attacker could create a malicious Lead Ad form that sent authenticated POST requests to Facebook endpoints, bypassing CSRF protection.
I discovered a vulnerability in Facebook Lead Ads that allowed me to create an arbitrary form capable of sending a POST request containing Facebook's anti-CSRF token to Facebook endpoints or external hosts.
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 Continued Flow feature automatically appended the user's fb_dtsg token to POST requests sent to a destination URL, and the destination URL could be controlled by the attacker, turning the feature into a CSRF primitive.
Impact
An attacker could send authenticated POST requests with the victim's Facebook CSRF token to Facebook endpoints, potentially performing state-changing actions such as disabling Timeline Review.
What the attacker needed
Attacker can create a Lead Ad form; victim interacts with the malicious form
The fix
Facebook fixed the primary issue and later fixed the whitelist bypass as well.
How it was found
- Create a Lead Ad form with Continued Flow fields added to the JSON configuration.
- Set the destination URL to a Facebook endpoint that performs a state-changing action.
- Submit the form using Facebook's Lead Ads testing tool.
- The request is executed with the victim's fb_dtsg token, performing the action.
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 makes a logged-in user's browser send a request to another site without the user's knowledge. Facebook uses a secret token (fb_dtsg) to prove requests come from its own pages. The researcher found that a Facebook feature would automatically include this token in requests to a URL the attacker could control, so the attacker could make the victim perform actions like disabling Timeline Review.
What is CSRF?
Another site makes a signed-in user's browser perform an action they did not intend.