Skip to content
Account takeover Write-up Advanced

Research background

Windows Hello for Business (WHFB) keys can be used for single sign-on without requiring a PIN or biometric authentication, allowing an attacker with access to a user session to sign arbitrary data and request Primary Refresh Tokens (PRTs) or perform WebAuthn authentication as the victim. This enables device registration and token acquisition, potentially leading to persistent access.

dirkjanm.io

Published on dirkjanm.io

Most research into Windows Hello focuses on the mechanics in use when authenticating to the local device. As an Entra ID researcher, I’ve always been more interested in how these keys are used to authenticate to the cloud.

The author, on dirkjanm.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

Root cause

Likely the Passport Key Storage Provider allows signing with the WHFB key without requiring user presence (PIN or biometric) when called via the CNG interface, relying on cached data.

Impact

An attacker with access to a user session could request PRTs and authenticate as the user, potentially bypassing MFA and device-based Conditional Access policies, though some policies requiring device state may still limit the attack.

What the attacker needed

Access to victim's user session; an Entra ID joined or registered device; credentials for device registration

The fix

Microsoft left this as-is since it is a consequence of how WHFB works; detection via sign-in logs is recommended.

How it was found

  1. Obtain access to a user session on a Windows device with a WHFB key.
  2. Use a PowerShell script to call NCryptOpenKey and load the WHFB key from the certificate store.
  3. Sign a locally generated JWT with the WHFB key to create a PRT request assertion.
  4. Pass the signed JWT to an attacker host and request a PRT.
  5. Alternatively, use the WHFB key to generate a WebAuthn assertion for FIDO2 authentication.
  6. Use the WebAuthn assertion to request tokens or register a new device.

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.

Windows Hello for Business lets you sign in to Windows and Microsoft services using a PIN or fingerprint instead of a password. The key that proves your identity is stored in a special chip called a TPM. This research shows that if malware is already running on your computer, it can use that key to sign in as you to cloud services without needing your PIN or fingerprint, because the key can be accessed without those checks.

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.

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.