1. Resources
  2. Identity Threats
  3. Microsoft Entra ID

Session Cookie Theft (Pass-the-Cookie)

Also known as: Pass-the-Cookie, ESTSAUTH cookie theft, Web session hijacking, Browser session theft

An attacker copies a signed-in user's browser session cookie, for Microsoft Entra ID or for one application, and loads it into their own browser to continue the session without password or MFA.

Platform
Microsoft Entra ID
Impact
High
Last updated
Attack difficulty
Low
Detection difficulty
High
Privileges required: Any authenticated identity
Code execution in the victim's user session, or read access to the browser profile, on a machine where the user is signed in to the web application.
What the attacker gains
The victim's authenticated web session: every application behind Entra single sign-on, or the one application whose cookie was taken.
Threat groups
APT42EvilnumKimsukyLotus BlossomLuminousMothSandworm TeamScattered SpiderStar BlizzardGroups that MITRE ATT&CK records using T1539, T1550.004.

How it works

A browser sign-in to a Microsoft Entra application creates more than one session.

First the browser signs in to Microsoft Entra ID. Entra sets its own session cookies on login.microsoftonline.com. Microsoft documents two that hold the user's session and provide single sign-on: ESTSAUTH, a transient cookie that lasts for the browser session, and ESTSAUTHPERSISTENT, a persistent cookie that is set when the session is allowed to persist, for example when the user answers Yes to "Stay signed in?". The persistent cookie remembers both the first and the second factor.

Then Entra redirects the browser to the application with a token or assertion, and the relying application creates its own session and sets its own cookie. That cookie has a different validator, lifetime and way of being ended. SharePoint Online's FedAuth and rtFA cookies are an example.

Pass-the-cookie means another presenter uses one of these cookies. Web sessions are bearer sessions: the server accepts whoever sends the cookie. This is credential theft of the result of authentication, not of the password, which is why MFA does not stop it. The two variants behave differently:

  • Entra session cookie. Loaded into the attacker's browser, it signs the attacker in to Entra as the user. Every application the user can reach is then one redirect away, and each redirect produces new tokens and new application sessions. The attacker can also turn the cookie into OAuth tokens for API access.
  • Application session cookie. It continues one session with one application. The application may see an ordinary request and Entra sees nothing at all, because no new sign-in happens.

A browser user-agent string identifies neither the cookie store nor the person presenting the cookie.

Prerequisites

  • The victim is signed in, in a browser, to Entra or to the target application, and the session has not expired.
  • The attacker can read the cookie: code execution in the user's session, access to the user's browser profile directory and the user's DPAPI context, or hands on an unlocked browser.
  • The session is not bound to the device and no policy re-evaluates the device or location in a way the attacker's browser fails.

Attack steps

For authorized security testing and lab use only. Run these steps against systems you own or have written permission to assess.

1. Read the cookie from the victim's browser

Chromium-based browsers keep cookies in an SQLite database in the user's profile, with the values encrypted by a key that is itself protected by DPAPI in the user's context. Running as the user, Mimikatz decrypts the database:

mimikatz # dpapi::chrome /in:"%localappdata%\Microsoft\Edge\User Data\Default\Network\Cookies" /unprotect
mimikatz # dpapi::chrome /in:"%localappdata%\Google\Chrome\User Data\Default\Network\Cookies" /unprotect

The output lists each cookie with its host, name and value. The entries to look for are ESTSAUTHPERSISTENT and ESTSAUTH for the host login.microsoftonline.com, or the session cookie of the target application.

With an unlocked browser in front of them, an attacker needs no tool: the browser's developer tools show the cookies of the current site with their values.

2. Replay the Entra cookie for tokens

roadtx starts a browser sign-in with the cookie already set and redeems the result for tokens:

# Tokens for Microsoft Graph as the Teams client, from the stolen session
roadtx interactiveauth --estscookie "ESTSAUTHPERSISTENT_VALUE" -c msteams -r msgraph

# Keep the browser open and browse as the user instead
roadtx interactiveauth --estscookie "ESTSAUTHPERSISTENT_VALUE" -url https://myapps.microsoft.com --keep-open

The tokens land in .roadtools_auth and are then used as described in access token and refresh token replay.

3. Or replay it in a browser by hand

In a clean browser profile, open https://login.microsoftonline.com, add a cookie named ESTSAUTHPERSISTENT with the stolen value for that host (Secure and HttpOnly set), and browse to a Microsoft 365 or Azure portal URL. Entra finds a valid session and redirects to the application signed in as the victim.

4. Application cookie variant

For an application's own cookie the steps are the same with that application's host and cookie name. No request goes to Entra, so Conditional Access is not evaluated again.

5. Make the access last

A cookie session ends when it expires or is revoked. Attackers use the session to add something longer-lived: a rogue MFA method or device, a mailbox rule or an application consent.

Impact

With the Entra cookie the attacker has the user's single sign-on: mail, files, chat, admin portals if the user is an administrator, and every federated SaaS application. With an application cookie the reach is that one application, but the session can be harder to end, because the application validates it without asking Entra.

The session carries the original authentication, so the sign-in log shows MFA as satisfied and no prompt reaches the user. The user keeps working in their own browser and notices nothing.

OPSEC and artifacts

  • Take the persistent cookie. ESTSAUTHPERSISTENT outlives the browser being closed, so it stays useful longer than the transient cookie. Reading it means touching the browser's cookie database and the user's DPAPI key, which is file and API activity on the endpoint.
  • Copy the browser context. Matching the victim's user agent removes one difference. The user agent proves nothing about who presents the cookie, and the source IP address still changes.
  • Use the cookie from the same network. A session that moves to another country or to a hosting provider raises anomaly detections. From inside the victim's network the sign-ins look like the user's own.
  • Entra cookie replay does create sign-ins. Each application the attacker opens produces a sign-in row with the attacker's address, the existing session ID and authentication details that show the requirement was satisfied by an earlier claim instead of a fresh challenge.
  • Application cookie replay does not. There is no universal Entra event for the use of an application's cookie. Only the application's own access log shows the requests, and only if the route required authentication and the log resolves a principal. A gap in the Entra sign-in log cannot tell cached application access from session misuse.
  • Session lifetime. Sign-in frequency and persistent browser session policies cap how long the cookie works. The applied policies are recorded in the sign-in's session lifetime details.
  • Revocation boundary. After the user's sessions are revoked, the Entra cookie stops working. A relying application's session can continue until that application ends it.

Detection

Detection works on continuity: one session, two presenters.

  • Risk detections. ID Protection's anomalous token detection covers session tokens as well as refresh tokens, and the attacker in the middle detection flags sessions tied to a phishing proxy. Both are in the token theft rules. See also high-risk sign-in succeeded.
  • Same session, new context. A SessionId that appears with a new IP address, country, operating system or browser while the old context is still active.
  • No fresh challenge. Interactive sign-ins from a new address where every authentication step was satisfied by a previous claim.
  • Endpoint. Processes other than the browser reading the browser's cookie database or Local State file.
  • Application logs. For important applications, session creation, validation and termination events from the application's own schema, compared with the Entra sign-ins that should have preceded them.
// Sessions that appear with more than one browser, OS or address
SigninLogs
| where TimeGenerated >= ago(1d) and ResultType == "0" and isnotempty(SessionId)
| extend OS = tostring(DeviceDetail.operatingSystem), Browser = tostring(DeviceDetail.browser)
| summarize Addresses = make_set(IPAddress, 10), Countries = make_set(Location, 10),
            Systems = make_set(OS, 5), Browsers = make_set(Browser, 5),
            First = min(TimeGenerated), Last = max(TimeGenerated)
    by UserPrincipalName, SessionId
| where array_length(Addresses) > 1 and (array_length(Systems) > 1 or array_length(Browsers) > 1)

A changed network alone does not identify who controls a session. Mobile networks, proxies and VPN exits explain many hits, so treat the query as a review list and confirm with the endpoint and the application's log.

Mitigation

  • Shorten and control browser sessions. Use Conditional Access session controls: sign-in frequency for sensitive applications and "never persistent" browser sessions on unmanaged devices. Consider hiding the "Stay signed in?" prompt.
  • Require a compliant device. A cookie replayed from the attacker's machine then fails wherever the policy is evaluated, which is at each new application sign-in with the Entra cookie.
  • Bind sessions where supported. Conditional Access token protection binds the sign-in session to the device for supported clients and resources. Browser coverage is limited, so check the current support matrix before relying on it.
  • Keep privileged work in a separate browser profile or workstation, so an infostealer on the daily machine does not find an administrator's session.
  • Protect the endpoint. Cookie theft needs code running as the user. Endpoint protection, application control and current browsers, which protect cookie encryption keys more strongly, shrink that opening.
  • Use risk policies. A sign-in risk policy that requires reauthentication, set up as in the risky users guide, interrupts sessions that ID Protection flags.
  • Plan revocation per application. When responding, revoke the user's sessions in Entra, reset the password, and ask the owners of important applications to end the user's sessions there too. Check each resource for continued access instead of assuming that elapsed time ended it.

Detection rules for this attack

Log events to collect

FAQ

Why does a stolen cookie work without MFA?

The cookie is the record that the user already signed in, including the MFA step. When a browser presents it, Microsoft Entra ID or the application continues the existing session and does not ask again. The second factor protected the sign-in, not the cookie that the sign-in produced.

What is the difference between the Entra cookie and an application's cookie?

The Entra cookies (ESTSAUTH and ESTSAUTHPERSISTENT on login.microsoftonline.com) represent the session with the identity provider and give single sign-on to every application the user can reach. An application's own cookie represents a session with that application only. They have different lifetimes and are ended by different controls.

Does revoking the user's sessions in Entra end a hijacked session?

It ends the Entra session, so the stolen Entra cookie no longer produces new tokens. A session cookie issued by a relying application is validated by that application. It can keep working after the Entra revocation until the application ends it, it expires, or the application reacts to a continuous access evaluation event.

How is pass-the-cookie different from token theft?

The stolen object and the place it is used differ. A cookie is presented by a browser to a website and continues a web session. An access or refresh token is presented by a client to an API or to the token endpoint. The effect is similar, and an Entra session cookie can be turned into tokens, but the artifacts and the mitigations are not the same.

References

Techniques, tactics and threat groups: MITRE ATT&CK® Enterprise v20.1. © The MITRE Corporation. This work is reproduced and distributed with the permission of The MITRE Corporation. Last updated 2026-11-29.

Does this attack work in your environment?

Forestall maps every identity and the attack paths between them across Active Directory, Entra ID and cloud, read-only and agentless.