Cookie theft is the stealing of a session cookie, the token a website gives your browser after you log in, so an attacker can use it to act as you without your password or MFA code. Infostealer malware is now the main cause, followed by adversary-in-the-middle phishing and cross-site scripting. The fix is revoking the session, changing passwords, and using phishing-resistant MFA such as passkeys.
Key takeaways
- A session cookie is temporarily as powerful as your password and MFA combined, because the server trusts whoever holds it.
- Infostealer malware that copies browser cookie stores is now the main way session cookies are stolen.
- If a cookie is stolen, changing your password is not enough: the session itself must be revoked and all other sessions signed out.
You log in once, tick "remember me", and never type your password again. That convenience is a small file in your browser called a session cookie. Whoever holds a copy of it is you, as far as the website is concerned — no password, no MFA code, no questions asked.
What is cookie theft?
Cookie theft is the stealing of a session cookie, the token a website gives your browser after you log in, so an attacker can use it to act as the logged-in user without the password or MFA code.
HTTP has no memory. After you sign in, the server sends your browser a random identifier in a Set-Cookie header, and the browser returns it with every later request so the server knows who is asking. OWASP puts it plainly: once a session exists, the session ID is "temporarily equivalent to the strongest authentication method used by the application".
That is what makes the theft so powerful. The attacker does not break your password. They skip the login page entirely, and with it the password check, the one-time code and most of the alarms tied to sign-in. MITRE ATT&CK catalogues the theft as technique T1539, Steal Web Session Cookie, and the reuse as session-cookie replay.
How does cookie theft work?
Cookie theft works in four steps: you log in, the site issues a session cookie, a copy of that cookie leaves your control, and the attacker replays it from their own machine while the server treats them as you.
- You sign in with a password and an MFA code or prompt. This is the only moment MFA is checked.
- The site issues a session cookie. From now on, the cookie alone keeps you signed in, often for hours or days.
- A copy leaves your control. Malware reads the browser's cookie store, a fake login page relays your sign-in and keeps the cookie, or a bug on the site exposes it.
- The copy is used elsewhere. The server sees a valid session and asks for nothing. The attacker can read your email, change settings, send messages or move money.
The theft is silent. There is no failed login to alert on, because no login happens. The first sign is usually a security email about a new device or location, or a change you did not make.
How are session cookies stolen?
Session cookies are stolen mainly by infostealer malware, by adversary-in-the-middle phishing pages that relay your login, by cross-site scripting on a vulnerable site, and by sniffing traffic on unencrypted connections.
Infostealer malware
Infostealers are the largest source today. A victim runs a disguised file, often a fake software crack, a poisoned download or a fake CAPTCHA page, and the malware copies cookie stores and saved passwords from every browser on the machine, then uploads them within minutes.
The scale is large. In advisory AA25-141B, published on 21 May 2025, the FBI and CISA described LummaC2, an infostealer sold as malware-as-a-service since at least 2022, which collects browser cookies, credentials, crypto wallets and MFA details.
Private-sector data cited in the advisory showed more than 21,000 listings selling LummaC2 logs between April and June 2024, a 71.7 percent increase on the same period in 2023. Microsoft identified over 394,000 Windows computers infected with Lumma between 16 March and 16 May 2025, as summarised in the Infostealer Threat Guide.
Adversary-in-the-middle phishing
In this attack, a fake login page sits between you and the real site. You type your password and MFA code into the fake page, it forwards them to the real site, and the real site returns a session cookie, which the attacker keeps. You may even reach the real site afterwards, so nothing looks wrong.
This is why one-time codes do not stop it. The attacker relays the code in real time, inside its short lifetime, and the cookie they capture is valid long after the code expires.
Cross-site scripting (XSS)
If a website has an XSS flaw, an attacker can run JavaScript in your browser on that site and read document.cookie. The HttpOnly cookie flag exists to stop exactly this: it tells the browser not to expose the cookie to scripts. Sites that forget the flag leave the door open.
Network sniffing
The oldest route reads cookies sent unencrypted over a network. Near-universal HTTPS has made it rare, but it still works on sites that serve any page over plain HTTP, or on open Wi-Fi where an attacker can intercept traffic. The Secure flag, which tells the browser to send a cookie over HTTPS only, closes this route.
Why does cookie theft bypass MFA?
Cookie theft bypasses MFA because MFA is verified at login, and a stolen session cookie lets the attacker skip login entirely. The server has already decided the user is authenticated, so it never asks for a second factor.
This surprises people who think MFA makes an account safe. MFA protects the front door. A session cookie is a key copied after the door was opened. MITRE notes that stolen session cookies can be used to bypass some MFA protocols, because the attacker does not need the user's credentials at all.
The defense that does stop it is phishing-resistant MFA, such as passkeys or FIDO2 security keys. These bind the authentication to the real website, so a fake login page cannot relay them, and modern implementations can bind the session to the device. Short session lifetimes also help: a cookie that expires in hours is less useful than one that lasts for weeks.
What are the signs your cookies were stolen?
The signs are logins from places you have never been, new devices on your account security page, changed passwords or recovery details, and mail rules or sent messages you did not create.
- New sign-in alerts for a device, browser or country you do not recognise.
- Password or recovery changes you did not make, or a prompt saying your password was changed.
- Mail-forwarding rules sending your email to an address you do not own.
- Sent messages or posts you did not write, or contacts reporting odd messages from you.
- Locked out of your own account because the attacker changed the credentials first.
Check the security or sessions page of your important accounts, Google, Microsoft, Apple, your bank and your email, and review every active session. If anything looks unfamiliar, treat the account as compromised and follow the steps below. You can also check whether a password from the same device appears in known breaches with our pwned password checker.
What should you do if your session cookies were stolen?
Act fast and in this order: revoke all sessions, change the password from a clean device, remove unknown devices and mail rules, then check for malware and re-secure the account.
- Sign out everywhere. Use the account's "sign out of all devices" or "revoke all sessions" option. This kills the stolen cookie. Changing the password alone does not do this.
- Change the password from a clean device. If the device is infected, a new password will be stolen too. Use a different, trusted device, and make the new password unique. Our password generator can create one.
- Check mail rules and recovery settings. Look for forwarding rules, new recovery emails or phone numbers, and unknown app passwords or API keys. Remove anything you did not add.
- Scan for malware. Run a full scan with reputable antivirus or endpoint protection, and remove anything it finds. If the infection is serious, consider reinstalling the operating system.
- Re-enrol MFA. If authenticator app data or MFA details were exposed, remove and re-add your second factor, and prefer a passkey or security key.
- Check other accounts. Treat every credential, cookie and token on the infected device as stolen, and revoke sessions on each important service.
How do you prevent cookie theft?
Prevention has two sides: users reduce the chance a cookie leaves their machine, and websites make stolen cookies harder to use and shorter-lived.
For users
- Use passkeys or a security key where the site offers them. They resist phishing in a way one-time codes cannot.
- Do not run files from untrusted sources. Fake cracks, free software from shady sites and fake CAPTCHA pages are the main infostealer delivery routes.
- Keep your browser and operating system updated, and run reputable antivirus or endpoint protection.
- Log out of important accounts on shared computers, and do not tick "remember me" on a device you do not own.
- Review active sessions regularly in your Google, Microsoft and email account security pages.
For website owners and developers
OWASP's Session Management Cheat Sheet sets the baseline. Session IDs must have at least 64 bits of entropy from a secure random generator, and a new session ID must be issued at login and at every privilege change.
Sessions also need both an idle timeout and an absolute timeout. OWASP's examples are 2 to 5 minutes idle for high-value applications, 15 to 30 minutes for low-risk ones, and an absolute timeout of 4 to 8 hours.
Cookie flags matter too. Set Secure so the cookie only travels over HTTPS, HttpOnly so scripts cannot read it, SameSite=Lax or Strict, and the __Host- prefix where you can.
Serve the whole site over HTTPS, and test your headers with our security headers checker. Session fixation, where an attacker plants a session ID before you log in, is closed by the same rule: always issue a fresh ID after authentication.
Cookie theft vs CSRF vs session fixation
These three attacks all abuse sessions, but they work differently. In cookie theft, the attacker has your cookie and sends requests from their own machine. In cross-site request forgery (CSRF), the attacker never sees your cookie: they trick your browser into sending a request that carries it. In session fixation, the attacker gets you to log in using a session ID they already know, then uses it themselves.
| Cookie theft | CSRF | Session fixation | |
|---|---|---|---|
| Attacker has | Your session cookie | Nothing; your browser does the work | A session ID you logged in with |
| Needs | Malware, phishing or XSS | A malicious page you visit while logged in | A site that keeps the pre-login ID |
| MFA helps? | No, login is skipped | Partly, if the action needs re-authentication | No, the ID becomes logged in |
| Main defense | HttpOnly, Secure, short sessions, passkeys | SameSite cookies, anti-CSRF tokens | New session ID at login |
Knowing which one you face decides the fix. If sessions are being replayed, revoke them and shorten their lifetime. If requests are being forged, add anti-CSRF tokens. If fixation is possible, rotate the session ID at login.
The bottom line
Cookie theft works because a session cookie is as powerful as the login that created it, and it lasts long after MFA has done its job. Infostealers made it a mass-market attack, and one-time codes cannot stop it.
Protect yourself with passkeys, careful downloads and regular session reviews, and if anything looks wrong, revoke every session before you change the password. You can start by checking whether your passwords have appeared in known breaches with the pwned password checker.
Frequently asked questions
What is cookie theft in simple terms?
Cookie theft is stealing the small file your browser uses to prove you are already logged in. With a copy of it, an attacker can open your account without knowing your password or your MFA code.
Can cookie theft bypass two-factor authentication?
Yes. MFA is checked at login, and a session cookie is issued after that check. An attacker who reuses a stolen cookie skips the login step entirely, so MFA never gets a chance to stop them.
How do I know if my cookies were stolen?
Look for logins from places you have never been, new devices in your account security page, changed passwords or recovery details, and mail-forwarding rules you did not create. A security alert about a new sign-in is often the first sign.
Does changing my password stop cookie theft?
Not on its own. Changing the password protects future logins, but a stolen session cookie can stay valid until it expires or is revoked. Use the sign-out-everywhere option and revoke sessions as well.
What is the difference between cookie theft and session hijacking?
Cookie theft is one way to hijack a session: stealing the session cookie. Session hijacking is the wider term, which also covers guessing a predictable session ID or fixing a session ID before login.
Are all cookies dangerous if stolen?
No. Advertising and preference cookies are mostly harmless if stolen. The dangerous ones are session and authentication cookies, which prove you are logged in to an account.
Can antivirus stop cookie theft?
Antivirus helps against known infostealer malware, but it is not a guarantee. The strongest defenses are phishing-resistant MFA such as passkeys, short session lifetimes, and revoking sessions quickly when an account looks compromised.
Sources
The engineers and analysts who build Cysoro's domain scanner, email-authentication checks and free security tools. We test what we write about every day — SPF, DKIM, DMARC, certificates, look-alike domains and phishing — and check each guide against the relevant standards, government guidance and vendor documentation.
Checked against the OWASP Session Management Cheat Sheet, the FBI and CISA advisory AA25-141B on LummaC2, and MITRE ATT&CK T1539.
How we write and fact-check →