skip to content

Consent and Device Code

Some lures are answered by a real sign-in on the real page: the factor signs correctly and the operator still walks away with access. Interviewers ask because passkeys are read as the end of phishing.

on this pageshow

explore

questions

4

Why does an OAuth consent grant to a mailbox survive the user's password reset?

level: juniorimportance: must knowfreq 60%

answer

  1. authorization, not authentication
  2. the application holds it, not the user
  3. refresh token bound to the grant
  4. the password was never in the loop
  5. a separate record with its own owner

basics

~20 s

A consent grant is an authorization the user gave to an application, not a credential the user holds. It is a separate record with its own refresh token, so rotating the password changes nothing the application depends on.

solid answer

~50 s

Two different objects are being confused. A password is an authentication factor: it proves who is present at a sign-in. A consent grant is an authorization record created when someone clicked Accept on an application's request, saying that this registered application may act on my behalf with these scopes. The application then holds a refresh token bound to that grant and redeems it for fresh access tokens with no sign-in at all, so neither the password nor the second factor is ever in the loop. Rotate the password and you invalidate the credential; the grant record is untouched and mail keeps being read. Re-registering the second factor changes nothing either. What ends it is action against the grant and the application's tokens, which is a different object with a different owner. ATT&CK names the acquisition `T1528` and the reuse `T1550.001`.

go deeper

for a junior

Be ready to state the difference in one line: a password authenticates a person, a consent grant authorizes an application. Then say plainly that resetting one does not touch the other.

for a middle

Explain the token mechanics — the grant holds a refresh token, the application exchanges it at the token endpoint for short-lived access tokens, and that exchange never prompts for a credential or a factor.

for a senior

Show that you would reclassify the incident before acting: identify the grant and the application identity as the objects that matter, and say why the credential-focused reflex removes nothing.

for a principal

Own the framing for the organisation: which access artefacts your identity platform can issue, who is accountable for each, and why an access-removal process written only around credentials leaves a whole class of access standing.

## Two objects that get called the same thing When people say "the account was compromised", they usually mean one of two very different things. **A credential** is something the user proves themselves with: a password, a one-time code, a hardware authenticator. It is consumed at sign-in. Change it and the old one stops working. **A consent grant** is a record in the directory saying that a *registered application* may act on a user's behalf, limited to a named set of scopes such as reading mail. The user creates it by pressing Accept on a consent request. Nothing about it belongs to the user afterwards; it belongs to the application. The entire question turns on that second sentence. The attacker who ran a consent lure never obtained a credential, so there is no credential to invalidate. ## What the application actually holds A grant that includes offline access lets the application hold a **refresh token**. A refresh token is not a session and not a password: it is a bearer artefact the application presents directly to the token endpoint to obtain a fresh, short-lived access token. That exchange is machine-to-machine. There is no sign-in page, no password prompt, no second-factor challenge, and no interactive session for anyone to look at. So the loop the operator runs is: 1. Present the refresh token bound to the grant. 2. Receive a new access token, typically valid for an hour or so. 3. Call the mail API with it. 4. Repeat before the access token expires. Nothing in that loop reads the user's password, so nothing in that loop notices that the password changed. The same reasoning covers the second factor: a factor is presented at authentication, and no authentication is happening. ## How the grant got there The usual route is a lure that does not look like a phishing page at all, because it isn't one. The user receives a link to the *genuine* identity provider's consent screen, for an application the operator registered — often with a plausible name suggesting a document viewer, a scanner, or an internal tool. The user authenticates correctly, to the correct site, with the correct factor, and then approves the request. Every step of the authentication was legitimate. The deception is in the authorization, not the login. That is why the classification matters so much in practice: the story contains no stolen password, so the reflex response of "reset it" removes nothing. ## What actually ends it The grant is its own object, so the remedy is aimed at the grant and at the application identity behind it — the tokens issued against it stop being redeemable only when the authorization itself is gone. The important part for an interview is knowing *which* object you must act on and why the credential is the wrong one; the operational procedure for doing so sits with whoever owns access removal in your organisation. ## Getting the direction of the claim right A grant record proves that an authorization was recorded for a principal. It does not prove the user understood the request, and it does not prove a human was even at the keyboard when the underlying access token was last used. Conversely, a successful password rotation proves the credential changed; it proves nothing whatsoever about outstanding authorizations. ## Framework vocabulary In MITRE ATT&CK the theft of the token or grant is **Steal Application Access Token (`T1528`)** and reusing it in place of a normal logon is **Use Alternate Authentication Material: Application Access Token (`T1550.001`)**. Naming them this way is useful because it forces the distinction the question is about: the technique is described as *alternate* authentication material precisely because it substitutes for the credential path rather than travelling down it. ## The common wrong answers - "They must still have the password, or they couldn't read the mail." They never needed one. - "MFA would have stopped this." The factor is presented correctly, by the right person, at the right site, in most versions of this lure. - "The token will expire soon anyway." The *access* token will; the refresh token keeps producing new ones for as long as the grant stands. - "It is a session hijack." A session belongs to a browser and a user; this belongs to an application identity and outlives every browser involved.

  • Does re-registering the user's second factor end the attacker's access?
    No. A second factor is presented during authentication, and the application is not authenticating as the user. It redeems a refresh token bound to the grant directly at the token endpoint, which never issues a factor challenge. Re-registering the factor protects future interactive sign-ins and leaves the grant exactly as it was.
  • If not with the user's account, where does the access actually live?
    With the application identity — the service principal for the registered application in the tenant — plus the grant record binding it to a principal and a scope set. That identity was created by the operator, is not tied to any employee, and does not disappear when an employee's credential changes or when the employee leaves.
  • Does a consent grant expire on its own?
    Not reliably. Access tokens are short-lived, typically around an hour, but the grant itself commonly carries no expiry, and the refresh token keeps being exchanged while the grant stands. Treat the shelf life as indefinite until someone acts on the grant, rather than assuming time solves it.

Changing the lock on your front door does not cancel the key you gave the cleaning company last year. The key was issued to them, under a separate arrangement, and it opens the door whatever you do to your own key.

saying these in an interview costs you the question

  • Says a password reset ends the attacker's access
  • Calls the consent grant a stolen credential
  • Assumes re-registering MFA invalidates issued tokens
  • Thinks the attacker must sign in as the user to read mail
  • Claims short token lifetimes make the access self-limiting

context

open as a page

How can a device-code lure put a working token on an operator's device when the user's FIDO2 key was presented correctly?

level: middleimportance: must knowfreq 52%

basics

~20 s

The token is issued to whoever started the device authorization flow, not to whoever authenticated. The operator starts it, the victim types the short code at the genuine page and authenticates honestly, and the operator's waiting client collects the token.

open as a page

A mailbox is still being read a week after the password rotation and MFA re-registration — what does the operator hold?

level: seniorimportance: should knowfreq 40%

basics

~20 s

Almost certainly a consent grant to an application the operator registered, not a credential. The next question is whether the grant covers one user or the whole tenant, because that decides whether one mailbox or every mailbox is exposed.

open as a page