0-Click Account Takeover on Facebook
The password reset flow for Facebook's push notification method lacked rate limiting on the endpoint that verifies the 6-digit nonce, allowing an attacker to brute-force the code. An attacker could then reset the victim's password and take over the account, though in some cases the victim needed to open a notification to generate the nonce.
Published on samiparyal.medium.com
Facebook Account Takeover
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 write-up covers a rate-limiting flaw in Facebook's password reset flow. The affected feature is the account recovery flow at facebook.com/recover/initiate, and specifically the option that sends a recovery code to the account owner's active Facebook session as a push notification (send_push_to_session_login). Normally this option lets a logged-in user confirm a reset by receiving a short numeric nonce on their own device and entering it back into the reset form.
The researcher describes the bug as a rate-limiting issue in a specific endpoint of the password reset flow that could have allowed the takeover of any Facebook account by brute-forcing a particular type of nonce. The report was submitted on 30 January 2024 and published on 27 February 2024.
Setup
The researcher set up Android Studio, went to Facebook's main login page and installed and uninstalled several versions of Facebook to look for an endpoint that was not commonly examined. The tooling used for the attack itself was Burp Suite, with the Intruder and its resource pool for concurrent requests. No specific app version, account type or victim precondition is given beyond having a Facebook account in the reset flow.
Finding it
The starting point was an out-of-the-blue decision to search for account takeover bugs, and a need for an endpoint that was untouched, hidden or unnoticed. The researcher reasoned that everybody looks at the web surface, so instead of the web login page the focus went to the Android app's main login page. Cycling through several app versions produced nothing new.
The next idea was to vary the user agent to see how the server's UI responses differed across login pages. The report notes that browser extensions can be used for this.

Somewhere in this process the password reset flow surfaced an option the researcher had seen before on another account with default settings, but which now looked worth testing:

Three observations made the option interesting:
- The nonce sent to the user stays active for longer than expected, roughly 2 hours.
- The same nonce code is sent every time during that period.
- There is no invalidation of the code after entering the correct code alongside multiple previous invalid attempts, unlike the SMS reset functionality.
Together these pointed at a brute-force attack.
Exploitation
Step 1: start the reset flow
Pick any Facebook user account and go to its password reset flow.

Step 2: choose the push-to-session recovery option
From the reset options, choose the option that sends the code to the account's session as a push notification.

This sends a POST request to:
POST /ajax/recover/initiate/ HTTP/1.1
with the parameter recover_method=send_push_to_session_login.

Step 3: submit a dummy code
Send a dummy 6-digit code, 000000.

This creates a POST request to the vulnerable endpoint:
POST /recover/code/rm=send_push_to_session_login&spc=0&fl=default_recover&wsr=0 HTTP/1.1
Step 4: locate the nonce parameter
The n parameter holds the nonce.

Step 5: brute-force the nonce
Brute-force the 6-digit value from 000000 to 999999. The researcher notes that a powerful machine would be needed to cover the whole space, and describes two ways of doing it in Burp Suite:
- Send the request to Intruder, insert a
$$placeholder in the value of thenparameter, and run 9 or more sets or tabs of concurrent payload requests, each set covering a chunk of combinations (00000 to 11111, 11111 to 22222, and so on). - Or use Burp's resource pool, setting the maximum concurrent requests between 10 and 15, which the researcher says should be sufficient to go through the entire search space in about 1 hour.
Step 6: use the matching code
There was no rate limiting on the endpoint, so the matching code came back with a 302 status code. That code is then used to log in or reset the password of the target account.
Step 7: the hidden option
In the researcher's case the option Send code via Facebook notification was hidden from the UI, possibly due to some sort of protection, but it could be bypassed by changing the IP address.

Root cause
The endpoint that validates the recovery nonce had no rate limiting. The design compounded this: the nonce stayed valid for roughly 2 hours, the same code was re-sent for that whole period, and a correct submission did not invalidate the code even after many wrong attempts, unlike the SMS path. With a 6-digit space and no throttling, the space can be walked through with enough concurrent requests.
Impact
The vulnerability enabled the full takeover of Facebook accounts. Whether it is zero-click or one-click depends on the victim:
- For some set of users, the nonce code is rendered on the notification itself, which is the zero-click case.

- For the other set, the notification has to be opened and the code is rendered on a separate screen, which is the one-click case.

Facebook said one tap of the victim is needed for the nonce to generate, and that clicking a notification is a much lower bar than clicking a link sent by an attacker, so it decided to deduct from the 0-click ATO rather than base the bounty off the 1-click ATO.

The researcher notes the vulnerability enabled full takeover of Facebook accounts and helped rank 1 in Facebook's Hall of Fame 2024 at the time of writing.

Fix
The report does not describe the code change. The timeline records that on 1 February 2024 Facebook asked for clarification and marked the issue unreproducible, and that on 2 February the researcher replied that the issue seemed fixed that day. On 22 February the researcher was rewarded, with a clarification that the issue was fixed after somebody else's report that came after the researcher's, though the researcher was the first to report it.
Variants to test
- Other recovery methods on the same flow. Try the nonce validation endpoint with each
recover_methodvalue and check whether thenparameter is throttled. A positive result is a matching code returning302after many wrong guesses. - Nonce lifetime and reuse. Request a code, wait, and submit the same code later. A positive result is the same code still being accepted hours after issue, or remaining valid after a correct submission.
- Invalidation after wrong attempts. Submit many wrong codes and then the correct one. A positive result is the correct code still being accepted, unlike the SMS path described here.
- UI-hidden options. If an option is hidden from the interface, try changing the source IP to see whether it reappears, as the researcher did.
- User-agent variation. Compare server UI responses across login pages with different user agents to surface options that are not shown by default.
Timeline
| Date | Event |
|---|---|
| Jan 30, 2024 | Report sent |
| Feb 1, 2024 | Pre-triaged |
| Feb 1, 2024 | Clarification requested by Facebook; marked unreproducible |
| Feb 2, 2024 | Clarification sent that the issue seemed fixed that day |
| Feb 9, 2024 | Invitation to BountyCon2024 (South Africa) in the same email thread |
| Feb 22, 2024 | Rewarded, with clarification that it was fixed after somebody else's later report, though the researcher was first to report |
What happened, in plain words
A security researcher found a way to take over almost any Facebook account by guessing a short number. When you forget your password, Facebook can send you a code to confirm it is really you. That code was six digits long, and the page where you type it in did not limit how many times you could guess. With a powerful machine and 10 to 15 concurrent requests, the researcher says the whole space can be covered in about an hour. Once the right number is found, the attacker can reset the victim's password and take over the account.
The researcher reported it to Meta (Facebook's parent company) on 30 January 2024, and wrote this up on 27 February 2024. Meta rewarded the report, with a deduction from the 0-click ATO because in some cases the victim has to tap a notification first.
Background concepts, from zero
Before the steps make sense, here are the ideas the report relies on.
- Account takeover (ATO): when someone else gains control of your account, usually by getting your password or a login code. It is the worst outcome for a user, because the attacker can then read messages, post as you, or lock you out.
- Password reset flow: the series of pages you go through when you click "Forgot password". Facebook offers several ways to prove it is you: a text message (SMS), an email, or a notification sent to a device where you are already logged in. The report focuses on the last one.
- Nonce: a one-time code, here six digits, that the server generates and expects you to type back. Think of it like a cloakroom ticket: the number on your ticket must match the number on the coat. If an attacker can guess the ticket number, they can walk off with the coat.
- Endpoint: a specific address on a server that accepts a particular kind of request. If a website is a building, endpoints are the individual service windows: one for logging in, one for resetting a password, one for reading messages. The report names two endpoints,
/ajax/recover/initiate/and/recover/code/rm=send_push_to_session_login&spc=0&fl=default_recover&wsr=0. - API: the set of endpoints a program talks to. When the Facebook app on your phone shows a screen, it is quietly calling these endpoints behind the scenes. You never see them in a browser address bar, but they exist.
- HTTP request: the message your browser or app sends to a server. It has a method (like
POST, meaning "here is some data, please act on it"), a path (the endpoint), and often a body with parameters. - Parameter: a named value sent with a request, like
recover_method=send_push_to_session_login. It tells the server which option you picked. - Rate limiting: a cap on how many requests a server will accept in a period of time. It is the digital equivalent of a bank teller refusing to serve you after three wrong PIN attempts. Without it, an attacker can guess as fast as their machine allows.
- Brute force: trying every possible value until one works. For a six-digit code there are one million possibilities, from
000000to999999. A human cannot do this by hand, but a script can. - Status code: a three-digit number in the server's reply that says what happened.
200means "here is the page".302means "the thing you asked for worked, go here next". In this report, a302after submitting a code meant the guess was correct. - User agent: a short string your browser or app sends to identify itself, for example "Chrome on Windows" or "Facebook app on Android". Servers sometimes show different pages depending on it, which is why the researcher tried changing it.
- Burp Suite: a tool security testers use to watch and modify the traffic between their browser or app and a server. Its Intruder feature automates sending many variations of a request, and its resource pool controls how many requests go out at once.
- IP address: the numeric address your device uses on the internet. Some protections hide features based on where the request comes from, so changing IP can change what you see.
Finding the bug
The researcher was deliberately looking for account takeover bugs, and specifically for an endpoint that was untouched, hidden or unnoticed. The reasoning was that everybody looks at the web version of Facebook, so the web login page was less likely to hold something new. Instead, the focus went to the Android app's main login page. Installing and uninstalling several versions of the app produced nothing interesting.
The next idea was to vary the user agent, to see whether the server's UI responses differed across login pages. This can be done with a proxy or with browser extensions.

Somewhere in this process, the password reset flow surfaced an option the researcher had seen before on another account with default settings, but which now looked worth testing:

Three observations made the option interesting:
- The nonce sent to the user stays active for longer than expected, roughly 2 hours.
- The same nonce code is sent every time during that period.
- There is no invalidation of the code after entering the correct code alongside multiple previous invalid attempts, unlike the SMS reset functionality.
In plain terms: the code lived too long, it never changed, and wrong guesses did not burn it. Each of those alone is a weakness; together they make guessing practical. A code that changes every time you request it, expires in a minute, and locks after five wrong tries is hard to guess. A code that stays the same for two hours and never locks is a different story.
Exploitation, step by step
Step 1: start the reset flow
Pick any Facebook user account and go to its password reset flow.

This is the normal "forgot password" screen. The attacker starts the reset flow for the chosen account; no password is needed at this stage.
Step 2: choose the push-to-session recovery option
From the reset options, choose the option that sends the code to the account's session as a push notification.

This sends a POST request to:
POST /ajax/recover/initiate/ HTTP/1.1
with the parameter recover_method=send_push_to_session_login.

Line by line:
POSTis the method. It means "I am sending data and asking you to do something with it"./ajax/recover/initiate/is the endpoint that starts the recovery process.HTTP/1.1is the version of the protocol being spoken.recover_method=send_push_to_session_logintells the server which recovery route to use: send a push notification to a session where the account is already logged in.
Why this step matters: the attacker is choosing the recovery method that produces the nonce they want to attack. The server now generates a code for the chosen recovery method.
Step 3: submit a dummy code
Send a dummy 6-digit code, 000000.

This creates a POST request to the vulnerable endpoint:
POST /recover/code/rm=send_push_to_session_login&spc=0&fl=default_recover&wsr=0 HTTP/1.1
Line by line:
POST /recover/code/is the endpoint that checks whether a submitted code is correct. This is the vulnerable one.rm=send_push_to_session_loginrepeats the recovery method, so the server knows which kind of code is being checked.spc=0,fl=default_recoverandwsr=0are extra parameters the app sends along. The report does not explain what each one means; they are part of the request as captured.
Why this step matters: the attacker needs to see the exact request the app makes when a code is submitted, because that is the request they will automate. Sending 000000 is a dummy first try that produces the request to the vulnerable endpoint.
Step 4: locate the nonce parameter
The n parameter holds the nonce.

In the captured request, the six-digit code sits in a parameter called n. That is the value the attacker will vary. Knowing exactly which field to change is what turns a captured request into an attack.
Step 5: brute-force the nonce
Brute-force the 6-digit value from 000000 to 999999. The researcher notes that a powerful machine would be needed to cover the whole space, and describes two ways of doing it in Burp Suite:
- Send the request to Intruder, insert a
$$placeholder in the value of thenparameter, and run 9 or more sets or tabs of concurrent payload requests, each set covering a chunk of combinations (00000 to 11111, 11111 to 22222, and so on). - Or use Burp's resource pool, setting the maximum concurrent requests between 10 and 15, which the researcher says should be sufficient to go through the entire search space in about 1 hour.
Why this works: one million possibilities sounds like a lot, but a computer sending many requests per second can walk through them. Splitting the work into chunks (00000 to 11111, and so on) lets several tabs run in parallel, so the total time drops. The resource pool setting controls how many requests are in flight at once.
Step 6: use the matching code
There was no rate limiting on the endpoint, so the matching code came back with a 302 status code. That code is then used to log in or reset the password of the target account.
A 302 is the server saying "correct, go ahead". Because the endpoint never said "too many attempts", the attacker could keep guessing until one came back as 302. With the right code in hand, the attacker can complete the reset and set a new password, which is the takeover.
Step 7: the hidden option
In the researcher's case the option Send code via Facebook notification was hidden from the UI, possibly due to some sort of protection, but it could be bypassed by changing the IP address.

This is a small but important detail. The option was not visible on the researcher's screen, but changing the IP address made it reappear. Hiding a button in the interface is not a security control; the server still accepts the request if you send it directly. Changing the IP address bypassed the hiding, which suggests it was based on where the request came from.
Why it worked (root cause)
The endpoint that validates the recovery nonce had no rate limiting. The design compounded this: the nonce stayed valid for roughly 2 hours, the same code was re-sent for that whole period, and a correct submission did not invalidate the code even after many wrong attempts, unlike the SMS path. With a 6-digit space and no throttling, the space can be walked through with enough concurrent requests.
In everyday terms: imagine a safe with a six-digit combination that never changes, stays open for two hours, and lets you try as many combinations as you like. The only thing standing between an attacker and the contents is time, and a computer has plenty of that.
Impact
The vulnerability enabled the full takeover of Facebook accounts. Whether it is zero-click or one-click depends on the victim:
- For some set of users, the nonce code is rendered on the notification itself, which is the zero-click case.

- For the other set, the notification has to be opened and the code is rendered on a separate screen, which is the one-click case.

"Zero-click" means the victim does nothing at all: the code appears on the notification itself. "One-click" means the victim has to tap the notification once for the code to be generated. Facebook said one tap of the victim is needed for the nonce to generate, and that clicking a notification is a much lower bar than clicking a link sent by an attacker, so it decided to deduct from the 0-click ATO rather than base the bounty off the 1-click ATO.

The researcher notes the vulnerability enabled full takeover of Facebook accounts and helped rank 1 in Facebook's Hall of Fame 2024 at the time of writing.

Fix
The report does not describe the code change. The timeline records that on 1 February 2024 Facebook asked for clarification and marked the issue unreproducible, and that on 2 February the researcher replied that the issue seemed fixed that day. On 22 February the researcher was rewarded, with a clarification that the issue was fixed after somebody else's report that came after the researcher's, though the researcher was the first to report it.
Variants to test
If you are learning from this and want to look for similar issues on a site you are allowed to test, these are the angles the report suggests:
- Other recovery methods on the same flow. Try the nonce validation endpoint with each
recover_methodvalue and check whether thenparameter is throttled. A positive result is a matching code returning302after many wrong guesses. - Nonce lifetime and reuse. Request a code, wait, and submit the same code later. A positive result is the same code still being accepted hours after issue, or remaining valid after a correct submission.
- Invalidation after wrong attempts. Submit many wrong codes and then the correct one. A positive result is the correct code still being accepted, unlike the SMS path described here.
- UI-hidden options. If an option is hidden from the interface, try changing the source IP to see whether it reappears, as the researcher did.
- User-agent variation. Compare server UI responses across login pages with different user agents to surface options that are not shown by default.
Timeline
| Date | Event |
|---|---|
| Jan 30, 2024 | Report sent |
| Feb 1, 2024 | Pre-triaged |
| Feb 1, 2024 | Clarification requested by Facebook; marked unreproducible |
| Feb 2, 2024 | Clarification sent that the issue seemed fixed that day |
| Feb 9, 2024 | Invitation to BountyCon2024 (South Africa) in the same email thread |
| Feb 22, 2024 | Rewarded, with clarification that it was fixed after somebody else's later report, though the researcher was first to report |
Glossary
- Account takeover (ATO): when an attacker gains control of someone else's account, usually by obtaining a password or a login code.
- API: the set of endpoints a program uses to talk to a server; the app's hidden service windows.
- Brute force: trying every possible value until one works, for example every six-digit number from
000000to999999. - Burp Suite: a tool for watching and modifying traffic between a browser or app and a server; includes Intruder for automated requests and a resource pool for controlling concurrency.
- HTTP request: the message a browser or app sends to a server, with a method, a path and often parameters.
- Intruder: the Burp Suite feature that sends many variations of a request automatically.
- IP address: the numeric address a device uses on the internet.
- Nonce: a one-time code, here six digits, that the server generates and expects the user to type back.
- Parameter: a named value sent with a request, such as
recover_method=send_push_to_session_login. - Password reset flow: the series of pages used to recover a forgotten password, offering methods such as SMS, email or a push notification.
- Rate limiting: a cap on how many requests a server accepts in a period of time.
- Resource pool: the Burp Suite setting that controls how many requests are sent at once.
- Status code: a three-digit number in a server's reply;
200means "here is the page",302means "it worked, go here next". - User agent: a short string a browser or app sends to identify itself, such as "Chrome on Windows" or "Facebook app on Android".
- Zero-click / one-click: whether the victim has to do nothing at all (zero-click) or tap once (one-click) for the attack to proceed.