Security

Session hijacking: how stolen cookies bypass two-factor sign-in

Two-factor sign-in keeps most attackers out. But anyone who steals a valid session cookie is already inside: to the service, they look like someone who has just signed in properly.

Airnite Editorial Team2 December 2026 · 3 min
Published
Reading time
3 min
Author
Airnite Editorial Team

In short

  • After sign-in, a service remembers the session through a cookie or token; whoever holds it counts as signed in.
  • Infostealers and fake sign-in pages that relay traffic capture such cookies and bypass the password and second factor.
  • Countermeasures are short sessions, re-authentication for sensitive actions, binding to managed devices and ending all sessions immediately when in doubt.

What it is about

Many companies have introduced two-factor sign-in in recent years. That was the right move. Attackers have adapted and increasingly target the moment after sign-in: the session.

In November 2026, an open database with around two billion credentials came to light. According to WIRED, it contained cookies and session tokens as well as passwords. Our special issue on the data leak describes the find.

How it works

After a successful sign-in, the browser receives a session cookie or token. It presents it with every further click so you do not have to sign in again all the time. For the service, whoever has the cookie is signed in.

MITRE ATT&CK lists the theft of such cookies as a technique of its own. Two routes are particularly common:

  • Infostealers read cookies directly from the browser of an infected device, see the article on infostealers.
  • Fake sign-in pages that relay traffic pass password and code on to the real service and keep the cookie that comes back.

The OWASP cheat sheet on session management describes how applications protect themselves: random, long session identifiers, short lifetimes, a new identifier after sign-in and a proper sign-out that also ends the session on the server.

Where it goes wrong

Sessions without end. Many services keep users signed in for weeks. A stolen cookie then stays valuable for a long time.

SMS codes and app confirmations. They help against simple password attacks, but not against a fake page that relays everything live.

Password changed, session still running. Not every service ends all sessions when the password changes. The attacker stays inside.

Mailbox rules. After a takeover, attackers like to set up forwarding that keeps running after they are thrown out. If you use Microsoft 365, see the article on securing Microsoft 365.

How to proceed

1. Limit sessions. Maximum duration and sign-out after inactivity for email, cloud and admin interfaces. 2. Secure sensitive actions. Require re-authentication for payments, permission changes and new forwarding. 3. Bind devices. Where the service offers it, allow access only from managed devices or bind sessions to the device. 4. Sign in phishing-resistantly. Passkeys or security keys instead of SMS, see passwords, MFA and passkeys. 5. Know the emergency button. Who can end all sessions of an account, and how fast? This belongs in the response plan for leaked credentials.

How Airnite helps

In a penetration test, Airnite checks how your web applications and services handle sessions and advises on session rules, device binding and phishing-resistant sign-in. In our training courses, we show live how a fake sign-in page bypasses the second factor.

Checklist

Sources

Every fact in this article is based on the following publications. Primary sources are marked.

  1. OWASPSession Management Cheat SheetStandardPrimary source
  2. MITRE ATT&CKSteal Web Session Cookie (T1539)StandardPrimary source
  3. WIREDDatabase Leaks Expose 3.5 Billion Usernames, Passwords, and DocumentsTrade press

Matching services

Read on

Current incidents and warnings are covered in the Zero Day magazine. Go to the magazine

Want to put this into practice in your company?

We assess your situation and tell you clearly what to do. For businesses, in confidence.

Send an enquiryTalk to an expert now