> status: mostly fine. patch anyway.practical AI security · est. 2026

Brief · Builders

Claude Code on a shared machine could pick up another user's work from /tmp

By alkizz ·

On Nov 28, Pentera Labs described a bug in Claude Code before v2.1.128: another local user on a shared machine could tamper with the temporary task-output files the agent reads back into its context. That gave them a way to change the agent's answers, and, under the proof-of-concept's permissive execution conditions, to have a command run as the victim. The bug is fixed. If you still run a build older than v2.1.128, especially on a jump box, a CI runner or any host other people can log into, update it.

What Pentera found

Before v2.1.128, Claude Code used a predictable temporary directory under /tmp/claude-. If that directory didn't exist yet, another user could create it first, with permissions that would be inherited, and Claude Code would then write task output inside an attacker-controlled folder. Pentera observed about 100 milliseconds between the write and the read back into context, which was enough to edit the file. They found the issue in v2.1.91, reported it to Anthropic on Apr 3, and were first told it was "Informative" on Apr 4. On Apr 27, Anthropic said the behavior was already tracked internally, with hardening planned. Testing and a bundle comparison, per Pentera, show v2.1.128 as the first version with the fix: it checks that the temporary directory belongs to the current user, rejects symbolic links, and enforces 0700 permissions. No CVE is mentioned.

This is the hidden-instructions problem with a local file instead of a web page. The injection didn't have to arrive over the network. It was sitting in /tmp.

What to do

Sources

← All briefs