Skip to content
Account takeover Write-up Intermediate

The Phone Number That Unlocked Any Tinder Account

Facebook's Account Kit did not bind a one-time code to the phone number it was sent to, and Tinder's login API accepted Account Kit tokens without checking which app they were issued for. An attacker could combine their own valid code with a victim's phone number to obtain a token for the victim's identity and log into their Tinder account.

medium.com

Published on medium.com

Bug Bounty

Muhammad Asim Shahzad, on 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. 4 min read.

Context

Tinder offered a passwordless "Log in with phone number" option, and the phone verification behind it was handled by Facebook's Account Kit. Account Kit texted a code to the number, confirmed it, and returned an access token that Tinder then exchanged for a session. The whole login therefore rested on two trust decisions: that Account Kit only confirms a code against the number it was sent to, and that Tinder only accepts tokens minted for Tinder.

In February 2018 Anand Prakash published a chain in which both decisions failed. The write-up below is an analytical case study of that public disclosure, not a first-hand discovery, and the reproduction details are deliberately left out of the source. Both issues were fixed in 2018.

AI-generated illustration From the original on medium.com

Setup

The preconditions are:

Finding it

Two observations combined. First, in one of Account Kit's phone-confirmation paths, the service did not verify that the submitted code belonged to the phone number submitted in the same request. Second, an Account Kit token carries the ID of the app it was issued to, and Tinder's login API accepted the token without checking that ID.

Each looked wrong on its own. The first means a code proves possession of some phone, not of the phone in the request. The second means a token proves that Account Kit signed something, not that it signed it for Tinder. Chained, they collapse the login to a single known value: the victim's phone number.

Exploitation

Step 1: obtain a valid code for the attacker's own number

This code is valid, but it belongs to the attacker.

Step 2: pair the attacker's code with the victim's number

In the affected confirmation path, Account Kit did not check that the code matched the number in the same request. Account Kit accepts the pair and issues a token for the victim's identity.

Step 3: present the token to Tinder

It does not check the app ID the token was issued to, so a token minted for the attacker's Account Kit app is accepted as a Tinder login.

No request or response captures are reproduced in the source; the parameters and reproduction details were intentionally omitted.

Root cause

Two independent failures, either of which would have broken the chain.

OTP not bound to the identifier. The confirmation step treated a valid code as proof of possession of whichever number accompanied it in the request, rather than of the number the code was sent to. A correct implementation stores the code together with the number, the purpose and the flow it was issued for, and compares all of them on confirmation.

Missing token audience check. Tinder validated the token but not its audience. A token signed by Account Kit is valid for the app it was issued to; accepting one issued to any Account Kit app turns every relying party into a shared front door. "Validly signed" is not "meant for me".

Existing defences did not help because each side trusted the other's output: Account Kit trusted the request's pairing of code and number, and Tinder trusted the provider's signature without reading the claims inside it. Outsourcing login moves the code, not the responsibility.

Impact

Per the researcher, an attacker gained full control of the victim's Tinder account: private messages, personal details, and swiping on the victim's behalf. On a dating app that means intimate data and impersonation in front of strangers. The only precondition was that the victim used phone-number login. The Verge reported no evidence the bug was exploited before the fix.

Facebook paid $5,000 and Tinder paid $1,250, $6,250 in total. Both companies fixed their side quickly. No CVE was reported and no severity or CVSS score was published.

Fix

Both sides were fixed in 2018; the source does not describe the patches themselves. The defensive measures it sets out are:

  1. Bind every OTP to exactly one identifier and one flow. Store the code with the number, purpose and flow ID it was sent for, and compare all of them on confirmation.
  2. Validate the token's audience, not just its signature. Confirm the token was issued to your app ID, for the expected user, and is still valid, using the provider's verification endpoint or claims.
  3. Treat third-party identity as a trust boundary. A provider bug becomes your takeover if you accept anything it signs. Notify users of new-device logins and step up checks before exposing chats.

The source illustrates both with pseudocode:

Text
# Pseudocode: OTP confirmation bound to number + flow
def confirm_otp(flow_id, phone, code):
    rec = otp_store.get(flow_id)
    if (rec is None or rec.expired() or rec.attempts >= 5
            or rec.phone != normalize(phone)
            or not constant_time_eq(rec.code_hash, hash(code))):
        otp_store.bump_attempts(flow_id)
        raise AuthFailed()
    otp_store.delete(flow_id)            # single use
    return issue_identity_token(sub=rec.phone, aud=rec.app_id)
Text
# Pseudocode: relying-party login that checks audience
def login_with_provider_token(token):
    info = provider.verify(token)        # signature, expiry, revocation
    if info.app_id != MY_APP_ID:
        raise AuthFailed("token issued to another app")
    user = users.find_by_verified_phone(info.subject)
    return create_session(user, risk=assess_device(user))

Variants to test

  1. OTP and identifier mismatch. A positive result is a token or session issued for the other identifier.
  2. Cross-app token reuse. A positive result is a session on the target, which means the audience claim is not checked.
  3. Audience claim tampering. If the target accepts a token whose audience names another app, the check is missing or wrong.
  4. Flow ID reuse. A positive result shows the code is not bound to its flow.
  5. Attempt limits. If attempts are not capped or the record is not invalidated, brute force against short codes becomes practical.
  6. Provider trust boundary. A positive result is acceptance of a token the provider would reject, for example an expired or revoked one.

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

What happened, in plain words

In 2018, Tinder let people sign in without a password. You typed your phone number, Facebook's Account Kit sent you a text message with a short code, you typed the code back, and you were in. The part that sent and checked the text message was not built by Tinder: it was a Facebook service called Account Kit, which does phone-number verification for apps.

A security researcher, Anand Prakash, found that two separate checks were missing, one on each side, and that the two gaps fitted together perfectly. The result was that anyone who knew your phone number could get into your Tinder account: read your private messages, see your personal details, and swipe as if they were you. Facebook paid him $5,000 and Tinder paid him $1,250. Both companies fixed their side quickly. The Verge reported that there was no evidence anyone had used the bug before it was fixed.

This article walks through that chain slowly, explaining every piece from scratch. It is an analytical case study of a public disclosure, not a first-hand discovery, and the original write-up deliberately leaves out the exact requests and parameters used.

AI-generated illustration From the original on medium.com

AI-generated illustration

The pieces you need to know first

Before the bug makes sense, four everyday ideas need to be clear.

An API is the way one piece of software talks to another. Think of a restaurant: you do not walk into the kitchen, you tell the waiter what you want and the waiter brings it back. An API is the waiter. Tinder's app does not check phone codes itself; it asks Account Kit through an API, and Account Kit answers.

A token is a short piece of text that a service hands out to prove something. Think of a cloakroom ticket: you hand in your coat, you get a ticket, and later the ticket gets your coat back. The ticket does not contain your coat; it is a reference that the cloakroom recognises. In login systems, a token is what the app stores after you prove who you are, so it does not have to ask you for the code again on every screen.

An OTP (one-time password) is the short code sent by text message. It is meant to prove one thing only: that whoever typed it is holding the phone that received it.

Account takeover means someone else ends up logged in as you. Not a copy of your data, not a guess at your password: an actual session, the same as if they had your phone in their hand.

The setup

The preconditions were:

The attacker only needs to know a phone number and to have a phone of their own.

Finding it

Two observations combined.

First, in one of Account Kit's phone-confirmation paths, the service did not verify that the submitted code belonged to the phone number submitted in the same request. In plain terms: when you send a code and a phone number together, Account Kit checked that the code was real, but not that it was the code for that number.

Second, an Account Kit token carries the ID of the app it was issued to. Tinder's login API accepted the token without checking that ID. In plain terms: the token says "this person proved their phone number to app number 12345", and Tinder read the first half and ignored the second.

Each looked wrong on its own. The first means a code proves possession of some phone, not of the phone in the request. The second means a token proves that Account Kit signed something, not that it signed it for Tinder. Chained, they collapse the login to a single known value: the victim's phone number.

Exploitation, step by step

Step 1: obtain a valid code for the attacker's own number

This code is valid, but it belongs to the attacker.

Why this step?

Step 2: pair the attacker's code with the victim's number

In the affected confirmation path, Account Kit did not check that the code matched the number in the same request. Account Kit accepts the pair and issues a token for the victim's identity.

Why this works: The code was real, the number was the victim's, and the two were never compared. The token that came back says "this is the person who owns the victim's number", which is exactly what Tinder wanted to hear.

Step 3: present the token to Tinder

It does not check the app ID the token was issued to, so a token minted for the attacker's Account Kit app is accepted as a Tinder login.

Why this works: the token was genuinely issued by Account Kit, so its signature was valid. Tinder accepted the token without checking the app ID it was issued to. A token issued to the attacker's app and a token issued to Tinder's app look equally valid if you only check the signature.

No request or response captures are reproduced in the source; the parameters and reproduction details were intentionally omitted.

Root cause

Two independent failures, either of which would have broken the chain.

OTP not bound to the identifier. The confirmation step treated a valid code as proof of possession of whichever number accompanied it in the request, rather than of the number the code was sent to. A correct implementation stores the code together with the number, the purpose and the flow it was issued for, and compares all of them on confirmation.

Think of a hotel: the receptionist gives you a key card for room 412. If the receptionist only checks that the card is a real hotel card, and not that it is your card for that room, then any guest's card opens any door.

Missing token audience check. Tinder validated the token but not its audience. A token signed by Account Kit is valid for the app it was issued to; accepting one issued to any Account Kit app turns every relying party into a shared front door. "Validly signed" is not "meant for me".

Think of a letter with a wax seal. The seal proves the letter really came from the sender. It does not prove the letter was addressed to you. If you open every sealed letter that arrives, anyone who can get the sender to write to them can write to you.

Existing defences did not help because each side trusted the other's output: Account Kit trusted the request's pairing of code and number, and Tinder trusted the provider's signature without reading the claims inside it. Outsourcing login moves the code, not the responsibility.

Impact

Per the researcher, an attacker gained full control of the victim's Tinder account: private messages, personal details, and swiping on the victim's behalf. On a dating app that means intimate data and impersonation in front of strangers. The only precondition was that the victim used phone-number login. The Verge reported no evidence the bug was exploited before the fix.

Facebook paid $5,000 and Tinder paid $1,250, $6,250 in total. Both companies fixed their side quickly. No CVE was reported and no severity or CVSS score was published.

Fix

Both sides were fixed in 2018; the source does not describe the patches themselves. The defensive measures it sets out are:

  1. Bind every OTP to exactly one identifier and one flow. Store the code with the number, purpose and flow ID it was sent for, and compare all of them on confirmation.
  2. Validate the token's audience, not just its signature. Confirm the token was issued to your app ID, for the expected user, and is still valid, using the provider's verification endpoint or claims.
  3. Treat third-party identity as a trust boundary. A provider bug becomes your takeover if you accept anything it signs. Notify users of new-device logins and step up checks before exposing chats.

The source illustrates both with pseudocode. Pseudocode is not a real program; it is a sketch of the logic, written so a human can read it.

Text
# Pseudocode: OTP confirmation bound to number + flow
def confirm_otp(flow_id, phone, code):
    rec = otp_store.get(flow_id)
    if (rec is None or rec.expired() or rec.attempts >= 5
            or rec.phone != normalize(phone)
            or not constant_time_eq(rec.code_hash, hash(code))):
        otp_store.bump_attempts(flow_id)
        raise AuthFailed()
    otp_store.delete(flow_id)            # single use
    return issue_identity_token(sub=rec.phone, aud=rec.app_id)

Line by line:

  • def confirm_otp(flow_id, phone, code): declares a function that receives three things: which confirmation attempt this is (flow_id), the phone number the user claims, and the code they typed.
  • rec = otp_store.get(flow_id) looks up the stored record for this attempt. The record is what was saved when the code was sent: which number it went to, when it expires, how many tries have been made, and a scrambled form of the code.
  • The if block is the heart of the fix. It rejects the attempt if the record does not exist (rec is None), if it has expired, if there have been five or more attempts, if the phone number in the request does not match the number stored in the record, or if the code does not match the stored one.
  • constant_time_eq compares the scrambled code in a way that takes the same amount of time whether it matches or not, so an attacker cannot learn the code by measuring how long the comparison takes.
  • otp_store.bump_attempts(flow_id) counts the failed try, so repeated guessing hits the limit.
  • raise AuthFailed() stops the login.
  • otp_store.delete(flow_id) removes the record after a successful check, so the same code cannot be used twice.
  • return issue_identity_token(sub=rec.phone, aud=rec.app_id) hands back a token that names the verified phone number (sub) and the app it was issued for (aud, the audience). That second field is what Tinder should have been reading.
Text
# Pseudocode: relying-party login that checks audience
def login_with_provider_token(token):
    info = provider.verify(token)        # signature, expiry, revocation
    if info.app_id != MY_APP_ID:
        raise AuthFailed("token issued to another app")
    user = users.find_by_verified_phone(info.subject)
    return create_session(user, risk=assess_device(user))

Line by line:

  • def login_with_provider_token(token): declares the login function on Tinder's side, which receives the token the user presented.
  • info = provider.verify(token) asks Account Kit to confirm the token is genuine, has not expired, and has not been revoked. This is the check Tinder already had.
  • if info.app_id != MY_APP_ID: is the check Tinder was missing. It compares the app the token was issued to against Tinder's own app ID.
  • raise AuthFailed("token issued to another app") rejects the login when the token belongs to someone else's app.
  • user = users.find_by_verified_phone(info.subject) finds the account belonging to the verified phone number inside the token.
  • return create_session(user, risk=assess_device(user)) creates the logged-in session, while also scoring how risky the device looks, so an unusual new device can be treated with more caution.

Variants to test

These are the same ideas applied to other sites, written for someone learning to test.

  1. OTP and identifier mismatch. A positive result is a token or session issued for the other identifier.
  2. Cross-app token reuse. A positive result is a session on the target, which means the audience claim is not checked.
  3. Audience claim tampering. If the target accepts a token whose audience names another app, the check is missing or wrong.
  4. Flow ID reuse. A positive result shows the code is not bound to its flow.
  5. Attempt limits. If attempts are not capped or the record is not invalidated, brute force against short codes becomes practical.
  6. Provider trust boundary. A positive result is acceptance of a token the provider would reject, for example an expired or revoked one.

Glossary

  • API: the agreed way for one piece of software to ask another for something, like a waiter carrying orders between you and the kitchen.
  • Account Kit: a Facebook service that verifies phone numbers for other apps by sending text-message codes.
  • Account takeover: a situation where an attacker ends up logged in as another person and can act as them.
  • Audience (aud): the field in a token naming which app the token was issued for.
  • Authentication: proving who you are, for example by entering a code sent to your phone.
  • Brute force: trying many guesses quickly until one works.
  • Constant-time comparison: comparing two values in a way that takes the same time whether they match or not, so timing cannot leak information.
  • CVE: a public catalogue number given to a known security flaw; none was reported here.
  • CVSS: a scoring system for how severe a flaw is; no score was published here.
  • CWE-287: a category label for improper authentication, used here as an analytical mapping rather than a label from the source.
  • CWE-345: a category label for insufficient verification of data authenticity, likewise an analytical mapping.
  • Flow ID: an identifier for one particular confirmation attempt, so a code can be tied to the attempt it was sent for.
  • JWT: a common token format whose contents can be decoded and read, including fields such as the audience.
  • OTP (one-time password): a short code, usually sent by text message, meant to prove you hold a particular phone.
  • Pseudocode: a sketch of program logic written for humans to read, not a runnable program.
  • Relying party: the app that trusts another service's login, here Tinder trusting Account Kit.
  • Revocation: cancelling a token before it expires so it can no longer be used.
  • Session: the state of being logged in, usually held as a token or cookie that the app recognises on each request.
  • Signature: a cryptographic mark showing a token really came from the service that claims to have issued it.
  • Token: a piece of text handed out after you prove who you are, used afterwards in place of repeating the proof, like a cloakroom ticket.
  • Trust boundary: the line between systems that trust each other's output; a bug on one side becomes a problem on the other.
  • Verification endpoint: the provider's own service for checking whether a token is genuine, unexpired and not revoked.

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.