AI agents · OpenClaw · self-hosting · automation

Quick Answer

Session Theft vs Password Theft vs API Key Leak 2026

Published:

The Short Answer

Password theftSession token theftAPI key leak
What’s stolenLogin credentialPost-login cookie / bearer tokenLong-lived programmatic secret
Common vectorPhishing, reuse, breach dumpsInfostealer malware, XSS, AitM proxyGit commits, logs, CI vars, pasted into chat
Stopped by MFA?✅ UsuallyNo❌ No (MFA doesn’t apply)
Attacker getsAbility to log inEverything the user has, right nowWhatever scope the key carries
Typical lifetimeUntil changedUntil session expiry or revocationUntil revoked — often years
RevocationChange password + sign out allSign out everywhere (after cleaning device)Revoke + rotate key
Detection difficultyLowHighMedium

Last verified: August 31, 2026.

Why This Distinction Suddenly Matters

The industry spent a decade winning the password war. Password managers went mainstream, MFA became default-on at most major providers, and breach-dump credential stuffing stopped being reliably profitable.

Attackers responded rationally: they stopped attacking the front door and started stealing what sits behind it.

August 2026 supplied the textbook case. Anthropic began emailing Claude users to warn that infostealer malware on their own machines had captured active Claude login sessions, which attackers replayed to consume usage limits. Anthropic’s remedy — forced sign-out, removal of saved payment methods, refunds of unauthorized charges — is the correct response profile, and notably contains no mention of passwords. Passwords were never involved. (Full detail in our Claude session hijacking writeup.)

1. Password Theft — The Solved-ish Problem

How it works: phishing pages, credential reuse across breached sites, or bulk dumps tested against your login endpoint.

Why it’s now the weakest of the three: MFA genuinely works here. An attacker with your password and no second factor is stuck at the prompt.

The residual risk is adversary-in-the-middle phishing, which proxies the real login page, harvests the password and the resulting session token in one flow. Note what that actually is: an AitM attack is a password attack that upgrades itself into a session-theft attack, because the session token is the part worth having.

Revocation: change the password — then explicitly sign out all sessions. A password change does not universally invalidate live tokens, and assuming it does is the most common recovery mistake.

2. Session Token Theft — The Dominant Threat

How it works: malware on the endpoint reads the browser cookie store. The Lumma/Redline/Vidar family and their forks sweep cookies, saved credentials, wallets and clipboard contents in a single pass and exfiltrate in seconds. XSS and AitM proxies achieve the same result without needing local code execution.

Why it defeats MFA: MFA is evaluated once, at login. The token issued afterwards is the proof that MFA succeeded. Copy the token, skip the check.

Why detection is hard: replayed sessions look like the legitimate user. Same account, valid token, plausible user agent. Detection requires behavioural signals — impossible-travel geolocation, device-fingerprint mismatch, concurrent-session anomalies, usage-rate spikes. Most consumer products ship none of these.

Why AI accounts are prime targets in 2026: hijacked usage limits are directly resellable on grey-market “shared account” services; conversation histories are dense with pasted API keys, connection strings and unreleased code; and AI chat products deliberately keep users signed in for weeks because re-authentication kills the habit loop.

Revocation: clean the machine first, then sign out everywhere. Reversing that order hands the attacker a fresh token.

3. API Key Leak — Widest Blast Radius, Cleanest Fix

How it works: the key ends up somewhere it shouldn’t. Committed to a repo, printed into a log, stored in a CI variable that a build script echoes, or pasted into a chat window that later gets compromised via route 2.

Why it’s dangerous: no MFA applies, scope is often far broader than necessary, and machine-speed abuse can run up five figures of inference spend before a billing alert fires.

Why it’s the most recoverable: keys are designed to be revoked. It’s a single API call or dashboard click, rotation is routine, and provider usage logs give you a precise exposure window.

The compounding risk worth naming: routes 2 and 3 chain. A stolen session gives an attacker your provider console, and the console mints new API keys. Revoking keys without revoking sessions is theatre.

The Practical Hierarchy

If you have limited effort to spend, spend it in this order:

  1. Endpoint hygiene. Every one of these routes is dramatically worse on a compromised machine, and route 2 requires one.
  2. Session revocation literacy. Know where “sign out of all devices” lives for your top ten accounts before you need it.
  3. Key scoping and rotation. Narrow scopes, short lifetimes, automated rotation. Never a long-lived key with account-wide scope.
  4. MFA. Still necessary, still insufficient. It closes route 1 and nothing else.

The direction of travel for providers is device-bound tokens — cryptographically binding a session to hardware so a copied cookie is useless elsewhere. The standards exist. Adoption across consumer AI products as of August 2026 remains thin, which is precisely why route 2 is having such a good year.

Sources