Skip to content
Account takeover Write-up Advanced

I’d TAP That Pass

An attacker with an authentication admin role in Azure AD can assign a Temporary Access Pass (TAP) to a user, which satisfies MFA requirements and allows authentication without the user's password or MFA. By using the OAuth on-behalf-of flow, the attacker can obtain a refresh token that remains valid after the TAP expires, maintaining access to the target account.

Daniel Heinsen Follow

Published on posts.specterops.io

You can assign users a short lived password called a Temporary Access Pass (TAP) that satisfies most multi-factor authentication requirements implemented in Azure AD conditional access without alerting the user or modifying their existing password. In addition, you can take advantage of the OAuth on-behalf-of (OBO)…

Daniel Heinsen, on posts.specterops.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 design of Temporary Access Passes allows them to satisfy MFA and be used to obtain refresh tokens that are not invalidated when the TAP expires, enabling persistence.

Impact

An attacker with authentication admin privileges could impersonate any user, bypass MFA, and maintain persistent access even after the TAP expires, although Microsoft has fixed the refresh token issue as of March 2023.

What the attacker needed

Authentication admin role or equivalent; TAP enabled in tenant; Ability to register Azure AD app

How it was found

  1. Obtain authentication admin role or equivalent permissions in Azure AD.
  2. Create a Temporary Access Pass for the target user via Microsoft Graph API.
  3. Authenticate as the target user using the TAP, satisfying MFA.
  4. Register a new Azure AD application with a client secret and exposed API.
  5. Use the TAP to obtain an access token for the middleware application.
  6. Perform an on-behalf-of flow to get a backend token and refresh token, then use the refresh token after TAP expiry.

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.

A Temporary Access Pass is a short-lived password that can be used to sign in and that also counts as multi-factor authentication. If an attacker has admin rights in Azure AD, they can create such a pass for any user and log in as them without knowing their password or needing their phone. The attacker can then use a special OAuth flow to get a token that lets them keep accessing the account even after the pass expires.

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.