Skip to content
Account takeover Write-up Beginner

How I hacked 40k user accounts of microsoft using 2FA bypass outlook

The author claimed that Microsoft's account recovery process could be abused to reset passwords for any user by using archived email addresses and answering basic security questions. However, Microsoft responded that the codes sent were only for email verification, not password reset, and that additional verification is required.

Vartul Goyal Follow

Published on medium.com

{{media:0}}

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

Context

Microsoft Outlook is a personal information manager from Microsoft, distributed as part of the Microsoft Office suite. Although it is mostly used as an email application, it also includes a calendar, task manager, contact manager, note taking, journal and web browsing. It can run as a stand-alone application or work with Microsoft Exchange Server and Microsoft SharePoint Server for multiple users in an organisation, for example shared mailboxes and calendars, Exchange public folders, SharePoint lists and meeting schedules. Microsoft also ships mobile applications for most mobile platforms, including iOS and Android, and developers can build custom software against Outlook and Office components with Microsoft Visual Studio. Windows Phone devices can synchronise almost all Outlook data to Outlook Mobile.

The component under test here is the web-facing Outlook at outlook.live.com, and specifically the account recovery flow: the pages that let a user who has lost access to a Microsoft account prove ownership and set a new password. The author describes it as a more secured platform used by millions of users daily at corporate and personal level.

Setup

The only tool the author names is web.archive.org, described as his favourite tool, used to find archived directories. No accounts, roles, browser versions or other tooling are described. The precondition is simply that archived Outlook URLs containing usernames are publicly retrievable from the Wayback Machine, and that the recovery flow can be driven with a valid Microsoft username plus an email address the attacker controls.

Finding it

While searching for archived directories in web.archive.org, the author came across URLs with a common parameter shape:

Text
/owa/[redacted]/

The next step was to check whether those usernames were expired or active. Entering the first username produced a link indicating the username is valid and redirected to a password page. Many attempts to reset the password failed. The last option offered, "I do not have any of these", redirected to a further page that asks you to send the authentication code to any mail id.

At that point the author had a valid Microsoft username and a valid email address of his own to receive the authentication code.

Exploitation

Step 1: Harvest usernames from archived URLs

Collect the archived /owa/ URLs and extract the email addresses that appear after /owa/ in that pattern. The author reports finding more than 40,000 active users this way using the waybackurls utility. The reproduction steps list six sample addresses:

Text
[redacted]
[redacted]
[redacted]
[redacted]
[redacted]
[redacted]

Each of these, according to the author, could have its password reset.

Step 2: Start recovery and choose "I do not have any of these"

Go to https://outlook.live.com and begin the password reset for one of the harvested usernames. When the offered recovery options do not apply, choose "I do not have any of these". The flow then asks where to send an authentication code, and it accepts an arbitrary email address supplied by the person running the flow.

Step 3: Receive the code at the attacker-controlled address

The author received the following message:

The author received the code at the email address he supplied. The message also offers a link to remove your email address from that account.

Step 4: Enter the code and answer the security question

Entering the code redirected the author to a security question, described as a very basic question. The author states that half of the information needed can be obtained from the username and the other half through social engineering.

Image for post
Image for post From the original on medium.com

The screenshot shows the security question step reached after the code is accepted.

Step 5: Reset the password

The author states that the password can be reset for the listed accounts, and links a video walkthrough. and links a video walkthrough of the process, taking the email addresses one by one:

Text
https://www.youtube.com/watch?v=mzxX1h9sG9Y

When the author asked the Microsoft security team to reset the password for active users, they did not allow it and instead created test accounts so he could demonstrate the reset against those.

Root cause

The author's reading is that the recovery questionnaire is too weak: the code is sent to an address the requester chooses, and the remaining gate is a basic security question whose answer can be derived partly from the username and partly from social engineering. He compares it with the Google account recovery page, which he says has put protections in place there, and argues the questionnaire is easily bypassed.

Microsoft's position, quoted in the report, is different. MSRC replied:

Text
Hello Vartul

As stated earlier, these are not password reset codes, but just the codes to check if the email provided is valid. These cannot be used to reset password. Also, once the email has been confirmed, an attacker needs to provide verification information about the account for resetting password. That information is then verified. The attack mentioned in the report is not a security bypass.

Please let me know if you have more questions. We have closed the case.

Thanks

MSRC

So the vendor treats the emailed code as an email-ownership check only, with the verification information (the security question) as the actual gate. The author disputes that the verification step is strong enough. The report does not show the question or answer used, so the strength of that gate cannot be assessed from it.

Impact

The author claims the issue is high critical and affects a large number of Microsoft users, citing more than 40,000 active accounts found through archived URLs. In practice the impact depends on the security question being answerable, which the author says is feasible from the username plus social engineering. Microsoft declined to have real users' passwords reset during testing and supplied test accounts instead, and it disputes that any bypass exists. The report does not include a demonstration against a real, non-test account.

Fix

The report does not describe any fix or change made by Microsoft. MSRC closed the case as not a security bypass. The author compares the questionnaire with the Google account recovery page, which he says has protections in place.

Variants to test

  1. Enumerate archived /owa/ URLs on other hosted mail or SaaS tenants and check whether the extracted identifiers still resolve to active accounts. A positive result is a valid-username response that leads into a recovery flow.
  2. Walk the "I do not have any of these" branch on other recovery flows and see whether the verification code can be sent to an arbitrary address. A positive result is a code arriving at an address you control for an account you do not own.
  3. After the code is accepted, record the security question and assess whether its answer is derivable from the username or public data. A positive result is a question whose answer you can obtain without the account owner.
  4. Compare the same recovery flow across regional domains and consumer versus corporate accounts, looking for a path where the questionnaire is skipped or reduced. A positive result is a reset completed with fewer verification factors than the main flow requires.

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

A security researcher spent some time looking at how Microsoft lets people recover a lost Outlook account. Outlook is Microsoft's email and calendar service, and outlook.live.com is the website you open in a browser to read your mail. When you forget your password, the site has to work out whether you really are the owner of the account before it lets you set a new password. That process is called account recovery.

The researcher found that old Outlook web addresses had been saved by an internet archive called the Wayback Machine. Those addresses contained real email addresses. He reports finding more than 40,000 active users this way. He then walked through the recovery process and found that the site would send an authentication code to any mail id he typed in. After entering that code, the last hurdle was a security question, which he describes as very basic and answerable using information from the username plus some social engineering.

He reported this to Microsoft. Microsoft's security team replied that the emailed code is only a check that the email address you typed is real, not a password reset code, and that the security question is the real gate. They said it was not a security bypass and closed the case. The researcher disagreed with that assessment. The report does not show a successful reset against a real, non-test account.

This article walks through what he did, step by step, explaining each idea from scratch.

Background: what Outlook is and what part was tested

Microsoft Outlook is a personal information manager from Microsoft, sold as part of the Microsoft Office suite. Most people use it as an email application, but it also includes a calendar, a task manager, a contact manager, note taking, a journal and web browsing. It can run as a stand-alone application, or it can work with Microsoft Exchange Server and Microsoft SharePoint Server for multiple users in an organisation, for example shared mailboxes and calendars, Exchange public folders, SharePoint lists and meeting schedules. Microsoft also ships mobile applications for most mobile platforms, including iOS and Android, and developers can build custom software against Outlook and Office components with Microsoft Visual Studio. Windows Phone devices can synchronise almost all Outlook data to Outlook Mobile.

The part under test is the web version at outlook.live.com, and specifically the account recovery flow: the pages that let someone who has lost access to a Microsoft account prove they own it and then set a new password. The author describes Outlook as a more secured platform used by millions of users daily at corporate and personal level.

A quick word on the vocabulary used throughout:

  • Account recovery flow: the series of web pages you see after clicking "Forgot password". Each page asks for a piece of evidence that you own the account.
  • Username: here, the email address that identifies the account, such as [redacted].
  • Verification code: a short number the site sends to prove you can read messages sent to a particular address.
  • Security question: a question set up in advance whose answer only the owner should know, used as a backup proof of identity.

Setup: what tools were needed

The only tool the author names is web.archive.org, which he calls his favourite tool, used to find archived directories. The Wayback Machine is a public service that has been saving copies of web pages for years. If a page existed at some point, there is a good chance a snapshot of it is stored there, even if the page is gone now. Think of it as a library of old photographs of the internet.

No accounts, roles, browser versions or other tooling are described. The precondition is simply that archived Outlook URLs containing usernames can be retrieved publicly from the Wayback Machine, and that the recovery flow can be driven with a valid Microsoft username plus an email address the attacker controls.

Finding it: how the researcher spotted the pattern

While searching for archived directories in web.archive.org, the author came across URLs with a common shape:

Text
/owa/[redacted]/

Line by line:

  • /owa/ is a path on the Outlook web server. OWA stands for Outlook Web Access, the older name for the browser-based version of Outlook.
  • [redacted] is an email address sitting directly in the URL. Many web applications put a user identifier in the address bar so the server knows whose mailbox to open.
  • The trailing / just closes the path.

The important observation is that the email address is part of the URL itself. That means anyone who can read the URL, or an archive of it, learns a real account name. This is why the Wayback Machine mattered: it had stored pages containing these URLs, so the addresses were effectively published.

The next step was to check whether those usernames were expired or active. Entering the first username produced a link indicating the username is valid and redirected to a password page. Many attempts to reset the password failed. The last option offered, "I do not have any of these", redirected to a further page that asks where to send an authentication code, and it accepts any email address.

Why does that matter? Normally, a recovery flow should only send a code to a contact method already registered on the account, such as a backup email or phone number. If it lets you type in any address, then the code proves only that you can read mail at the address you typed, not that you own the account. The author now had two things: a valid Microsoft username, and a valid email address of his own to receive the authentication code.

Exploitation

Step 1: Harvest usernames from archived URLs

The idea is to collect the archived /owa/ URLs and extract the email addresses that appear after /owa/ in that pattern. The author reports finding more than 40,000 active users this way using the waybackurls utility. waybackurls is a small command-line program that queries the Wayback Machine and prints out every URL it has stored for a given domain. You give it a domain name, it gives you back a long list of addresses.

The reproduction steps list six sample addresses:

Text
[redacted]
[redacted]
[redacted]
[redacted]
[redacted]
[redacted]

Each of these, according to the author, could have its password reset. Note that these are real-looking personal addresses; in a public write-up they would normally be redacted, but they are reproduced here as they appear in the report.

Step 2: Start recovery and choose "I do not have any of these"

Go to https://outlook.live.com and begin the password reset for one of the harvested usernames. When the offered recovery options do not apply, choose "I do not have any of these". The flow then asks where to send an authentication code, and it accepts an arbitrary email address supplied by the person running the flow.

Why this step? The recovery flow offers a menu of ways to prove ownership. If none of them are available to you (because you are not the owner), the site still offers a fallback. The researcher's point is that this fallback is too permissive: it lets the person asking choose where the code goes.

Step 3: Receive the code at the attacker-controlled address

The author received the following message:

Line by line:

  • The first lines are the subject and heading of the email.
  • go***@gmail.com is the account the code relates to, partially masked. The masking hides the middle of the address, but the researcher already knows the full address because he typed it in.
  • 0470572 is the code itself.
  • The sentence about removing your email address is a self-service link: if you did not request this, you can click to detach your address from the account.

The key observation is that the code is delivered to the address the requester entered. The message also offers a link to remove your email address from that account.

Step 4: Enter the code and answer the security question

Entering the code redirected the author to a security question, described as a very basic question. The author states that half of the information needed can be obtained from the username and the other half through social engineering.

Image for post
Image for post From the original on medium.com

The screenshot shows the security question step reached after the code is accepted. Social engineering, in this context, means finding out personal details by looking at public information or by talking to people, rather than by breaking any technical control. For example, a question like "what is your mother's maiden name" might be answerable from a social media profile.

Step 5: Reset the password

The author states that the password can be reset for the listed accounts, and links a video walkthrough. and links a video walkthrough of the process, taking the email addresses one by one:

Text
https://www.youtube.com/watch?v=mzxX1h9sG9Y

When the author asked the Microsoft security team to reset the password for active users, they did not allow it and instead created test accounts so he could demonstrate the reset against those. This is standard practice in bug bounty programmes: you do not touch real users' accounts, you demonstrate the issue on accounts the vendor provides.

Root cause

The author's reading is that the recovery questionnaire is too weak. The code is sent to an address the requester chooses, and the remaining gate is a basic security question whose answer can be derived partly from the username and partly from social engineering. He compares it with the Google account recovery page, which he says has put protections in place there, and argues the questionnaire is easily bypassed.

Microsoft's position, quoted in the report, is different. MSRC (the Microsoft Security Response Center, the team that handles security reports) replied:

Text
Hello Vartul

As stated earlier, these are not password reset codes, but just the codes to check if the email provided is valid. These cannot be used to reset password. Also, once the email has been confirmed, an attacker needs to provide verification information about the account for resetting password. That information is then verified. The attack mentioned in the report is not a security bypass.

Please let me know if you have more questions. We have closed the case.

Thanks

MSRC

Line by line:

  • "these are not password reset codes, but just the codes to check if the email provided is valid": Microsoft says the code only proves you can read mail at the address you typed. It does not, by itself, let you reset anything.
  • "once the email has been confirmed, an attacker needs to provide verification information about the account": the security question is the real gate.
  • "The attack mentioned in the report is not a security bypass": Microsoft's conclusion.

So the vendor treats the emailed code as an email-ownership check only, with the verification information (the security question) as the actual gate. The author disputes that the verification step is strong enough. The report does not show the question or answer used, so the strength of that gate cannot be assessed from it.

Impact

The author claims the issue is high critical and affects a large number of Microsoft users, citing more than 40,000 active accounts found through archived URLs. In practice the impact depends on the security question being answerable, which the author says is feasible from the username plus social engineering. Microsoft declined to have real users' passwords reset during testing and supplied test accounts instead, and it disputes that any bypass exists. The report does not include a demonstration against a real, non-test account.

Fix

MSRC closed the case as not a security bypass. The author compares the questionnaire with the Google account recovery page, which he says has protections in place.

Variants to test

These are ideas for someone learning from this report who wants to look at similar flows elsewhere. They are described as hypotheses, not as things the author tested.

  1. Enumerate archived /owa/ URLs on other hosted mail or SaaS tenants and check whether the extracted identifiers still resolve to active accounts. A positive result is a valid-username response that leads into a recovery flow.
  2. Walk the "I do not have any of these" branch on other recovery flows and see whether the verification code can be sent to an arbitrary address. A positive result is a code arriving at an address you control for an account you do not own.
  3. After the code is accepted, record the security question and assess whether its answer is derivable from the username or public data. A positive result is a question whose answer you can obtain without the account owner.
  4. Compare the same recovery flow across regional domains and consumer versus corporate accounts, looking for a path where the questionnaire is skipped or reduced. A positive result is a reset completed with fewer verification factors than the main flow requires.

Glossary

  • Account recovery flow: the set of web pages a site shows when you have lost access to your account and need to prove you own it before setting a new password.
  • Authentication code: a short number sent to an email address or phone to prove the person asking can read messages sent there.
  • Bug bounty programme: a scheme where a company pays or credits researchers who report security problems to it privately.
  • Email address harvesting: collecting email addresses in bulk from public sources such as web pages or archives.
  • MSRC: Microsoft Security Response Center, the team that receives and triages security reports about Microsoft products.
  • Outlook: Microsoft's email and calendar application, available as a desktop program and as a website.
  • OWA: Outlook Web Access, the older name for the browser-based version of Outlook; it appears in URLs as /owa/.
  • Password reset: the process of setting a new password for an account, usually after proving ownership.
  • Social engineering: obtaining information or access by manipulating people or using public personal details, rather than by technical attack.
  • Username: the identifier for an account; here, the email address.
  • Verification code: see authentication code.
  • Wayback Machine: a public archive at web.archive.org that stores snapshots of web pages over time.
  • waybackurls: a command-line utility that queries the Wayback Machine and prints stored URLs for a domain.
  • 2FA / MFA bypass: two-factor or multi-factor authentication is a login that needs more than a password; a bypass is a way to get past it without providing the extra factor. The report's title uses this phrase, though Microsoft disputes that a bypass occurred.

More from Microsoft

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.