Skip to content
Account takeover Disclosed report Beginner

Bypassing the victim's phone number OTP in the account recovery process on the https://hackerone.com/settings/auth/setup_account_recovery

The account recovery phone number could be changed to any number without verifying the SMS OTP sent to that number. An attacker could set a victim's phone number as the recovery number, causing OTP messages to be sent to the victim and potentially flooding their inbox.

the-white-evil Follow

Originally disclosed on HackerOne

Critical 9.8 View original
  • Disclosed after 2 months

Hi Team,

Hope everyone is doing well on your end. :)

  • While conducting research on hackerone.com, I uncovered a critical vulnerability related to account recovery via phone number.
  • I found that I could add any phone number without verifying the SMS OTP.
  • To confirm the vulnerability, I enabled 2FA and observed that the OTP was successfully sent to someone else's phone number.
  • Allow me to explain the details step by step.
  • I halted my exploration at this point without delving into the 2FA OTP process and other aspects. My reason being, I wanted to ensure that I am the first to report this issue.

Proof of concept:

  • I have created a video demonstration of the vulnerability and uploaded it to the report and image too.
  • You can review it once.

█████

Steps To Reproduce

  1. First, create an account recovery request using your own phone number and successfully enable account recovery with that same number.

███████

  1. Now, click on 'Change' and replace the phone number with that of another person. Click 'Next' to initiate the verification process. However, do not verify the OTP, instead, either refresh the page or navigate back to the account recovery page.

██████

  1. I was surprised to find that another person's number was now stored, and the recovery OTP was being sent to that individual's number, even though it had been modified by me. And I do not have access to that number.

  2. To confirm the issue, I implemented 2FA (Two-Factor Authentication) and attempted to use the account recovery process via my phone number. Unfortunately, the attempt was unsuccessful. However, I did not let this setback deter me.

  3. I logged in once more and attempted to change account recovery and got it. Now, the system prompted me to enter an SMS OTP (One-Time Password) sent to the phone number set by the attacker, which happens to be a victim's number I don't have access to.

████████

  • Finally, we identified the issue, which involves exploiting the victim's phone number in the account recovery process without verifying the OTP sent to the victim's phone number.

Impact

  • The attacker can exploit the victim's phone number in the account recovery process without verifying the victim's phone number OTP, potentially flooding the victim's inbox with spam messages and overwhelming their communication channels.

Solution:

  • Accurately verifying the phone number OTP is crucial to ensuring the security of account recovery processes and preventing unauthorized access by attackers.

Cheers!

TheWhiteEvil

The original report as published on HackerOne, by the-white-evil. Images and videos are our own copies; raw HTML is shown as text. View it on HackerOne.

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

HackerOne exposes an account recovery feature under https://hackerone.com/settings/auth/setup_account_recovery. The feature lets a user attach a phone number to their account so that recovery can be performed over SMS. The researcher, the-white-evil, reported a critical flaw in how that phone number is bound to the account: the number could be replaced with an arbitrary one without the SMS OTP ever being verified. The report was disclosed on 11 July 2024, rated critical with a CVSS score of 9.8, and classified as Improper Authentication (Generic) on the hackerone.com asset.

Setup

The researcher worked against a normal HackerOne account on hackerone.com. Two preconditions matter for the reproduction:

  1. The account must first have account recovery enabled with a phone number the attacker controls, so that the recovery flow is in a working state.
  2. After enabling 2FA, the researcher logged in once more to observe the behaviour.

No special tooling is described. The researcher recorded a video demonstration and screenshots and attached them to the report.

Finding it

While researching hackerone.com, the researcher found that any phone number could be added to the account recovery settings without verifying the SMS OTP sent to that number. To confirm the behaviour, 2FA was enabled and the OTP was observed being sent to someone else's phone number. The researcher deliberately stopped at that point and did not explore the 2FA OTP process or other aspects, so as to be the first to report the issue.

Exploitation

Step 1: enable recovery with your own number

Create an account recovery request using your own phone number and successfully enable account recovery with that same number. This establishes a working recovery configuration on the account.

Step 2: replace the number and abandon verification

Click 'Change' and replace the phone number with that of another person. Click 'Next' to initiate the verification process. Do not verify the OTP. Instead, either refresh the page or navigate back to the account recovery page.

Step 3: observe the stored number

The other person's number was now stored, and the recovery OTP was being sent to that individual's number, even though it had been modified by the attacker, who has no access to that number.

Step 4: confirm with 2FA enabled

To confirm the issue, the researcher implemented 2FA and attempted to use the account recovery process via their own phone number. The attempt was unsuccessful. The researcher logged in once more and attempted to change account recovery, and this time it worked. The system prompted for an SMS OTP sent to the phone number set by the attacker, which is a victim's number the attacker does not have access to.

Step 5: conclusion

The issue is that the victim's phone number is used in the account recovery process without verifying the OTP sent to that number.

Root cause

The account recovery settings accept a new phone number and persist it before the OTP challenge for that number has been completed. Abandoning the flow, by refreshing or navigating away, leaves the unverified number stored as the recovery number. The verification step is therefore not a gate on the state change: the unverified number is stored and used for recovery messages. Because the stored value is what the recovery flow uses to decide where to send OTPs, the attacker controls the destination of recovery messages without proving ownership of it.

Impact

An attacker can set a victim's phone number as the recovery number on an account without verifying the OTP sent to that number. The report describes the consequence as the attacker being able to exploit the victim's phone number in the account recovery process, potentially flooding the victim's inbox with spam messages and overwhelming their communication channels. The researcher explicitly halted before exploring the 2FA OTP process and other aspects, so the report does not establish any further consequence beyond the unverified binding and the messages sent to the victim's number.

Fix

The report's recommendation is that accurately verifying the phone number OTP is crucial to ensuring the security of account recovery processes and preventing unauthorised access by attackers. In practice this means the new number should not be persisted as the recovery number until the OTP sent to it has been successfully verified, and abandoning or refreshing the flow should leave the previous, verified number in place. The report does not state what change, if any, was made.

Variants to test

  1. Abandoned verification on other recovery flows. Start a phone or email change, submit the new value, then refresh or navigate away before confirming the OTP. A positive result is the new value being stored and used for subsequent recovery messages.
  2. 2FA enrolment with an unverified number. Begin enrolling a second factor tied to a phone number and abandon the OTP step. A positive result is the number being recorded as the 2FA destination without confirmation.
  3. Notification and alert destinations. Change the number or address used for security alerts and abandon verification. A positive result is alerts being delivered to the unverified destination.
  4. State checks after re-login. Repeat the abandoned change, log out and back in, and trigger recovery. A positive result is the system prompting for an OTP sent to the unverified number, as observed here.

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

What happened, in plain words

HackerOne is a website where security researchers report bugs to companies. Every HackerOne user has an account, and like most accounts it has a recovery option: if you forget your password, the site can send you a code by text message (SMS) to a phone number you registered, so you can prove the account is yours and get back in.

The researcher, the-white-evil, found that this phone number could be swapped for any other number without ever proving that the person making the change actually owns that number. The site asked for the code, but if you simply walked away from the confirmation step (by refreshing the page or going back), the new number was stored. From then on, recovery codes for the account went to that number, which the attacker does not control.

The report was disclosed on 11 July 2024. It was rated critical, with a CVSS score of 9.8, and classified as Improper Authentication (Generic) on the hackerone.com asset.

A few ideas before we start, because the rest of this article uses them constantly:

  • Account recovery: the process a website offers when you cannot log in, usually by sending a code to a phone number or email address you registered earlier. It is a spare key kept outside the account.
  • OTP (One-Time Password): a short code that is valid once, usually sent by SMS or generated by an app. It proves you have access to the phone or device that received it. Think of it like a shop holding your parcel and asking for the pickup code: the code is only useful to whoever can read the message it was sent in.
  • SMS: the ordinary text message service on mobile phones.
  • 2FA (Two-Factor Authentication): logging in with two things instead of one, usually your password plus a code from your phone. Like a bank safe that needs both a key and a combination.
  • Vulnerability: a mistake in how a website is built that lets someone make it behave in a way its designers did not intend.
  • Improper Authentication: the category of mistake where a site does not properly check who someone is, or accepts a claim of identity without proof.
  • CVSS: a standard scoring system for how serious a security flaw is. Scores run from 0 to 10; 9.8 is near the top.
  • Asset: the specific piece of a company's systems a report is about. Here it is the website hackerone.com.

The feature being tested

HackerOne has a settings page at https://hackerone.com/settings/auth/setup_account_recovery. This is where a logged-in user attaches a phone number to their account so that recovery can happen over SMS. The page is part of the site's settings area, which is only reachable once you are signed in.

The flaw is in how that phone number is bound to the account. In a correct design, the site should only save a new number after the code sent to it has been typed back correctly. Here, the number could be replaced with an arbitrary one without the SMS OTP ever being verified.

Setting up

The researcher worked against a normal HackerOne account on hackerone.com. Two preconditions matter for the reproduction:

  1. The account must first have account recovery enabled with a phone number the attacker controls, so that the recovery flow is in a working state. In other words, start from a healthy setup: a number you really own, already confirmed, so that any later oddity is clearly caused by the change you make, not by a broken starting point.
  2. After enabling 2FA, the researcher logged in once more to observe the behaviour. This matters because the researcher wanted to see what happens when the account has an extra layer of protection turned on.

No special tooling is described. Everything was done through the ordinary web interface in a browser. The researcher recorded a video demonstration and screenshots and attached them to the report.

Finding it

While researching hackerone.com, the researcher found that any phone number could be added to the account recovery settings without verifying the SMS OTP sent to that number. To confirm the behaviour, 2FA was enabled and the OTP was observed being sent to someone else's phone number.

The researcher deliberately stopped at that point and did not explore the 2FA OTP process or other aspects, so as to be the first to report the issue. That is a common and sensible choice in bug bounty work: once you have enough evidence to show a real problem, you report it rather than keep poking around, because someone else might find the same thing first.

Reproducing it, step by step

Step 1: enable recovery with your own number

Create an account recovery request using your own phone number and successfully enable account recovery with that same number. This establishes a working recovery configuration on the account.

Why this step: you need a baseline. If recovery is already set up correctly with a number you own, then anything that changes afterwards is caused by your next action, not by a half-finished setup.

Step 2: replace the number and abandon verification

Click 'Change' and replace the phone number with that of another person. Click 'Next' to initiate the verification process. Do not verify the OTP. Instead, either refresh the page or navigate back to the account recovery page.

Why this step: this is the heart of the test. The site offers a verification step, and the question is whether the new number is saved before that step is completed. Refreshing or navigating away is how a normal user might abandon a form, for example because they got distracted or the code did not arrive. If the number is still saved after that, the verification was never really a gate.

Step 3: observe the stored number

The other person's number was now stored, and the recovery OTP was being sent to that individual's number, even though it had been modified by the attacker, who has no access to that number.

Why this matters: the site now believes the account belongs to whoever holds that phone. Recovery messages, which are meant to prove ownership, go to a phone the attacker does not have. The attacker has changed where the spare key is sent without ever holding the key.

Step 4: confirm with 2FA enabled

To confirm the issue, the researcher implemented 2FA and attempted to use the account recovery process via their own phone number. The attempt was unsuccessful. The researcher logged in once more and attempted to change account recovery, and this time it worked. The system prompted for an SMS OTP sent to the phone number set by the attacker, which is a victim's number the attacker does not have access to.

Why this step: turning on 2FA changes the account's security settings, so the researcher wanted to check whether the flaw survives that change. It did. After logging in again, the change to the recovery number went through, and the site then asked for a code sent to the number the attacker had set, not to the researcher's own phone. This confirmed the issue: the system prompted for an OTP sent to the other person's number.

Step 5: conclusion

The issue is that the victim's phone number is used in the account recovery process without verifying the OTP sent to that number.

Why it happens

The account recovery settings accept a new phone number and save it before the OTP challenge for that number has been completed. Abandoning the flow, by refreshing or navigating away, leaves the unverified number stored as the recovery number.

The verification step is therefore not a gate on the state change. The unverified number is stored and used for recovery messages. Because the stored value is what the recovery flow uses to decide where to send OTPs, the attacker controls the destination of recovery messages without proving ownership of it.

A useful comparison: imagine a hotel that changes the room on your key card the moment you ask at the desk, and only afterwards asks you to confirm your name. If you walk away before confirming, the card has already been reprogrammed. The confirmation was decoration, not a checkpoint.

Impact

An attacker can set a victim's phone number as the recovery number on an account without verifying the OTP sent to that number. The report describes the consequence as the attacker being able to exploit the victim's phone number in the account recovery process, potentially flooding the victim's inbox with spam messages and overwhelming their communication channels.

The researcher explicitly halted before exploring the 2FA OTP process and other aspects, so the report does not establish any further consequence beyond the unverified binding and the messages sent to the victim's number.

The fix

The report's recommendation is that accurately verifying the phone number OTP is crucial to ensuring the security of account recovery processes and preventing unauthorised access by attackers. In practice this means the new number should not be saved as the recovery number until the OTP sent to it has been successfully verified, and abandoning or refreshing the flow should leave the previous, verified number in place. The report does not state what change, if any, was made.

Similar things to test elsewhere

These are variations on the same idea, useful if you want to look for the same class of mistake on other sites. In each case the pattern is the same: start a change, submit the new value, then walk away before confirming, and see whether the new value stuck.

  1. Abandoned verification on other recovery flows. Start a phone or email change, submit the new value, then refresh or navigate away before confirming the OTP. A positive result is the new value being stored and used for subsequent recovery messages.
  2. 2FA enrolment with an unverified number. Begin enrolling a second factor tied to a phone number and abandon the OTP step. A positive result is the number being recorded as the 2FA destination without confirmation.
  3. Notification and alert destinations. Change the number or address used for security alerts and abandon verification. A positive result is alerts being delivered to the unverified destination.
  4. State checks after re-login. Repeat the abandoned change, log out and back in, and trigger recovery. A positive result is the system prompting for an OTP sent to the unverified number, as observed here.

Glossary

  • 2FA (Two-Factor Authentication): logging in with two separate proofs, usually a password plus a code from your phone.
  • Account recovery: the process for regaining access to an account when you cannot log in, often by receiving a code on a registered phone number or email address.
  • Asset: the specific system or website a security report concerns; here, hackerone.com.
  • Bug bounty: a programme where companies pay researchers for reporting security flaws to them.
  • CVSS: a standard 0 to 10 score for the severity of a security flaw; 9.8 is critical.
  • Improper Authentication: a category of flaw where a site fails to properly check who someone is, or accepts an identity claim without proof.
  • OTP (One-Time Password): a short code valid for a single use, sent by SMS or generated by an app, used to prove you hold a particular phone or device.
  • SMS: the standard text message service on mobile phones.
  • Vulnerability: a mistake in a system's design or code that lets it behave in a way its designers did not intend.

More by the-white-evil

View all

4 more disclosed reports, best first.

More from HackerOne

View all

The newest disclosed reports for this program.

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.