Escalating Impact: Full Account Takeover in Microsoft via XSS in
A reflected cross-site scripting flaw existed in the x-client-ver parameter of Microsoft's login flow, which was passed through to a legacy Azure AD endpoint that reflected it into an auto-submitted form. An attacker could run script in the victim's login context and, by capturing the flow tokens, add a new authentication method to the victim's account, leading to full account takeover.
Published on melotover.medium.com
Microsoft’s login system featured a highly secure and complex architecture, built with multiple layers of protection that made analysis particularly challenging.
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 the x-client-ver value was reflected unescaped into an attribute of an auto-submitted form on the legacy proofup endpoint, and the sensitive flow tokens in that form were then reusable to enrol a new MFA method.
Impact
An attacker could take over any work or school account by adding their own authentication method, though the exploit relied on the victim opening a crafted link and on browser behaviour that differed in Firefox.
What the attacker needed
Work or school account; victim opens a crafted login link; victim has password-only sign-in
The fix
The reflected value should have been properly encoded for the attribute context and the flow tokens bound to the session so they could not be replayed for another user.
How it was found
- Sign in with a work or school account that has only a password as its sign-in method.
- Observe the redirect to the legacy proofup endpoint and the auto-submitted form containing flowtoken, request, canary and pru.
- Inject into the x-client-ver parameter so the value breaks out of the form's action attribute.
- Add a new id and name to the form so the auto-submit script fails and the injected onfocus handler runs.
- Deliver the crafted login URL to the victim, using the common tenant path to reach any organisation.
- Capture the form parameters sent to the attacker's server and replay them to add a new authentication method 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 sign in to Microsoft, the login pages pass some values from one page to the next. One of those values was placed into a web page without being made safe, so text typed into it could become code that the browser runs. Because that code ran inside the real Microsoft login page, an attacker could use it to grab the sign-in details and add their own second factor to the victim's account.
What is XSS?
Script an attacker supplies runs in another user's browser, on the target's origin, with that user's session.