Primary Refresh Token Exploitation - Attacking Entra Authenticated Services, Bypassing Passwords and MFA
A device joined to Microsoft Entra ID issues a Primary Refresh Token that Edge uses to sign in to Entra services without a password or MFA prompt. An attacker with code execution on that device can capture the short-lived signed token and replay it from their own machine to reach any Entra-authenticated service for roughly five minutes.
Published on pulsesecurity.co.nz
This article demonstrates how a compromised Microsoft Entra ID‑joined device lets the attacker sign into any Entra authenticated service from anywhere on the Internet, bypassing passwords and MFA. We’ll discuss Primary Refresh Tokens and how to exploit this without dropping tools on the endpoint.
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 signed refresh-token credential and its sso_nonce can be replayed within their five-minute lifetime, because the nonce is not bound to the device or browser that requested it.
Impact
An attacker with a foothold on a joined device could sign in to any Entra-authenticated service from the internet without a password or MFA, though the replayed token only works for about five minutes and Microsoft rated the behaviour as working as intended.
What the attacker needed
Code execution on an Entra-joined device; device has a valid PRT; replay within about five minutes
The fix
The text says Microsoft closed the report as working as intended, so the suggested hardening is to make the nonce single-use and bound to the requesting device so the credential cannot be replayed.
How it was found
- Sign in to a Windows machine with an Entra ID work or school account and confirm the device is joined and has a PRT.
- Open Edge developer tools or an intercepting proxy and browse to an Entra-authenticated site to observe the authorize requests.
- Note the sso_nonce returned in the redirect and the signed token Edge sends in the refresh-token credential header.
- Copy that signed token value into a cookie on an attacker-controlled browser.
- Browse to any Entra-authenticated site and the login completes without password or MFA.
- Optionally run Edge headless with remote debugging, tunnel the port out, and pull the token remotely through the debugger.
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 a Windows machine in with a work account, Microsoft stores a special key on the device so you do not have to type your password again for each Microsoft site. The browser uses that key to prove who you are. If someone already has control of the machine, they can copy the proof the browser produces and use it from their own computer, so the password and the second login step are skipped.
What is Account takeover?
Getting into someone else's account through a flaw in sign-in, password reset, second factor, single sign-on or session handling.