Brief · Builders
Claude Code on a shared machine could pick up another user's work from /tmp
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
-
Update Claude Code, and don't leave agent state where another user can get there first.
- Why: On a shared host, a predictable temp directory is a way for someone else to write the text your agent will treat as its own output.
- How: Upgrade to v2.1.128 or later. Don't run coding agents on machines other users can log into, or give each user their own
TMPDIR. Never store task output or other files that can change an agent's next step in a location another account can pre-create or write (item 4, item 10 and item 16 of the Builder's Checklist). If you currently skip permission prompts, that's the kind of permissive setting the proof of concept relied on, so turn that off on shared hosts (item 5).
Want the next one?
One email, weekly-ish. The week's briefs, how worried to be, and what to do about it. No doom.
Subscribe on Beehiiv ↗Free. Opens Beehiiv in a new tab. Unsubscribe whenever, I won't be offended.