Skip to content
Open redirect Write-up Intermediate

Obtaining Login Tokens for an Outlook, Office or Azure Account

The Microsoft login service validated the 'wreply' redirect parameter after fully URL-decoding it, so an attacker could craft a URL that passed the domain check but actually pointed to an attacker-controlled host. The login token was then POSTed to that host, allowing the attacker to replay it and impersonate the victim.

Jack Whitton Follow

Published on whitton.io

Microsoft, being a huge company, have various services spread across multiple domains (.outlook.com, .live.com, and so on).

Jack Whitton, on whitton.io

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

Impact

An attacker could obtain a login token and impersonate the victim, gaining complete access to that service's account, though the token is only valid for the service that issued it.

What the attacker needed

Victim is logged in to Microsoft; victim visits a crafted link

The fix

The hostname in 'wreply' now must end in '%2f', which gets URL-decoded to '/', ensuring the browser only sends the request to the intended host.

How it was found

  1. The attacker crafts a login URL with a 'wreply' value that is URL-encoded so that after decoding it contains an '@' and points to an attacker-controlled host.
  2. The victim visits the crafted login URL while logged in to Microsoft.
  3. The login server validates the decoded URL, sees a Microsoft domain, and sends a POST request with the login token to the attacker's host.
  4. The attacker captures the token and replays it to the legitimate service to gain access to the victim's account.

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 log in to a Microsoft service, the login server sends a secret token back to the service you came from. The server checks that the destination is a Microsoft domain, but it does the check after decoding the address, so a cleverly encoded address can pass the check while actually pointing elsewhere. The attacker receives the token and uses it to log in as the victim.

What is Open redirect?

A trusted site forwards users to any address an attacker picks; rarely paid alone, often the missing link in a chain.

More by Jack Whitton

View all

1 more disclosed report, best first.

More from Microsoft

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Open redirect

The lesson behind this report.

A trusted site forwards users to any address an attacker picks; rarely paid alone, often the missing link in a chain.