Skip to content
Account takeover Write-up Intermediate

Meta 2FA Bypass: The $27,200 Code With No Rate Limit

A contact-point verification step in Meta Accounts Center had no rate limit, allowing unlimited guessing of a six-digit code. An attacker could confirm a victim's phone number on their own account and thereby remove SMS two-factor authentication from the victim's linked Facebook account.

Muhammad Asim Shahzad Follow

Published on masimshahzad.medium.com

Bug Bounty

Muhammad Asim Shahzad, on masimshahzad.medium.com

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

Context

Meta's Accounts Center is the surface where a user links an Instagram account and a Facebook account and manages shared settings, including contact points (email addresses and phone numbers) and two-factor authentication. In the redesigned Accounts Center that was being rolled out inside Instagram ahead of BountyCon 2022, a user could add an email address or phone number to their Instagram account and to a linked Facebook account, and the addition was confirmed with a six-digit code sent to that contact point.

The feature is meant to let a legitimate owner attach a contact point they control. The security question is what happens when someone attaches a contact point they do not control, and how many times they may try to confirm it.

Setup

The report describes the work of Nepalese researcher Gtm Mänôz (Manoj Gautam), who noticed the redesigned Accounts Center ahead of BountyCon 2022. The report does not list specific accounts, tools or versions used. The precondition that matters is that the Accounts Center feature was in limited rollout: Meta initially could not reproduce the bug because the feature was missing from its test accounts.

Finding it

Mänôz noticed that the new Accounts Center let users add an email or phone number to Instagram and a linked Facebook account, confirmed by a six-digit code. Six digits means one million possibilities, which is only a problem if the server stops a guesser early. The confirmation step had no rate limit at all, so a code could be guessed as many times as an attacker liked.

That is the whole finding at the design level: a verification endpoint that gates a security-relevant change, with no restriction on excessive attempts.

Exploitation

The report deliberately omits request details and reproduction steps, so there are no HTTP requests or responses to reproduce here. The flow it describes is:

Step 1: Add the victim's contact point to the attacker's account

The attacker adds a victim's known phone number to their own account through the Accounts Center flow. The server issues a six-digit confirmation code to that number.

Step 2: Guess the code without limit

Because the confirmation step had no rate limit, the attacker keeps submitting guesses until the code matches. One million possibilities is trivial when nothing throttles or burns the challenge.

Step 3: The contact point is treated as confirmed by the attacker

Once the guess succeeds, Meta treated the number as confirmed by the attacker. From that point the attacker's claim on the contact point is accepted by the platform.

Step 4: The victim's 2FA is affected

If the victim had that number fully confirmed with 2FA on, Facebook turned their 2FA off. If the number was used only for 2FA, it was revoked and removed. In both cases the victim loses SMS two-factor authentication without any interaction.

The same flaw also let attackers confirm email addresses and phone numbers they did not own, on Instagram and on Facebook.

Root cause

The mistake is a missing rate limit on a contact-point verification code, mapped analytically to CWE-307 (Improper Restriction of Excessive Authentication Attempts) and CWE-287 (Improper Authentication). A six-digit secret is only as strong as the attempt limit behind it; with no limit, the code space is exhaustible.

The design compounds the problem: the verification flow controls recovery and 2FA factors, and claiming a contact point that is already verified elsewhere should not silently move a security factor. Existing defences did not stop it because the confirmation endpoint itself had no attempt budget.

Impact

SMS 2FA is the safety net for phished or reused passwords. Removing it silently turns a leaked password into account takeover, and it hits the users who did everything right. An attacker who knows only the victim's phone number can strip SMS 2FA from linked Facebook accounts, and can confirm email addresses and phone numbers they do not own on Instagram and Facebook.

Meta later told press the bug was caught during a small public test, with no evidence of abuse. Accounts Center was still in limited rollout at the time, which limited exposure and also delayed reproduction on Meta's side.

Fix

Meta fixed the issue in October 2022. The report does not describe the code change. Its own defensive analysis proposes three controls:

  1. Budget each code: a handful of attempts per challenge, then the code is burned and a fresh one is required.
  2. Limit by account and by target: per-IP limits alone fail against distributed guessing, so cap attempts per user and per phone number or email.
  3. Never move a 2FA factor silently: claiming a contact point that is already verified elsewhere should notify the current owner and require step-up.

The report includes this illustrative implementation of those ideas:

Python
MAX_TRIES = 5def verify_contact_code(user, challenge, submitted):    if challenge is None or challenge.owner != user.id or challenge.expired():        return "invalid"    if challenge.attempts >= MAX_TRIES:        challenge.burn()                                  return "too_many_attempts"    if limiter.exceeded("user", user.id) or limiter.exceeded("target", challenge.target):        return "slow_down"                            challenge.attempts += 1                           if not constant_time_equal(challenge.code_hash, hash_code(submitted)):        return "wrong_code"    if challenge.target_verified_by_someone_else():        notify_owner(challenge.target)                    return "step_up_required"    challenge.consume()    return "linked"

The function checks ownership and expiry of the challenge, burns it after MAX_TRIES attempts, applies per-user and per-target limits, compares the submitted code in constant time, and requires step-up with owner notification when the target is already verified by someone else.

Variants to test

  • Contact-point add flows on other platforms: add an email or phone number you do not own and submit wrong codes repeatedly. A positive result is that the challenge is never burned and guesses keep being accepted.
  • Per-IP-only throttles: rotate source addresses and keep guessing. A positive result is that the per-IP limit resets while the challenge stays alive, showing there is no per-user or per-target cap.
  • Silent factor moves: claim a contact point already verified by another account. A positive result is that the claim succeeds without notifying the current owner or requiring step-up.
  • Recovery and 2FA endpoints reached through new UI surfaces: check whether a newly shipped surface that can change security factors enforces the same attempt limits as login.

Key takeaways

  • A six-digit code is only as strong as the attempt limit behind it.
  • Rate limits belong on every verification endpoint, including the "add a contact" flows that quietly control recovery and 2FA.
  • New UI surfaces reuse old trust: if they can change security factors, they need the same protections as login.

The finding was reported in September 2022 and paid $27,200 in total: an initial award for the Instagram verification bypass, then an additional amount for the 2FA impact under Meta's new payout guidelines. Meta's bug bounty program does not issue CVEs for its own web services, so there is no CVE.

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

What happened, in plain words

Imagine your house key is hidden under a doormat, and the lock on the door lets anyone try a new key as many times as they want, all night long. Eventually someone finds the right key. That is roughly what happened here, except the "door" was your Facebook account's two-factor authentication, and the "key" was a six-digit number.

Meta runs a feature called the Accounts Center. It is the place where you connect an Instagram account to a Facebook account and manage the settings they share, such as the email addresses and phone numbers attached to them, and whether two-factor authentication is switched on. Two-factor authentication, usually shortened to 2FA, is the second proof of identity you give at login after your password, most often a short code sent to your phone by text message. It exists so that a stolen password alone is not enough to get into your account.

In the redesigned Accounts Center that Meta was testing inside Instagram before an event called BountyCon 2022, you could add an email address or a phone number to your Instagram account and to a linked Facebook account. To prove the address or number was really yours, the system sent a six-digit code to it, and you typed the code back in.

A Nepalese researcher, Gtm Mänôz (Manoj Gautam), noticed that this confirmation step had no limit on how many times you could guess. Six digits sounds like a lot, but there are only one million possible combinations, and a computer can try them very quickly if nothing stops it. Because nothing did, an attacker who knew only a victim's phone number could add that number to their own account, keep guessing until the code matched, and then the platform treated the number as belonging to the attacker. If the victim had that number set up with 2FA, Facebook switched their 2FA off. If the number was used only for 2FA, it was removed entirely. The victim did nothing wrong.

Meta fixed the problem in October 2022 and paid $27,200 in total. The report deliberately leaves out the exact requests and reproduction steps, so this article does too.

AI-generated illustration From the original on masimshahzad.medium.com

AI-generated illustration

The pieces you need to know first

Before the details make sense, a few everyday ideas need explaining.

A server and a browser. Your browser is the program on your computer that shows web pages. The server is the computer far away that stores the accounts and decides who is allowed to do what. When you fill in a form and press a button, your browser sends a message to the server, and the server sends an answer back.

An endpoint. An endpoint is simply a specific address on the server that does one job, like a counter in a shop that handles one kind of request. One endpoint might handle logging in, another might handle changing your password, another might handle adding a phone number. When security people talk about an endpoint, they mean "the piece of the service that performs this action".

A rate limit. A rate limit is a cap on how often something may be done in a period of time. Think of a cash machine that lets you try your card three times and then keeps the card. The limit is what makes guessing impractical. Without a limit, guessing becomes a matter of patience and computing power.

A contact point. A contact point is an email address or a phone number that the platform can use to reach you. It matters for security because it is where your 2FA codes and account recovery messages go. Whoever controls your contact point can, in many systems, take over your account.

A verification code. A verification code is a short number the server sends to a contact point to prove that whoever is adding it can actually receive messages there. If you can read the code, you control the address or number.

Two-factor authentication (2FA). 2FA means logging in needs two things: something you know (your password) and something you have (your phone, which receives the code). SMS 2FA is the version where the code arrives by text message.

Account takeover. Account takeover means someone else gets into your account and controls it as if they were you. It is the outcome all of this is trying to prevent.

A bug bounty program. A bug bounty program is a scheme where a company pays independent researchers for finding and reporting security flaws responsibly, instead of exploiting them. Meta runs one of the largest.

A CVE. A CVE is a public catalogue number given to a known security flaw so people can refer to it unambiguously. Meta's bug bounty program does not issue CVEs for its own web services, so this finding has none.

CWE-307 and CWE-287. These are catalogue entries for categories of mistake. CWE-307 is "Improper Restriction of Excessive Authentication Attempts", which is the formal name for "no limit on guessing". CWE-287 is "Improper Authentication", the broader category of getting identity checks wrong. The report maps the bug to these two categories as an analysis, not as an official label from Meta.

The setup

The report describes the work of Gtm Mänôz (Manoj Gautam), who spotted the redesigned Accounts Center ahead of BountyCon 2022. The report does not list the specific accounts, tools or software versions he used.

The one precondition that matters is that the Accounts Center feature was only in limited rollout, meaning it was switched on for a small group of users rather than everybody. This detail explains something odd: Meta at first could not reproduce the bug, because the feature was not present on the test accounts its own staff were using. A bug that only exists on a feature most people cannot see is easy to miss and hard to confirm.

Finding it

Mänôz noticed that the new Accounts Center let a user add an email address or phone number to Instagram and to a linked Facebook account, and that the addition was confirmed with a six-digit code.

Six digits means one million possibilities. That is only a problem if the server stops a guesser early. If the server allows, say, five attempts and then throws the code away, one million possibilities is far beyond reach. If the server allows unlimited attempts, one million possibilities is nothing.

The confirmation step had no rate limit at all. A code could be guessed as many times as an attacker liked.

That is the whole finding at the design level: a verification endpoint that guards a security-relevant change, with no restriction on excessive attempts. The security question the feature should have answered is: what happens when someone attaches a contact point they do not control, and how many times may they try to confirm it? The answer turned out to be "they can attach it, and they can try forever".

How the attack worked

The report deliberately omits request details and reproduction steps, so there are no HTTP requests or responses to show here. What it does describe is the sequence of events.

Step 1: Add the victim's contact point to the attacker's account

The attacker adds a victim's known phone number to their own account through the Accounts Center flow. The server, doing exactly what it is designed to do, sends a six-digit confirmation code to that number.

Why this step matters: the attacker does not need to control the phone. They only need to know the number. The server will happily send the code to the real owner's phone, and the attacker's job is then to guess what was sent.

Step 2: Guess the code without limit

Because the confirmation step had no rate limit, the attacker keeps submitting guesses until the code matches. One million possibilities is trivial when nothing throttles the attempts or cancels the challenge.

Why this step matters: this is the heart of the bug. Every other step depends on the attacker being able to keep guessing. If the server had burned the code after a handful of wrong tries, the attack would have stopped here.

Step 3: The contact point is treated as confirmed by the attacker

Once the guess succeeds, Meta treated the number as confirmed by the attacker. From that point on, the platform accepts the attacker's claim on the contact point.

Why this step matters: the platform has now been convinced that the attacker controls a phone number that actually belongs to someone else. Everything that follows flows from that false belief.

Step 4: The victim's 2FA is affected

If the victim had that number fully confirmed with 2FA on, Facebook turned their 2FA off. If the number was used only for 2FA, it was revoked and removed. In both cases the victim loses SMS two-factor authentication without any interaction at all.

Why this step matters: the victim did not click anything, approve anything or share anything. Their protection simply disappeared because someone else proved control of their number.

The same flaw also let attackers confirm email addresses and phone numbers they did not own, on Instagram and on Facebook.

Why it worked

The mistake is a missing rate limit on a contact-point verification code. A six-digit secret is only as strong as the attempt limit behind it. With no limit, the space of possible codes can be exhausted, which is exactly what CWE-307 describes.

The design made it worse. The verification flow controls recovery and 2FA factors, which are the most sensitive settings an account has. And claiming a contact point that is already verified elsewhere should not silently move a security factor: the platform should notify the current owner and require step-up.

Existing defences did not stop it because the confirmation endpoint itself had no attempt budget. There was nothing to trigger.

What it meant for real people

SMS 2FA is the safety net for phished or reused passwords. Many people reuse the same password on several sites, and many fall for fake login pages. 2FA is what saves them when that happens, because the attacker still needs the code from their phone.

Removing 2FA silently turns a leaked password into a full account takeover. It hits the users who did everything right: the ones who switched 2FA on precisely because they were being careful.

An attacker who knows only the victim's phone number can strip SMS 2FA from linked Facebook accounts, and can confirm email addresses and phone numbers they do not own on Instagram and Facebook.

Meta later told press the bug was caught during a small public test, with no evidence of abuse. The limited rollout limited the exposure, and it also delayed reproduction on Meta's side.

The fix

Meta fixed the issue in October 2022. The report does not describe the code change Meta made. Its own defensive analysis proposes three controls.

  1. Budget each code. Allow a handful of attempts per challenge, then burn the code and require a fresh one. This is the cash-machine idea: a few tries, then the card is kept.
  2. Limit by account and by target. Per-IP limits alone fail against distributed guessing, so cap attempts per user and per phone number or email. An IP address is the numeric label of a computer on the internet; an attacker with many computers can look like many different visitors, so a limit based only on IP address is easy to dodge.
  3. Never move a 2FA factor silently. Claiming a contact point that is already verified elsewhere should notify the current owner and require step-up. Step-up means asking for extra proof before a sensitive change goes through.

The report includes this illustrative implementation of those ideas:

Python
MAX_TRIES = 5def verify_contact_code(user, challenge, submitted):    if challenge is None or challenge.owner != user.id or challenge.expired():        return "invalid"    if challenge.attempts >= MAX_TRIES:        challenge.burn()                                  return "too_many_attempts"    if limiter.exceeded("user", user.id) or limiter.exceeded("target", challenge.target):        return "slow_down"                            challenge.attempts += 1                           if not constant_time_equal(challenge.code_hash, hash_code(submitted)):        return "wrong_code"    if challenge.target_verified_by_someone_else():        notify_owner(challenge.target)                    return "step_up_required"    challenge.consume()    return "linked"

Line by line, in plain words:

  • MAX_TRIES = 5 sets the budget: five attempts per challenge, no more.
  • def verify_contact_code(user, challenge, submitted): defines the function that checks a submitted code. It receives three things: the user making the request, the challenge (the record of this particular code request), and the code the user typed.
  • if challenge is None or challenge.owner != user.id or challenge.expired(): checks three things at once. Is there a challenge at all? Does it belong to this user? Has it expired? If any answer is wrong, the next line returns "invalid" and nothing else happens. This stops one user from answering another user's challenge.
  • if challenge.attempts >= MAX_TRIES: checks whether the budget is used up. If it is, challenge.burn() destroys the code so it can never be used, and the function returns "too_many_attempts". This is the missing rate limit, added.
  • if limiter.exceeded("user", user.id) or limiter.exceeded("target", challenge.target): asks a separate limiter whether this user, or this phone number or email, has been tried too often recently. If either has, the function returns "slow_down". This is the per-account and per-target limit, which survives an attacker switching computers.
  • challenge.attempts += 1 records that one more attempt has been made, so the budget counts down.
  • if not constant_time_equal(challenge.code_hash, hash_code(submitted)): compares the stored code with the submitted one. hash_code turns the submitted code into a scrambled fingerprint, and constant_time_equal compares the two fingerprints in a way that takes the same amount of time whether they match or not, so an attacker cannot learn from timing. If they do not match, the function returns "wrong_code".
  • if challenge.target_verified_by_someone_else(): checks whether this phone number or email is already verified by a different account. If so, notify_owner(challenge.target) warns the real owner and the function returns "step_up_required", meaning extra proof is needed before the change goes through. This is the "never move a 2FA factor silently" rule.
  • challenge.consume() marks the challenge as used, so it cannot be replayed, and return "linked" reports success.

How to look for the same mistake elsewhere

The report suggests a few things to test, in the spirit of the same bug. These are checks a security tester would run, not instructions for attacking anyone.

  • Contact-point add flows on other platforms. Add an email address or phone number you do not own and submit wrong codes repeatedly. A positive result is that the challenge is never burned and guesses keep being accepted.
  • Per-IP-only throttles. Rotate source addresses and keep guessing. A positive result is that the per-IP limit resets while the challenge stays alive, showing there is no per-user or per-target cap.
  • Silent factor moves. Claim a contact point already verified by another account. A positive result is that the claim succeeds without notifying the current owner or requiring step-up.
  • Recovery and 2FA endpoints reached through new UI surfaces. Check whether a newly shipped surface that can change security factors enforces the same attempt limits as login.

Key takeaways

  • A six-digit code is only as strong as the attempt limit behind it.
  • Rate limits belong on every verification endpoint, including the "add a contact" flows that quietly control recovery and 2FA.
  • New UI surfaces reuse old trust: if they can change security factors, they need the same protections as login.

The finding was reported in September 2022 and paid $27,200 in total: an initial award for the Instagram verification bypass, then an additional amount for the 2FA impact under Meta's new payout guidelines.

Glossary

  • 2FA (two-factor authentication): logging in with two separate proofs of identity, usually a password plus a code sent to your phone.
  • Account takeover: someone else gaining control of your account and acting as you.
  • Accounts Center: Meta's feature for linking an Instagram account and a Facebook account and managing shared settings, including contact points and 2FA.
  • BountyCon: a security conference mentioned in the report as the event the researcher was preparing for.
  • Bug bounty program: a scheme where a company pays researchers for responsibly reporting security flaws.
  • Burn (a code): to invalidate a verification code so it can never be accepted, usually after too many wrong attempts.
  • Challenge: the record of one verification attempt, holding the code, who requested it and how many tries have been made.
  • Constant-time comparison: comparing two values in a way that takes the same time whether they match or not, so timing gives nothing away.
  • Contact point: an email address or phone number attached to an account, used for codes and recovery.
  • CVE: a public catalogue number for a known security flaw.
  • CWE-287: the catalogue category "Improper Authentication", covering mistakes in checking identity.
  • CWE-307: the catalogue category "Improper Restriction of Excessive Authentication Attempts", the formal name for having no limit on guessing.
  • Endpoint: a specific address on a server that performs one job, such as confirming a code.
  • Hash: a scrambled fingerprint of a value, used so the original does not have to be stored in plain form.
  • IP address: the numeric label of a computer on the internet, used to route traffic.
  • Limited rollout: a feature switched on for a small group of users rather than everyone.
  • Per-IP limit: a cap on attempts counted by IP address, which an attacker can dodge by using many addresses.
  • Rate limit: a cap on how many times an action may be performed in a period of time.
  • Server: the remote computer that stores accounts and decides what is allowed.
  • SMS 2FA: two-factor authentication where the code arrives by text message.
  • Step-up: asking for extra proof before a sensitive change is allowed.
  • Verification code: a short number sent to a contact point to prove the requester can receive messages there.
  • Vulnerability: a weakness in a system that an attacker could use to do something harmful.

More by Muhammad Asim Shahzad

View all

21 more disclosed reports, best first.

Similar reports

View all

Same bug class and techniques, clearest first.

Account takeover

The lesson behind this report.

Getting into someone else's account through a flaw in sign-in, password reset, second factor, single sign-on or session handling.