Resolved

Claude Code read its own task output from a folder another user could own

Before version 2.1.128, Claude Code kept task output in a predictable temporary folder. A second local user could create that folder first and then edit what the agent read back, shaping its answers and, in Pentera's PoC, running code as the victim.

Logged 28 Nov 2026

A predictable path

Claude Code writes the output of a task to a temporary file, then reads that file back into the model's context as part of its own working material. Before version 2.1.128 the directory holding those files was named predictably. Claude Code checked neither ownership nor prior writes. If the directory did not exist, another user on the same machine could create it first, ahead of the victim's first run on that machine.

Claude Code then created its own task folders and output files inside that directory, and the attacker kept full read and write access to whatever landed there on disk. The researchers measured an approximately hundred-millisecond gap between Claude Code writing a task output and reading it back into context. The injection lands inside that gap.

What a poisoned output buys

Under the proof of concept's permissive execution conditions, the attacker could trigger commands that ran as the victim on the same machine. Short of that, a tampered output could hide evidence, fabricate results or steer the agent's next answers. No weights changed and nothing was retrained. The researchers describe the core problem as a filesystem trust boundary: Claude Code treated output in its temporary files as its own input, even when another local user could change it; the trust boundary was the filesystem.

The fix, and a slow disclosure

Version 2.1.128 closes the gap at the filesystem. Claude Code now checks that the temporary directory belongs to the current user, rejects symbolic links, and enforces 0700 permissions so other local users cannot reach its temporary state.

Pentera found the issue in version 2.1.91 and reported it to Anthropic's vulnerability programme on 3 April 2026, and Anthropic closed the report the next day as Informative. It acknowledged the finding on 27 April, after Pentera clarified on 6 April that the impact ran beyond confidentiality into integrity and denial of service. The fix followed in 2.1.128.

Log take

Log take: The model behaved well in one reproduction and ignored the injected instruction, which shows that a careful model can catch a poisoned file. That defence runs on the same unreliable reasoning that the injection targets. The durable fix is the one that stopped another user from writing to the file at all. A security team had to point out that the trust boundary sat in the filesystem, and only there. (Interpretation; single-vendor research.)

Sources

Research