CVE-2026-54316: Claude Code: Out-of-Band Data Exfiltration via Pre-Approved HuggingFace Domain in WebFetch
Claude Code before 2.1.163 pre-approved the bare hostname huggingface.co for its WebFetch tool, so any path on that domain ran without a permission prompt. An attacker who can put untrusted content in the agent's context can make it fetch URLs on a HuggingFace repo they control and leak files, environment variables or command output. Upgrade to 2.1.163.
Published Jun 17, 2026 · Updated Jul 20, 2026 · Analysis Oct 26, 2026
What an attacker can do
The WebFetch allowlist matched on hostname alone, not hostname plus path (CWE-183). Everything under huggingface.co was auto-approved, including attacker-controlled model repositories, and the approval also skipped --allowedTools restrictions.
The attacker's route is prompt injection. Malicious text in a file, issue, web page or tool result tells Claude to request something like /resolve/main/config.json in the attacker's repo, with data Claude can read encoded in the request. HuggingFace counts each such request as a download server-side, so the attacker reads the encoded data from the download statistics. That is the covert storage channel (CWE-515).
The advisory says reliable exploitation needed the ability to add untrusted content to the context window. No prompt appears, so the user sees nothing. The loss is confidentiality only: anything the agent can read, such as source files, .env values or command output. A team that points Claude Code at third-party repos, issues or web content is the exposed group.
Who is affected
@anthropic-ai/claude-code from 0.2.54 up to but not including 2.1.163. Standard auto-update installs already received the fix. Manual installs, pinned CI images and containers need checking:
claude --version
npm ls -g @anthropic-ai/claude-code@anthropic-ai/claude-code
- Ecosystem
- npm
- Affected
- >= 0.2.54, < 2.1.163
- Fixed in
- 2.1.163
- Check
npm ls @anthropic-ai/claude-code
How to fix it
Upgrade to 2.1.163 or later:
npm install -g @anthropic-ai/claude-code@latestThe advisory lists no official workaround. Reasonable interim steps, which are my suggestions and not from the advisory: remove any bare huggingface.co entry from WebFetch permissions and approve specific URLs instead, require manual approval of WebFetch calls, and avoid sessions that read untrusted content while WebFetch is broadly permitted.
How to tell if you were hit
Review session transcripts and logs for WebFetch calls to huggingface.co, especially paths like /resolve/main/ in repositories you do not own, or URLs with long encoded strings in the path. A fetch that follows the agent reading untrusted content and then a sensitive file is the pattern to look for.
Beam records agent tool calls through its hooks and flags risky patterns for review, so WebFetch events to unexpected hosts can be reviewed there.
Original advisory
From the GitHub Advisory Database (CC BY 4.0).
Because the hostname huggingface.co was pre-approved as a bare hostname for the WebFetch tool, any path on that domain—including attacker-controlled model repositories—was auto-approved without a permission prompt or being subject to --allowedTools restrictions. An attacker able to inject untrusted content into a Claude Code context could direct it to issue WebFetch requests against attacker-controlled repository files (e.g. /resolve/main/config.json), which HuggingFace counts as downloads server-side, creating a covert out-of-band channel for encoding and exfiltrating data Claude can access such as files, environment variables, or command output. Reliably exploiting this required the ability to add untrusted content into a Claude Code context window. Users on standard Claude Code auto-update have received this fix already; users performing manual updates are advised to update to the latest version.
Thank you to hackerone.com/novee for reporting this issue.
Questions
- Is Claude Code 2.1.162 affected by CVE-2026-54316?
Yes. Versions from 0.2.54 up to but not including 2.1.163 are affected. Version 2.1.163 contains the fix.
- Does the attacker need access to my machine?
No. They need a way to get untrusted content into Claude's context, such as a poisoned file, issue or web page. The advisory says this was required for reliable exploitation.
- What data can leak?
Anything Claude can access, such as files, environment variables or command output. It is sent as encoded request paths to an attacker-controlled HuggingFace repository.
- Is it exploited in the wild?
The sources do not say so, and the entry has no CISA KEV data.
References
How this page is made: the data panel comes from the GitHub Advisory Database, CISA’s KEV catalog, the NVD and FIRST EPSS, and updates twice a day. The analysis is written by an AI model from the sources listed above and checked by automated rules before it is published. Check versions against the vendor's advisory before you act. Methodology
More Claude Code vulnerabilities
All Claude Code entriesCVE-2026-88968
Claude Code: TOCTOU Race in Edit Tool Allows File Writes Outside the Workspace
high7.7Nov 9, 2026CVE-2026-86063
Claude Code: Plugin Hash Pin Bypass Allows Bypass of Hash Pinning
high7.5Oct 15, 2026CVE-2026-55607
Claude Code: Sandbox Escape via Git Worktree Path Confusion Allows Unsandboxed Code Execution
high7.7Jul 24, 2026CVE-2026-46406
@anthropic-ai/claude-code has an Insecure Temporary File in /copy Command that Enables Response Disclosure and Symlink-Based File Write
medium4.4Jun 25, 2026CVE-2026-40068
Claude Code: Trust Dialog Bypass via Git Worktree Spoofing Allows Arbitrary Code Execution
high7.7Apr 24, 2026CVE-2026-39861
Claude Code: Sandbox Escape via Symlink Following Allows Arbitrary File Write Outside Workspace
high10.0Apr 21, 2026
