Claude Code Cross-Session Escalation Risks
Cross-session messaging changes a basic assumption I make during agent reviews. A Claude Code session can now list and message other sessions on the same machine. The session that reads an untrusted email may not have file access, but it can ask another session that does. We built a two-session test to see whether that handoff could carry an injected request all the way to data exfiltration.
Demonstration
The recording follows the request across three views. Session A reads the attacker-planted messages and uses ListAgents to find session B. It then asks B for the internal document that its own mail-only permission set cannot reach.
Watch the bottom-right pane when session B receives the request. It reads the file through the files MCP, then returns the confidential details to session A. The top-right pane shows A treating those details as the answer to the email request. The mail log on the left records the outbound reply to the attacker.
The OpenAI and Hugging Face incident provides a useful comparison at the coordination layer. In OpenAI's Black Hat briefing, models used a shared message board to exchange findings, reuse successful techniques, and delegate work across separate runs. That coordination made the group more capable, but the incident still depended on a different chain of infrastructure vulnerabilities. Cross-session messaging provides a supported coordination channel on the user's machine. Our test asks a narrower question: what happens when a request moves from a session exposed to untrusted input into a peer with different tool access?
The channel
For the test, we started two Claude Code sessions on one machine. Both ran claude-opus-5, but each had access to only one MCP server:
- Session A. An email assistant with a mail MCP server. It reads and sends mail and cannot reach the document store.
- Session B. A document service with a files MCP server. It catalogs documents and never sees the inbox.
Cross-session messaging is the only thing joining the two, and it exists for a good reason. When session A needs a file it cannot read, it asks session B, and session B looks the file up and replies. Each session keeps its narrow permissions and the work still gets done.
Exploiting the channel
The channel carries a request without preserving the original request's provenance or authorization context. Session B can see that session A sent the message, but it cannot tell whether A is acting on a user instruction or on content from an email. Session A decides what to ask for based on what it has read, and everything A reads arrives from outside.
That gap is the whole opening. In our demonstration the inbox holds a manufactured story: a partner asking for a file, a forged legal clearance, an IT note telling the assistant to ask a peer session for documents, and a task note carrying the user's apparent go-ahead. Each message looks ordinary alone and together they read as an authorized routine request, so session A asks session B for an internal pilot planning doc holding a customer's confidential data and mails the answer back out.
Every email is planted. Nothing else in either session is touched.
Why it works
Cross-session messaging creates a new trust boundary. A session with limited tools can relay a request to a discoverable peer with different access. The receiving session must decide whether to act, but the message does not show whether the original requester was authorized to use those tools. This is not something model guardrails alone can solve. It is an authorization and provenance problem at the cross-session tool boundary.
The mechanics are built for convenience, and each one doubles as attack surface:
- Discovery is automatic.
ListAgentsshows every peer session on the machine by name. The poisoned session didn't need to be told B existed. - Sending is one tool call.
SendMessagetakes the peer's name and the message. Between two ordinary sessions with default settings, delivery is automatic with no user approval needed. - Tool boundaries stay per-session. Session A never touches the files MCP, and session B never sees the mail MCP. The messaging channel connects those boundaries, so prompt injection in one session can become a request channel into discoverable peers.