Skip to content
OAuth / SSO Write-up Advanced

Arbitrary 1-click Azure tenant takeover via MS application

A Microsoft first-party Azure application had a reply URL pointing at a domain that could be taken over, so an attacker could send a crafted authorisation link and receive the victim's OAuth authorisation code, then exchange it for tokens. Because the app was pre-authorised, no consent prompt appeared, allowing a one-click compromise of any tenant.

Arnau Ortega Follow

Published on falconforce.nl

In this blog post I explain how reply URLs in Azure Applications can be used as a vector for phishing. The impact of this can range from data leaks to complete tenant takeover; just by luring a victim into clicking on a link.

Ivo Noppen, on falconforce.nl

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.

Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.

How it worked

Root cause

Likely a reply URL registered for a Microsoft first-party application pointed at an unclaimed domain, and the app was pre-authorised so no consent prompt interrupted the flow.

Impact

An attacker could obtain tokens for any tenant with a single click and no consent prompt, ranging from directory read access to full tenant takeover if the victim is a Global Admin.

What the attacker needed

Victim has an active session; victim clicks a link; reply URL domain is unclaimed; app is pre-authorised (no consent)

How it was found

  1. Enumerate applications and their reply URLs, looking for ones whose domains do not resolve
  2. Register or claim the unclaimed domain used by the reply URL
  3. Build an authorisation URL for the target application with that reply URL
  4. Send the link to a victim who has an active session
  5. Receive the authorisation code at the controlled site and exchange it at the token endpoint
  6. Use the returned access token to act on the victim's behalf

Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.

Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.

When you sign in to an app with your Microsoft account, the app sends you back to a web address it registered in advance, carrying a short-lived code. If an attacker can control that web address, they can catch the code and swap it for tokens that act as you. Here the address belonged to Microsoft but pointed at a domain nobody had claimed, and the app never asked users to approve anything.

What is OAuth / SSO?

Mistakes in OAuth, OpenID Connect, SAML or token handling that leak codes and tokens or link an attacker's identity to a victim's account.

More from Microsoft (Azure)

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

OAuth and single sign-on flaws

The lesson behind this report.

Mistakes in OAuth, OpenID Connect, SAML or token handling that leak codes and tokens or link an attacker's identity to a victim's account.