Session hijacking
Theme: Threats
Reviewed
How it works
After sign-in, a system issues a session cookie or token so the user or agent does not authenticate on every request. An attacker who steals that value skips sign-in entirely. Common routes are malware that reads browser storage, a compromised proxy, a cross-site scripting flaw or a leaked log.
In MCP, a related risk exists when a server uses session identifiers to route messages. If an attacker can guess or obtain a session ID, they may inject messages into another client's session. Defences include binding sessions to the client and using random identifiers. Session IDs must never prove identity, and authorization is checked on every request.
Session lifetimes should match the task. A session that outlives the work gives an attacker more time.
Why it matters for AI agents
Agents keep long sessions with tools so they can work through multi-step tasks. A hijacked agent session gives an attacker the agent's full scope for as long as it lasts. Per-call authorization limits the damage, because each action is checked on its own merits rather than trusted because the session is open. Agent sessions are often long because tasks span many steps. That makes hijacking more valuable. Short sessions, binding to the client and per-call checks together limit the window and the reach. Logs that tie every call to a session also help responders see what a hijacker did.
Example
An attacker steals the session cookie of a browser-based agent. They send requests to the internal wiki as that agent. Per-call policy notices a burst of export requests outside the agent's normal pattern and blocks them pending approval.
Related terms
- Token replayToken replay is an attack where someone captures a valid access token and reuses it to make requests as the original holder.
- Per-call authorizationPer-call authorization checks every individual tool call or API request against policy at the moment it runs, not once at sign-in.
- Step-up authenticationStep-up authentication asks for a stronger or fresh proof of identity before allowing a sensitive action, even within an existing session.
- DPoPDPoP, Demonstrating Proof of Possession, binds an OAuth token to the client's key, so a copied token fails without that key.
Where it shows up in our scores
Criterion: Per-call authorization, weighted 20% of the total. It asks: Is each tool call or operation checked against policy at the moment it runs?
Highest on this criterion: NewCore and Silverfort, at 9 out of 10. Computed from the current scores on the AI agent access governance ranking.
| Product | Score |
|---|---|
| NewCore | 9 |
| Silverfort | 9 |
| Aembit | 8 |
| Idira | 8 |
| Cyera Identity | 8 |
Sources
- MCP specification: Security Best Practices: https://modelcontextprotocol.io/specification/2025-06-18/basic/security_best_practices