/

CVE-2026-28416

Severity:

HIGH RISK

(8.2)

Server-Side Request Forgery (SSRF) in Gradio gr.load()

CVE-2026-28416

Analyzed

Vulnerability type

Category:

Server-Side Request Forgery (SSRF)

CWE:

CWE-918

Impact:

Network pivoting and unauthorized access to internal HTTP-accessible resources

Severity:

HIGH RISK

(8.2)

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

A Server-Side Request Forgery (SSRF) flaw in Gradio allows attacker-controlled Spaces to inject arbitrary proxy URLs into the victim server's allowlist when loaded with gr.load().

If a victim application loads a malicious Gradio Space, the attacker can abuse the trusted proxy_url configuration to make HTTP requests from the victim's server to internal services, metadata endpoints, and private networks.

Affected context

This vulnerability appears in applications that:

  • Integrate Gradio and call gr.load() to consume external or third-party Gradio Spaces
  • Trust configuration values (such as proxy_url) supplied by the remote Space
  • Permit outbound HTTP(S) requests from the server to internal or external targets

It is most relevant when the Gradio-consuming service has network visibility into internal services, cloud metadata endpoints, or other sensitive HTTP-accessible resources.

Exploit preconditions

  • Attack surface: Applications or services that call gr.load() on attacker-controlled or untrusted Gradio Spaces.
  • Required access: Ability to publish or control a Gradio Space that the victim will load (e.g., through social engineering, misconfiguration, or integration with arbitrary user content).
  • Trigger point: The victim calls gr.load() on the malicious Space, causing its configuration (including proxy_url) to be fetched and trusted.
  • Why exploitation is possible: The proxy_url parameter from the remote Space configuration is implicitly trusted and added to the server's allowlist without origin or destination validation, allowing the attacker to redirect the victim server's HTTP client to arbitrary internal endpoints.

Why this happens

The underlying issue is the implicit trust of remotely supplied network configuration data. Gradio's gr.load() mechanism imports configuration from a remote Space, including proxy_url, and then uses that value to extend the server's internal HTTP allowlist.

This maps to CWE-918: Server-Side Request Forgery (SSRF) because untrusted, attacker-controlled input directly influences where the server can send HTTP requests. The server becomes a blind proxy into internal networks, cloud control planes, and other sensitive endpoints, without robust validation of the target URLs or their trustworthiness. The abstract pattern is "remote configuration controls outbound request destinations without constraint."

Potential impact

  • Unauthorized access to internal HTTP services (e.g., admin panels, APIs, databases behind gateways).
  • Retrieval of cloud provider metadata, potentially exposing access tokens, credentials, or instance details.
  • Network reconnaissance of internal IP ranges and services reachable from the victim environment.
  • Abuse of the victim's infrastructure as a proxy for further attacks or evasion of IP-based access controls.
  • Potential escalation into data exfiltration or further compromise of internal systems, depending on what is reachable via HTTP.

General mitigation guidance

Effective mitigation focuses on treating remote configuration as untrusted and strictly limiting where the server can make outbound requests:

  • Introduce robust validation and sanitization for any URL or proxy-like parameter derived from remote Spaces before adding it to an allowlist (e.g., allow only well-known domains or explicit patterns).
  • Prefer a default-deny outbound network policy, only permitting HTTP(S) egress to a small set of trusted endpoints required for normal operation.
  • Avoid dynamically extending HTTP allowlists based on user- or tenant-controlled configuration; instead, manage outbound destinations centrally through code or infrastructure policy.
  • Use network segmentation and firewall rules to prevent application servers from directly reaching sensitive internal services or cloud metadata endpoints whenever possible.
  • Apply the principle of least privilege to service roles and credentials exposed to HTTP-accessible systems to limit blast radius if SSRF occurs.

How teams detect issues like this

Detection hinges on recognizing untrusted configuration flows and unusual outbound traffic patterns:

  • Static analysis and code review:
  • Look for code paths where URL-like parameters (e.g., proxy_url, endpoint, callback) are derived from remote or user-controlled configuration and then used in HTTP clients or allowlists.
  • Flag any logic that dynamically broadens outbound network access based on unverified external metadata.
  • Review integration points around gr.load() to ensure external Spaces are not treated as fully trusted.
  • Runtime and network monitoring:
  • Monitor outbound HTTP requests for connections to internal IP ranges (e.g., 10.0.0.0/8, 169.254.169.254) or unexpected service endpoints.
  • Use network-level logging and anomaly detection to spot unusual egress targets or patterns associated with specific Spaces.
  • Policy enforcement:
  • Implement CI/CD checks that forbid use of configuration-driven arbitrary outbound URLs without explicit validation.
  • Consider automated security scanning tools that specialize in SSRF pattern detection in code and configuration.

Sources

SourceLink
github.comgithub.com/gradio-app/gradio/security/advisories/GHSA-jmh7-g254-2cq9

Frequently asked

questions

Yes. An attacker can exploit it remotely by controlling a Gradio Space that the victim server loads via gr.load(). Once the victim loads that Space, the attacker can trigger SSRF through the trusted proxy_url configuration.

The attacker must be able to host or modify a Gradio Space that the victim chooses to load. They do not need direct access to the victim's infrastructure or internal network; exploitation is mediated through the Space configuration and the victim's use of gr.load().

The safest pattern is to stop treating external Spaces as a source of trusted network configuration. Enforce strict validation on any URL or proxy-related configuration, avoid dynamically extending allowlists based on remote data, and constrain outbound requests to a small, predefined set of destinations.

Adopt a security model where all remote configuration is untrusted, enforce default-deny egress networking, and require explicit domain or IP allowlists that are not influenced by user-controlled or tenant-provided data. Complement this with regular security reviews of integration points like gr.load() and automated checks for SSRF patterns in code and infrastructure.

Find out what's already
exploitable in your codebase.