Beta

Create a tenant

A new tenant starts with its own users, OAuth settings, audit history and logs. You are its first Tenant Admin.

BTL Admin

How attackers stay in

Changing the password was not enough

Suppose that on Day 2, when the alert fired, Cedar Inc. had simply reset Riley's password and moved on. The password the attacker captured through the relay page would stop working. Almost nothing else the attacker set up the day before would.

By then the attacker had registered their own authenticator app on Riley's account at 09:20, approved a third-party app called Invoice Sync with permission to read and send Riley's mail at 09:31, and added a mail rule at 09:40 that forwards messages containing "invoice". None of these depends on Riley's password. The authenticator is a sign-in method in its own right, Invoice Sync holds its own grant, and the mail rule runs on the mail server without anyone signing in.

Keeping access after the original way in has been closed is persistence, and each separate means of keeping it is a foothold. Attackers add footholds early, often within minutes of getting in, because they expect the first way in to be found. The diagram shows common footholds around a taken-over account and whether each one survives a password reset.

A taken-over account connected to nine footholds. A stolen session cookie ends only if the password reset also signs out every session. An app password ends with the password change on some services and survives on others. Seven footholds survive a password reset: an authenticator the attacker enrolled, a changed recovery email or phone, app consent and its refresh token, a mail forwarding rule, a secret added to an application, a new account or role assignment, and a new trusted identity provider. A taken-over account connected to nine footholds. A stolen session cookie ends only if the password reset also signs out every session. An app password ends with the password change on some services and survives on others. Seven footholds survive a password reset: an authenticator the attacker enrolled, a changed recovery email or phone, app consent and its refresh token, a mail forwarding rule, a secret added to an application, a new account or role assignment, and a new trusted identity provider.
A reset ends the stolen session only when it signs out existing sessions, and ends an app password only on some services. The other seven footholds survive it.

A second way back in

The most direct foothold is another sign-in method. An authenticator the attacker enrolls belongs to them, and depending on the service it can satisfy the second step whenever they learn the next password, prove identity in a self-service password reset, or complete a sign-in on its own. A passkey the attacker registers needs no password at all.

Adding a method is supposed to need proof that the person adding it controls the account now, as Enrollment, replacement, and recovery describes. At Cedar, that proof was a recent sign-in, which a stolen session passes easily.

Recovery contacts give the same result one step removed. If an attacker replaces the recovery email address or phone number, the next "forgot password" request goes to them, and they can reset the password again after the owner does. This is why changing a recovery contact should notify the old one.

App passwords are separate passwords that some services issue for older mail and calendar programs that cannot complete MFA. They skip the second factor by design. Some services cancel them when the main password changes, while others keep them until someone deletes them, so a defender has to check rather than assume.

Access that outlives the session

Sessions end and access tokens expire, but some access is built to last. When the attacker approved Invoice Sync at 09:31, Cedar's identity provider recorded a grant and gave the app a refresh token, which it can exchange for new access tokens without anyone signing in, as Giving another application limited access explains. The grant connects the app to Riley's account. It does not depend on Riley's password or on the session that approved it.

For honest apps that is the point: a calendar sync should not break every time someone changes their password. It also means that a grant an attacker approved keeps working after the owner recovers the account, until the grant is revoked along with the refresh tokens issued under it. Some providers end refresh tokens when a password changes, but a defender cannot rely on that without checking how their provider behaves.

The same is true of a mail or chat app signed in on the attacker's own device. It holds a refresh token of its own and can keep fetching new mail long after the session in the browser has ended. Revoking access and sharing security events follows how each of these kinds of access is ended.

Credentials added to applications

Applications have credentials too. An integration that archives every mailbox, or that creates accounts when the HR system hires someone, signs in with its own client secret or key, using a flow such as the client credentials grant. Most platforms let an application hold more than one credential at once, so that a new one can be added before the old one is removed.

An attacker with the right to manage an application can add a credential of their own. From then on, they can act as that application, with whatever permissions it already holds, from anywhere. Resetting a person's password, removing their methods or even disabling their account does nothing to it, because no person signs in. The change also looks like routine maintenance, since adding a new secret is exactly what a planned rotation does.

Riley's finance account had no right to manage applications. An administrator's account usually does, which is why administrators draw attempts like the refused call to Cedar's help desk. The record to watch for is a credential added to an application by someone who does not normally maintain it, followed by the application signing in from a network it has never used. Rotating client credentials shows what a planned change looks like, which makes an unplanned one easier to spot.

Quiet configuration changes

Some footholds are not credentials at all. The rule the attacker added to Riley's mailbox at 09:40 forwards every message containing "invoice" to an address outside Cedar. It needs no session, no token and no password. It runs on the mail server each time a matching message arrives, and it keeps running after every credential on the account has changed. Rules that move or delete messages work the same way, and can hide a security notification from the person it was meant for.

With administrative access, configuration changes reach further. An attacker can create an account for themselves, assign a role to an account they control, leave one account out of the MFA policy, or add a trusted identity provider that can assert anyone's identity, as Abusing federation and account linking describes. Each looks like ordinary administration in the records, and each keeps working long after the attacker's original access is gone.

Making new footholds visible

Footholds are added through ordinary features, so preventing them means guarding the moments when those features are used. Adding a sign-in method, changing a recovery contact, approving an app and adding an application credential should each count a recent sign-in only if it used a phishing-resistant method, and otherwise ask for one at that moment. Riley's 09:14 sign-in used a password and a code, so at 09:20 the attacker would have met a passkey prompt that the relay could not answer.

Notifications let the owner notice what prevention missed. A message to Riley, through a channel that existed before the change, saying that a new authenticator was added or a new app approved, with a clear way to report "this was not me", turns the owner into a detector. The channel matters: a notice sent only to a recovery address the attacker just added reaches the attacker.

Monitoring watches for the patterns. On Day 2, Cedar's alert fired on exactly this kind of foothold: a sign-in from a hosting provider, then a new authenticator added minutes later from a network Riley had never used. Forwarding rules that send mail outside the organization, credentials added to applications and changes to trust configuration deserve the same attention, as Detecting identity attacks explains.

When one foothold turns up, it is rarely alone. Cleanup has to list the account's methods, recovery contacts, sessions, grants and rules, along with everything the account created or changed, then remove every unexpected item together with the password reset, as Containing and recovering describes. The following exercise asks what a reset on its own would do to each foothold.

What survives the reset?

Simulation. These records are made up, most of them from the fictional Cedar incident, and answering sends nothing. For each foothold, decide what a password reset on its own would do.

ITEM 1 OF 6

The attacker still holds the cookie for session s-7a91. What does a password reset do to it?
Day 1 09:14:06  sign_in.succeeded
  account:  usr_4182 ([email protected])
  methods:  password, authenticator code
  network:  203.0.113.24 (hosting provider)
  session:  s-7a91 (browser cookie)

Enable JavaScript to check an answer here, or open the explanation below.

Show the answer and why

It ends the session only if the reset also signs out sessions. The cookie does not contain the password, so the reset matters only if it ends existing sessions. Ending sessions should be part of the response either way.

ITEM 2 OF 6

The attacker enrolled this authenticator. What does a password reset do to it?
Day 1 09:20:41  authenticator.added
  actor:    usr_4182 ([email protected])
  method:   authenticator app
  session:  s-7a91
  network:  203.0.113.57
  check:    recent sign-in, 6 minutes ago, passed

Enable JavaScript to check an answer here, or open the explanation below.

Show the answer and why

It stays enrolled and can still answer requests for a code. The authenticator holds its own shared secret, which has nothing to do with the password. It can still complete steps that ask for a code, including some self-service resets, until someone removes it.

ITEM 3 OF 6

Invoice Sync received a refresh token with this grant. What does a password reset do to it?
Day 1 09:31:02  consent.granted
  actor:    usr_4182 ([email protected])
  app:      Invoice Sync
  scopes:   mail.read mail.send offline_access
  session:  s-7a91
  network:  203.0.113.57
Show the answer and why

It survives until the grant itself is revoked, along with its tokens. Consent creates a lasting relationship between the account and the app, separate from the password. Revoking the grant, and the refresh tokens issued under it, is what ends the app's access.

ITEM 4 OF 6

What does a password reset do to this mail rule?
Day 1 09:40:17  mailbox.rule.created
  actor:      usr_4182 ([email protected])
  condition:  message contains "invoice"
  action:     forward to [email protected]
  network:    203.0.113.57

Enable JavaScript to check an answer here, or open the explanation below.

Show the answer and why

It survives, because the rule runs on the mail server by itself. Nothing about the rule depends on a credential or a session, so it keeps forwarding until someone deletes it.

ITEM 5 OF 6

Someone using a photo application customer's session changed the account's recovery email. What does a password reset do to that change?
account.recovery_email.changed
  account:  photos.example customer 88213
  old:      m***@example.test
  new:      k***@example.test
  network:  192.0.2.0/24
  session:  created 3 minutes earlier on a new device

Enable JavaScript to check an answer here, or open the explanation below.

Show the answer and why

It survives, so the next reset request goes to the new address. A recovery contact controls future resets, so the attacker can reset the password again after the owner does. Notifying the old address when it changes gives the owner a chance to notice.

ITEM 6 OF 6

An attacker using an administrator's account added this secret. What does resetting that administrator's password do to it?
app.credential.added
  application:  hr-directory-sync
  credential:   client secret, expires in 2 years
  actor:        administrator account usr_0107
  note:         application holds User administrator

Enable JavaScript to check an answer here, or open the explanation below.

Show the answer and why

It survives, because the application has its own credentials. No person signs in when the application uses its secret, so the attacker can keep acting as it. The secret has to be found and removed, and the application's recent activity reviewed.

Try it in the Lab

PUT IT INTO PRACTICE

Check your understanding

Try these questions before moving on. If an answer isn't right, use the feedback and try again.

0 of 2 answered correctly

Enable JavaScript to answer these questions and save progress in this browser.

QUESTION 1 OF 2Cedar resets the password on a compromised account and signs out every session. The next day, the attacker is back in. What is the most likely explanation?

QUESTION 2 OF 2Why should a service ask for fresh proof of control before someone adds an authenticator to an account?

We value your privacy

We use cookies and similar technologies to enhance your browsing experience, and analytics to understand our traffic. By clicking "Allow All", you consent to optional analytics. Cookie Policy

Learn identity