/

CVE-2026-54316

Severity:

CRITICAL RISK

(9.1)

Covert WebFetch Data Exfiltration (CWE-200) in Claude Code

CVE-2026-54316

Analyzed

Vulnerability type

Category:

Covert Data Exfiltration via Trusted Endpoint Abuse

CWE:

CWE-183, CWE-200, CWE-515

Impact:

Sensitive Data Exfiltration and Policy Bypass

Severity:

CRITICAL RISK

(9.1)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

Summary

Claude Code's WebFetch tool implicitly trusted any path under huggingface.co, auto-approving downloads from attacker-controlled model repositories without user prompts or respect for tool restrictions.

If an attacker can inject untrusted content into a Claude Code context, they could abuse these auto-approved requests to create a covert out-of-band data exfiltration channel for files, environment variables, or command output accessible to the agent.

Affected context

This vulnerability affects sessions using Claude Code where the WebFetch tool is available and the hostname huggingface.co is treated as a pre-approved, trusted destination.

It becomes relevant when prompts, documents, or code snippets supplied to the agent can be influenced by untrusted or semi-trusted parties, such as collaborative environments, shared repositories, or automated integrations.

In such contexts, the pre-approval of huggingface.co paths means tool invocations targeting attacker-controlled HuggingFace repositories may proceed without explicit user confirmation or enforcement of configured tool restrictions.

Exploit preconditions

  • Attack surface: Claude Code sessions that can issue WebFetch requests and treat huggingface.co as implicitly trusted.
  • Required access: Capability to inject or influence untrusted content in the Claude Code context (e.g., via prompts, pasted code, imported files, or integrated systems).
  • Trigger point: The agent is induced—via injected instructions or content—to perform WebFetch calls to specific HuggingFace repository paths (for example, /resolve/main/config.json).
  • Why exploitation is possible: The hostname huggingface.co is approved as a bare trusted endpoint, causing all paths under that domain, including attacker-owned repositories, to bypass interactive permission prompts and ignore --allowedTools restrictions, enabling repeated, covert data uploads embedded in outbound HTTP requests.

Why this happens

At its core, this issue stems from overly broad trust placed in a hostname rather than in specific, constrained resources and interactions associated with that host.

By whitelisting huggingface.co as a generic trusted endpoint for WebFetch, the system assumes that any path on that domain is safe, even though HuggingFace allows arbitrary users to host model repositories and files.

This maps to CWE-200 (Exposure of Sensitive Information to an Unauthorized Actor) because sensitive data reachable by the agent can be encoded into auto-approved outbound requests, and to CWE-183 (Permissive List of Allowed Inputs) where a domain-level allowlist is too permissive, and CWE-515 (Covert Channel) due to the use of download-counted requests as a side channel for exfiltration.

The abstract insecure pattern is: a trusted integration endpoint is defined at a coarse granularity (hostname), without considering that portions of that endpoint may be controlled by untrusted parties, thereby creating a path for covert data transmission that bypasses intended approval and restriction mechanisms.

Potential impact

  • Sensitive local files accessible to Claude Code may be encoded and exfiltrated to attacker-controlled HuggingFace repositories.
  • Environment variables, secrets, or configuration values present in the agent's context can be covertly leaked via crafted WebFetch requests.
  • Command outputs from tools invoked by Claude Code could be transmitted out-of-band, undermining terminal isolation or audit expectations.
  • Organizational data processed in agent sessions, such as source code or documents, may be exposed without clear user visibility.
  • Policy controls relying on --allowedTools or user approval dialogs can be silently bypassed for the huggingface.co domain.

General mitigation guidance

Effective mitigation focuses on tightening trust boundaries around external tool endpoints and preventing agent workflows from silently treating broad domains as universally safe.

Common defensive patterns include:

  • Restricting auto-approved destinations to narrowly scoped URLs, paths, or APIs instead of entire hostnames, and validating that those resources are not user-controlled.
  • Introducing explicit permission prompts or policy checks for any outbound requests that may carry encoded or high-sensitivity data, especially to multi-tenant platforms.
  • Applying principle-of-least-privilege to tool configurations by default, so that integrations begin in a restricted mode and require explicit elevation for broader access.
  • Separating trusted, organization-owned resources from general public infrastructure, and modeling them with distinct policies and allowlists.
  • Normalizing how agents encode and transmit data, disallowing arbitrary data embedding in request parameters to external services unless explicitly authorized.

How teams detect issues like this

Detection typically involves a mix of configuration review, behavioral monitoring, and automated analysis:

  • Reviewing Claude Code and similar agent tool configurations for domain-wide allowlists or pre-approved hosts that terminate on multi-tenant services (e.g., public model hubs, code forges, or storage providers).
  • Monitoring outbound HTTP traffic from agent execution environments for unusual patterns of requests to huggingface.co or analogous hosts, such as frequent accesses to repository paths or high download counts tied to specific artifacts.
  • Employing static or policy-based analysis on agent tool definitions to flag cases where approval prompts are bypassed or where tool restrictions (like --allowedTools) are not enforced consistently.
  • Incorporating security checks in CI/CD and environment provisioning pipelines to validate that agent integrations adhere to least-privilege principles and do not create covert channels.
  • Using automated review tools that can parse configuration files, prompt templates, and tool metadata for permissive allowlists and potential exfiltration vectors.

Sources

SourceLink
github.comgithub.com/anthropics/claude-code/security/advisories/GHSA-fg94-h982-f3mm

Frequently asked

questions

Exploitation depends on an attacker's ability to inject or influence content within a Claude Code context.

In environments where prompts, code, or documents can be influenced by untrusted collaborators or systems, the vulnerability can be widely exploitable; in tightly controlled, single-user contexts with no untrusted input paths, the practical risk is lower.

An attacker does not need direct system or network access but must be able to supply untrusted content to Claude Code—such as through shared projects, compromised repositories, or integrated workflows that feed data into the agent.

Once they can shape the context, they can cause the agent to issue WebFetch requests to attacker-controlled HuggingFace repository paths.

The safest approach is to avoid granting blanket trust to entire hostnames or domains, especially those operated as multi-tenant platforms.

Instead, define allowlists that target specific, organization-owned resources or APIs, enforce explicit permission prompts for potentially sensitive operations, and ensure that policy controls like tool restrictions are honored uniformly across all destinations.

Organizations can design agent tool ecosystems around principles of least privilege and explicit trust, ensuring that external integrations are tightly scoped and regularly audited.

This includes avoiding permissive domain-level allowlists, adding security reviews for tool configuration changes, monitoring outbound data flows for anomalies, and educating developers that public infrastructure hosts can contain attacker-controlled paths even when they appear as trusted brands.

Find out what's already
exploitable in your codebase.