Detecting and Mitigating 'Pass-the-Cookie' Attacks in Microsoft 365 and Beyond
identitysopincident-response

Detecting and Mitigating 'Pass-the-Cookie' Attacks in Microsoft 365 and Beyond

DDaniel Mercer
2026-05-08
23 min read

Learn how pass-the-cookie attacks work, detect them in Microsoft 365 logs, and revoke tokens fast with a practical SOC playbook.

Session-cookie theft has become one of the most practical ways for attackers to bypass MFA and take over cloud identities without ever needing to crack a password. In Microsoft 365 environments, that means a stolen browser session can be just as dangerous as a stolen credential, especially when it is replayed from a clean-looking device or proxy. The good news is that defenders can still detect the pattern if they know what to look for in identity logs, cloud activity, and endpoint telemetry. This guide explains the mechanics of pass-the-cookie, how it differs from classic credential theft, and how to build a response playbook that includes token revocation, conditional access tightening, and SOC automation.

For teams building a broader identity defense strategy, it helps to think about this attack as part of the same ecosystem that includes infostealers, browser token theft, and session replay. If you are also evaluating where identity telemetry fits into your stack, the detection and response concepts in our guide to identity, authorization and forensic trails translate surprisingly well to cloud access investigations. And because many modern intrusions start with commodity stealer malware rather than custom implants, our practical view on infostealer prevention is directly relevant to the earliest phase of this kill chain.

Session cookies are post-authentication access, not just browser clutter

In a modern cloud login, the password is only the first gate. After authentication, the identity provider issues a session artifact, often a cookie or token, that tells the service the user has already passed MFA and can continue working without re-verifying every request. Attackers who steal that artifact can impersonate the user from another machine, often without triggering a fresh MFA prompt. This is why defenders sometimes see account activity that looks legitimate even though the original user never approved it.

In Microsoft 365, these sessions can span Exchange Online, SharePoint, Teams, and Azure AD-backed applications. A stolen cookie can provide immediate access to mailboxes, documents, chat history, and connected SaaS apps. The attacker may not need the password at all if the session remains valid. That makes cookie theft especially attractive to operators who buy access from infostealer logs and want fast monetization with minimal noise.

Commodity malware families such as Stealc, RedLine, Lumma, and similar stealers harvest browser data at scale, including cookies, saved credentials, and session artifacts. They are popular because they are cheap, widely available, and effective enough to bypass MFA in many organizations. Huntress notes that infostealers have become one of the top initial access vectors for ransomware because they shortcut traditional exploitation paths and hand attackers usable identities. That insight is important: if you can stop the infostealer, you often stop the session hijack before it starts.

For defenders, the practical implication is that endpoint hygiene and identity monitoring must be joined at the hip. A browser cookie is not just a web artifact; in an enterprise context, it is an authentication bearer instrument. That is why a serious SOC should combine endpoint telemetry, cloud sign-in logs, and identity posture signals rather than treating them as separate worlds. If your team is mapping controls, the logic behind choosing resilient technology that protects the system is the same: remove weak links before they become incidents.

These attack methods are related but not identical. Password spraying guesses a password until one account yields, and the attacker then still has to get through MFA or some other second factor. Pass-the-token or pass-the-cookie starts after a successful login, often by stealing a valid artifact from a browser or memory store and replaying it elsewhere. The advantage for the attacker is speed and stealth: they inherit trust already granted by the identity provider. That also means your detections must focus less on failed logins and more on impossible travel, unfamiliar device posture, anomalous user agents, and suspicious post-authentication activity.

In other words, the “front door” is not always where the compromise shows up. A stolen session can be used hours later, from a different ASN, through a clean browser, and still appear valid. If you only monitor bad passwords, you will miss the threat class entirely. This is why modern identity defense requires new ways to inspect session lifecycle, not just login success or failure.

How Session Hijacking Works in Microsoft 365

From browser cache to mailbox access

Most real-world compromises start on the endpoint. The victim opens a phishing page, installs a trojanized utility, or runs an infostealer dropped by a malicious email attachment. The malware then looks for browser cookies, profile files, local storage, and SSO artifacts. Once the attacker extracts the session data, they can replay it into a browser or API client and land directly in Microsoft 365 as the victim. From there, they may create inbox rules, forward mail externally, search for finance documents, or stage business email compromise.

One practical reason this works so well is that browsers are designed to reduce friction. They store authentication state so users do not need to sign in repeatedly, and cloud services trust that state until it expires or is revoked. Attackers exploit that convenience. Defenders need to assume that any sufficiently privileged or recently active session could already be in an attacker’s hands after a stealer infection.

Why MFA is not enough if the session is already issued

MFA is essential, but it is primarily a login control. If the user has already authenticated and the session is valid, the attacker may not need to satisfy MFA again. That is why organizations can be shocked to see “MFA successful” in the logs even though the user was compromised. The issue is not that MFA failed; it is that the attacker inherited an authenticated session after MFA succeeded legitimately.

Defenders should therefore treat MFA as necessary but not sufficient. Stronger controls include device compliance, conditional access rules that require trusted hardware, sign-in risk checks, session lifetimes, and token revocation procedures. For teams evaluating how controls chain together, the broader operational lesson from automating repeatable workflows is relevant: the more deterministic your response steps, the faster you can contain identity abuse. The same principle appears in our guidance on streamlining operations with automation, which is exactly what a mature SOC needs during an identity incident.

What attackers do after they land

Once inside Microsoft 365, attackers often move in a predictable pattern. They check mailbox rules, download attachments, search for password resets, locate financial approvals, and enumerate shared files or Teams chats. In some cases they add their own forwarding rule, export mailbox content, or use the tenant to launch internal phishing. They may also pivot into connected systems via SSO if the same identity is trusted elsewhere.

That means the attack surface extends beyond Microsoft 365 itself. If the same session can access third-party apps, collaboration platforms, or VPN portals, the damage can become cross-platform quickly. The operative question for defenders is not merely “Was the password stolen?” but “Which trusted services accepted the stolen session, and for how long?”

Detection Signals in Microsoft 365, Entra ID, and Cloud Logs

High-confidence identity signals to monitor

The most important signal is a mismatch between the user’s normal behavior and the session context. Watch for new countries or ASNs, impossible travel, unusual device fingerprints, and browser/user-agent strings that do not match the user’s history. A sudden switch from managed corporate devices to unmanaged personal devices is also suspicious, especially if the session immediately accesses sensitive mail or file shares. In Entra ID and Microsoft 365 logs, these anomalies often appear as “successful” sign-ins paired with abnormal risk context rather than overt failure events.

You should also pay close attention to token-related events. Conditional Access logs can reveal when a session is allowed because the token was already valid, while sign-in logs may show a refresh token or persistent browser session. If you see a legacy protocol, device code flow misuse, or sign-ins from an impossible geography within a short window of a real user session, treat it as a likely hijack until proven otherwise. A strong detector also correlates identity events with endpoint telemetry from the same time period.

Mailbox, SharePoint, and Teams indicators of compromise

Attackers who gain Microsoft 365 access often leave behavioral breadcrumbs. Common signs include new inbox rules that hide or forward messages, deleted sent items, mail forwarding to external addresses, and large mailbox searches around payroll, invoices, or password reset phrases. In SharePoint and OneDrive, look for bulk downloads, unusual file access times, or access from unfamiliar user agents. In Teams, watch for suspicious message sending, file sharing, or lateral messaging that starts shortly after the suspicious sign-in.

These data points are strongest when combined. A single login from a new IP is not enough on its own, especially in remote-work environments. But a new IP plus fresh inbox rules plus atypical file access plus an endpoint stealer alert creates a compelling case. If you need help structuring investigations around evidence quality, the analytical discipline in reproducible analytics pipelines is a useful mental model: every conclusion should be reconstructable from logged events.

Endpoint and browser artifacts that strengthen the case

Cloud logs alone can tell you the session is suspicious, but endpoint telemetry often tells you why. EDR alerts for stealer behavior, suspicious archive creation, browser profile access, credential-dumping tools, or local script execution can establish the initial compromise. Browser artifacts such as sudden new cookie stores, abnormal profile copying, or suspicious process access to browser files can support a session-theft hypothesis. If the user’s device also shows fresh malware execution around the time of the cloud event, you can elevate from “potential takeover” to “active compromise.”

In practice, a mature SOC should correlate endpoint time, sign-in time, and mailbox actions in one incident view. That correlation is what helps separate a legitimate roaming employee from a malicious replay. Huntress is worth studying here because its identity-focused detections are designed to connect cloud login anomalies with endpoint and identity context rather than treating them as isolated alerts. For teams refining their tooling, the same logic that drives toolchain fit decisions applies to security stack design: choose systems that help you inspect the full workflow, not just one step.

Rapid Response Playbook: Contain the Session in Minutes

First 15 minutes: freeze the blast radius

When you suspect pass-the-cookie, the first goal is to kill the attacker’s active trust. Immediately disable the user account if the impact is severe, or at minimum revoke the user’s sessions and refresh tokens. In Microsoft Entra ID, this means invalidating the current refresh token state so future access requires reauthentication. If the account is privileged, move faster and consider disabling the account before investigation, because a stolen admin session can create persistent backdoors very quickly.

You should also check for mailbox rules, OAuth consent grants, app passwords, new device registrations, and unusual forwarding settings. If the compromise is tied to a managed endpoint, isolate it from the network and preserve forensic evidence. The key is to reduce the attack surface before the adversary can use the session to spread. In many incidents, the difference between a single account compromise and a wider breach is how quickly the first responder acts.

Token revocation and session invalidation steps

Token revocation is the core containment action, but defenders should understand its limits. Revoking refresh tokens invalidates the ability to obtain new access tokens, yet some access may persist until short-lived tokens expire. That is why it should be paired with password reset, MFA re-registration where appropriate, and session termination across connected apps. If the account had high-value privileges, also review whether other devices or services trusted the same identity provider and require separate revocation there too.

A practical playbook might be: revoke sessions, force password reset, remove active device trust, revoke consented OAuth apps, and verify all mailbox/forwarding rules. Then monitor for reauthentication attempts from the same IP, ASN, or browser signature, which often reveal the attacker’s automation. If you are evaluating operational readiness, the discipline behind choosing the right platform before you commit matters here too: you need control points that are actually enforceable during an incident, not just documented in theory.

Example incident timeline for a Microsoft 365 takeover

Consider a finance user who clicks a fake document viewer prompt on Monday at 08:40. Their browser cookies are stolen, and the attacker replays the session at 09:05 from a VPS in another region. At 09:12, the attacker creates an inbox rule to move invoices to an archive folder, then searches for “urgent payment” and “bank details.” At 09:18, the SOC correlates the login anomaly with an EDR alert on the endpoint, isolates the device, and revokes sessions. By 09:25, the attacker loses access, but not before attempting to send a payment-change request to the accounts payable team.

This timeline shows why response must be both cloud-native and endpoint-aware. If the SOC had only seen a successful sign-in, it might have waited. If it had only seen endpoint malware without correlating identity, it might have missed the live hijack. The strongest defense combines both streams into one response sequence.

Conditional Access Rules That Actually Reduce Risk

Build policies around device trust and session quality

Conditional Access should not be a one-size-fits-all gate. For high-risk applications such as admin portals, finance systems, and mail access, require compliant devices, strong authentication, and risk-based prompts. If your workforce uses BYOD or contractors, create segmented policies rather than allowing unrestricted access from every unmanaged endpoint. This reduces the chance that a stolen cookie from a personal laptop can be replayed successfully into your production tenant.

Shorten session lifetimes for privileged roles and sensitive apps, and use sign-in frequency controls where operationally tolerable. The goal is to reduce the window in which a stolen session remains useful. For more on buying and validating security decisions instead of accepting marketing claims, the practical checklist in spotting real tech savings and verifying claims is a useful procurement analogue. Security controls should be checked like any critical purchase: what exactly do they stop, and under what conditions?

Use risk-based access to force reauthentication

Identity protection signals are particularly useful when combined with Conditional Access. If Microsoft flags a sign-in as risky because of impossible travel, unfamiliar properties, or atypical token behavior, you can require MFA again, block the sign-in, or enforce a fresh device check. This is valuable because it interrupts replayed sessions that are trying to masquerade as normal traffic. The challenge is to avoid overblocking legitimate mobile or traveling users, so tune policies carefully and test them with real teams.

For UK organizations, it is also wise to align access controls with data classification and business criticality. Not every user needs the same friction, but privileged and finance roles should face much stricter controls. To understand why governance and trust criteria matter in technology selection, our guide on reading company actions before you buy offers a useful pattern for assessing whether a vendor’s promises are backed by operational maturity.

Privileged access deserves a separate policy layer

Admin accounts should never share the same Conditional Access posture as everyday users. Require phishing-resistant MFA, compliant managed devices, limited session duration, and just-in-time privileged elevation wherever possible. Privileged roles should be monitored continuously for changes in device, location, and login pattern, because a hijacked admin session can be used to create persistence faster than ordinary user sessions. The most damaging compromises often happen not because access existed, but because access was too broadly trusted.

As a practical rule, separate admin accounts from daily-use accounts, and forbid general browsing on elevated identities. If your team needs a parallel model for how to create safer operating patterns, the methodical approach in building durable systems through lifelong discipline is a reminder that security maturity comes from habits, not heroics. Good access design is boring, repeatable, and hard to subvert.

SOC Automation and Hunt Workflows

Turn repeated checks into playbook automation

Most pass-the-cookie incidents involve the same sequence of checks: suspicious sign-in, endpoint infection validation, mailbox rule inspection, token revocation, and user containment. That makes them ideal for automation. Your SOAR or SIEM should automatically enrich events with geo-IP, ASN, user agent, device compliance, and prior sign-in history, then open an incident only when multiple signals align. This reduces alert fatigue and keeps analysts focused on the events most likely to represent active compromise.

Automation can also trigger safe actions. For example, if a high-risk sign-in appears from a new country immediately after an EDR stealer alert, the system can isolate the device, revoke tokens, and page the on-call analyst. That combination is much more useful than a pile of disconnected alerts. The same strategic logic behind on-demand insights workflows applies to security operations: prebuild the process so the team is not inventing it under pressure.

What to hunt for every week

A weekly hunt should review impossible-travel sign-ins, new device registrations, fresh inbox forwarding rules, anomalous OAuth grants, and sign-ins following infostealer detections. Look for users who recently triggered browser or stealer-related endpoint detections and then successfully accessed Microsoft 365 from a different device within a short time window. Also query for accounts with repeated token refresh events from atypical regions, which can indicate active session replay or token persistence. These hunts are especially valuable for finding low-and-slow compromises that did not trigger immediate user reports.

If you need to expand hunting beyond Microsoft 365, apply the same logic to Google Workspace, Salesforce, VPNs, and SSO portals. The attack concept is identical: a bearer artifact is reused by someone else. That universality is why Huntress frames identity compromise as a cross-environment problem rather than a product-specific one. For a broader strategic lens, our guide on quantum readiness without the hype offers a useful discipline: focus on practical risk reduction now, not theoretical threats later.

How Huntress-style managed detection helps reduce noise

One of the hardest parts of identity defense is separating a real hijack from normal user behavior. Managed detection teams that specialize in identity can validate whether a login pattern is suspicious enough to act on, rather than forcing your internal team to investigate every borderline event. Huntress positions this as continuous detection and response across identity and endpoint telemetry, which is useful because the strongest evidence often comes from the combination of signals. A good SOC should aim for that same outcome, whether it is delivered in-house or by a managed partner.

There is also a workflow benefit. If your internal analysts are overloaded, your tooling should surface only high-value events, enrich them automatically, and provide recommended remediation steps. That reduces mean time to contain and lowers the chance that an attacker can continue using a stolen session while humans debate whether it is “really suspicious.”

VPNs, SSO portals, and SaaS apps are equally exposed

Any environment that uses browser-based sessions can be targeted with cookie theft and replay. VPN portals, remote access gateways, HR systems, CRM platforms, and collaboration tools all rely on bearer sessions that can be abused if stolen. The mechanics are the same even when the brand changes: a valid session on the wrong machine becomes attacker-controlled access. That means the detection mindset you build for Microsoft 365 should extend across your wider SaaS and remote access stack.

This is especially important for organizations with hybrid work and third-party contractors. A stolen browser session from a contractor laptop can become the entry point into a much larger vendor or customer environment. For a real-world example of how stolen credentials and outdated remote access tooling can be exploited, see the lessons in infostealer-driven compromise scenarios. The lesson is consistent: identity trust must be checked continuously, not assumed after login.

Browser hardening and endpoint controls matter more than many teams expect

Because the browser is where most cookies live, browser hardening is a frontline defense. Use enterprise browser policies, disable unnecessary profile sync, restrict extension installation, and consider endpoint protections that prevent credential and cookie theft. Keep browsers patched, remove local admin rights where possible, and monitor for suspicious extraction behavior from browser data stores. If a stealer cannot harvest the session, the pass-the-cookie attack never leaves the ground.

There is no single silver bullet here. The correct defense is layered: strong endpoint prevention, tight identity controls, short-lived sessions, and rapid revocation. Think of it as a system where each layer closes off a different phase of the attack chain. That operational mindset is similar to the comparison discipline in evaluating true total cost rather than just sticker price: what matters is durability under stress, not only convenience on paper.

Comparison Table: Controls, Signals, and Operational Value

Control or SignalWhat It Detects or PreventsStrengthLimitationsBest Use Case
Impossible travelSame identity used from impossible locations in a short windowHigh for suspicious replayCan false positive with VPNs or mobile travelInitial triage in Entra ID
New device / user agentSession replay from a different browser or endpointHigh when baseline existsLegitimate device changes can trigger alertsCorrelation with endpoint logs
Mailbox forwarding rulesBusiness email compromise and exfiltrationVery highMay be set by users intentionally if not governedPost-compromise investigation
Token revocationStops stolen sessions from refreshingCritical containmentExisting access may persist brieflyFirst 15 minutes of response
Conditional Access complianceBlocks unmanaged or risky device accessHigh prevention valueRequires device management maturityPrivileged and sensitive app access
EDR stealer alertConfirms probable source of cookie theftHigh confidenceNot every session hijack has endpoint telemetryEndpoint plus cloud correlation
OAuth consent reviewMalicious app persistence and access abuseHighOften overlookedIdentity hygiene and incident hunting

This table is useful because session hijacking is rarely identified by one perfect event. Instead, defenders need a matrix of signals that become convincing together. The control that stops the blast radius may be token revocation, but the control that helps you explain the compromise is a blend of access logs, endpoint telemetry, and mailbox activity. That is what makes pass-the-cookie both difficult and highly detectable when you know the pattern.

Implementation Checklist for Security Teams

Baseline your users and privileged roles

Start by defining normal patterns for geography, device type, browser version, and login times for critical users. Build separate baselines for administrators, finance staff, executives, and helpdesk users. You cannot detect “anomalous” behavior if you have no idea what normal looks like. This baseline should be reviewed monthly and updated whenever remote work patterns or travel habits change significantly.

Then document which accounts have the highest blast radius and place them under stricter policy. If you only have time to harden a subset of users first, prioritize admins and finance. That sequencing will give you the best reduction in impact per unit of effort.

Instrument the right logs

Ensure you are collecting Entra ID sign-in logs, audit logs, Microsoft 365 mailbox activity, SharePoint/OneDrive access, and endpoint EDR telemetry. Add cloud app logs for any SaaS applications connected through SSO. Without this visibility, you will know an account was used, but not whether it was used by the real user. For response efficiency, normalize these events into a SIEM or case management system where they can be queried together.

If your logging strategy is inconsistent, you will discover it during an incident, which is the worst possible time. That is why the governance mindset in designing credible corrective processes is relevant to security operations too: if you make a claim about visibility, make sure the evidence supports it.

Test the playbook quarterly

Run purple-team exercises that simulate browser cookie theft and session replay. Validate that your SOC can see the suspicious sign-in, isolate the endpoint, revoke sessions, and inspect mailbox rules within the expected time window. Measure how long it takes to contain the account, not just how long it takes to generate an alert. Then fix the gaps you discover, whether they are missing logs, poor triage logic, or unclear ownership between teams.

These exercises are where theory becomes operational truth. They also reveal whether your Conditional Access rules are protecting you or merely inconveniencing users. A control that works only in the slide deck is not a control.

Conclusion: Treat Sessions Like Credentials

The attacker only needs one valid moment

Pass-the-cookie attacks succeed because modern systems trust session artifacts long after the password has been entered. Once a cookie is stolen, the attacker can often bypass MFA, blend into legitimate traffic, and move quickly through Microsoft 365 or other cloud services. That is why the right defense model is not “protect the password and hope for the best,” but “protect the session, detect the replay, and revoke trust fast.”

Organizations that win against this threat class do three things consistently: they prevent infostealer infections where possible, they monitor cloud and endpoint logs for post-authentication anomalies, and they automate containment so human analysts can act at machine speed. Whether you run the SOC in-house or partner with a managed service such as Huntress, the operational goal is the same: make stolen sessions short-lived, noisy, and expensive for attackers.

For broader reading on how to think about resilient access, vendor claims, and operational controls, you may also find value in our guides on verifying service trust assumptions, building credibility from evidence, and turning analysis into actionable formats. In security, the best posture is not to assume sessions are safe; it is to prove they are safe continuously.

FAQ

What is a pass-the-cookie attack?

It is a session hijacking technique where an attacker steals a browser session cookie or similar token and reuses it to impersonate the victim. Because the token already reflects a successful login, the attacker may bypass MFA and enter cloud apps as the user.

How is pass-the-cookie different from stealing a password?

Stealing a password gives the attacker raw credentials, but they still need to authenticate and may face MFA. Stealing a session cookie gives the attacker an already authenticated session, which is often more immediately useful and harder to spot in logs.

What should I revoke first during an incident?

Revoke the user’s sessions and refresh tokens immediately, then reset the password and review mailbox rules, OAuth grants, and device trust. If the account is privileged, consider disabling it first while you investigate to prevent lateral movement or persistence.

Can Conditional Access stop a stolen cookie?

It can reduce risk significantly, but it is not a perfect shield once a session is already valid. Device compliance, sign-in risk policies, short session lifetimes, and phishing-resistant MFA all help limit usefulness and duration of a stolen session.

What logs are most important for detecting session hijacking?

Start with Entra ID sign-in logs, Microsoft 365 audit logs, mailbox rule changes, SharePoint/OneDrive access logs, and endpoint EDR telemetry. The strongest detections come from correlating identity anomalies with endpoint evidence of infostealer activity.

How does Huntress help with infostealer and identity attacks?

Huntress emphasizes detection and response across identities and endpoints, which is important because cookie theft usually starts on the device but manifests in the cloud. That cross-signal approach helps validate suspicious logins, identify source malware, and shorten time to containment.

Related Topics

#identity#sop#incident-response
D

Daniel Mercer

Senior Cybersecurity Editor

Senior editor and content strategist. Writing about technology, design, and the future of digital media. Follow along for deep dives into the industry's moving parts.

2026-05-14T03:20:11.537Z