Skip to content

Claude Code

A file over 256KB let Claude Code Desktop leak your keys

4 min read

Written by an AI model from the linked sources and checked against them by a second model. How we work

All about: Claude Code versions and changes →
Image: noma.security

It took Anthropic two rounds to fix a hole in the Claude Code Desktop preview pane. Through it, an HTML file in a cloned repo could read credentials off the developer’s disk and send them out, with no permission prompt along the way. In a write-up from Noma Labs, the researchers call the bug SneakPeek and lay out the disclosure. Anthropic’s first patch was bypassed the same day it went up for retest, and the full fix shipped on August 17.

Anthropic scored the bug CVSS 8.7 (High) on CVSS v4.0. It treated the impact as equivalent to code execution on the host.

Where the sandbox had gaps

Whenever Claude reads or edits an HTML file, the preview pane renders it automatically. The renderer is Electron’s Chromium engine, so the pane is in effect a full browser with the standard web APIs. Anthropic put three defenses around it: a Content Security Policy (CSP) that blocks scripts, an opaque origin for rendered content so a page can’t read local files, and a request filter meant to stop file:// reads.

All three held for only one path. Files under 256KB load as data: URLs, and there the CSP works as designed. Files over that size are written to a temp file and opened via file://, and the CSP was applied only to the data: path. In Chromium, a file:// page can read other local files. The request filter was active when the preview proxied a running dev server, such as a local React or Node app, but stayed off for static HTML opened straight from disk.

Noma’s demo repo held the kind of file that triggers that second path: a coverage report. Real coverage reports bundle source maps and CSS, so a 500KB one, Noma notes, doesn’t raise flags. The victim clones the repo and asks Claude to look at the coverage report. Claude reads the file, the pane renders it, and the embedded script runs. In the proof of concept it collected SSH private keys, AWS keys, npm and GitHub tokens, Kubernetes credentials, Docker registry auth, Git identity, Claude’s own OAuth tokens and, via WebRTC, the victim’s real IP address. It sent them out with navigator.sendBeacon(), which fires a one-way POST in the background, since nothing restricted outbound requests.

The victim approves nothing at any point, because there is nothing to approve. As DEV Community put it, the agent itself never took an action; the renderer did. Noma makes the same point: Claude renders the untrusted content on the victim’s behalf, and the rendering step is where the malicious code runs.

How the disclosure went

  • July 4: Noma reports the bug to Anthropic with a full proof of concept that exfiltrates credentials.
  • July 9: Anthropic triages it at CVSS 8.7 (High).
  • July 24: Anthropic ships a patch that blocks fetch() and XMLHttpRequest calls to file:// paths from the main page context, and asks for a retest. The same day, Noma sends a bypass with a video walkthrough.
  • August 3: Anthropic confirms the fix is incomplete, moves the report back to Triaged, and commits to a complete fix covering the CSP, file:// loading and the bypass.
  • August 17: the fix ships in Claude Desktop 1.30096.1 and later, delivered via auto-update.
  • October: the GitHub Advisory and CVE are still pending.

The bypass needed only a change of context. Noma issued the same reads from a Web Worker created from a blob: URL, a separate execution context the filter didn’t cover. The worker passed the file contents back to the page, which sent them out as before. Noma says all three original defects were still exploitable that way, so the July 24 patch survived only until its first retest. After a final retest, the researchers report, Anthropic fixed all the issues and marked the vulnerability resolved.

The same pattern in Claude Code

SneakPeek reads like another case of untrusted repo content running outside the protections the user is counting on. Last month, researchers showed a repo escaping the Claude Code sandbox through a git call the harness ran outside Seatbelt, with the permission mode at its strictest. In both cases, one ordinary request in an opened repo was enough.

Disclosure has been rockier elsewhere. Cybernews recalls a separate case in which a researcher accused Anthropic of quietly fixing two vulnerabilities in the tool’s network sandbox without properly informing users. Noma, by contrast, thanks the Anthropic team for a “transparent, responsive partnership” and for “relentless persistence” through the process.

Users don’t have to do anything to get the fix: Claude Desktop 1.30096.1 and later carries it through auto-update. The GitHub Advisory and the CVE number, which security teams use to track the bug, had still not been published as of October.

No comments yet. Be the first.

Join the conversation

Sign in to leave a comment. It appears after moderation.