CVE-2026-59806: Gradio SSRF & Open Redirect – Credential Theft via File Endpoint
Gradio versions before 6.20.0 contain a pair of related vulnerabilities in how they handle file fetching. An attacker can craft a malicious link that tricks users into visiting arbitrary websites (open redirect), or more critically, can manipulate the /gradio_api/file= endpoint to make the Gradio server itself fetch files from internal systems—including cloud metadata services that store sensitive credentials like AWS EC2 IAM role tokens. The attack requires user interaction (clicking a link) but can expose highly sensitive infrastructure secrets once triggered.
Source data · NVD / CISA · public domain
- CVSS
- 3.1 · 7.4 HIGH · CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:H/I:N/A:N
- Weaknesses (CWE)
- CWE-601, CWE-918
- Affected products
- 0 configuration(s)
- Published / Modified
- 2026-07-08 / 2026-07-10
NVD description (verbatim)
Gradio before 6.20.0 contains an open redirect and server-side request forgery vulnerability that allows attackers to redirect users to arbitrary URLs or perform client-side SSRF by supplying unvalidated HTTP/HTTPS URLs to the file_fetch() function in the /gradio_api/file= endpoint. Attackers can craft a malicious FileData response targeting internal endpoints such as cloud metadata services to retrieve sensitive credentials including EC2 IAM role credentials.
5 reference(s) · View on NVD →
SEC.co analysis · AI-assisted, reviewed against source
Technical summary
The vulnerability exists in Gradio's file_fetch() function, which processes HTTP/HTTPS URLs supplied via the /gradio_api/file= endpoint without adequate validation. This enables two attack classes: (1) Open Redirect (CWE-601) via unsanitized URL redirection, and (2) Server-Side Request Forgery (CWE-918) where the server performs requests on behalf of an attacker, potentially accessing internal metadata endpoints. In cloud environments, this can be exploited to retrieve instance credentials, IAM tokens, and other sensitive metadata that would otherwise be restricted to the instance itself. The vulnerability is accessible to unauthenticated users.
Business impact
Organizations using Gradio in cloud environments face significant risk of credential compromise. EC2 IAM role credentials extracted via SSRF could grant attackers persistent access to AWS resources, databases, or storage buckets. Even in non-cloud deployments, the open redirect component can be weaponized in phishing campaigns or to distribute malware. The user-interaction requirement (clicking a malicious link) may seem limiting, but in social engineering or internal network contexts, this is readily exploitable. The high CVSS score (7.4) reflects the confidentiality impact of exposed credentials against the user-interaction constraint.
Affected systems
All Gradio installations prior to version 6.20.0 are affected. The vulnerability is present in the file handling logic and affects both public and internally-facing Gradio deployments. Cloud-hosted instances (AWS, GCP, Azure) and on-premises installations where metadata services are accessible are at elevated risk. The vendor_products field indicates this is a primary concern for Gradio's core library rather than a narrow feature subset.
Exploitability
Exploitation requires crafting a URL (or FileData response) pointing to a target—cloud metadata endpoints (169.254.169.254), internal services, or arbitrary external sites. The attacker must then deliver this link to a user who clicks it. While this requires user interaction, it is not a high barrier in scenarios involving social engineering, internal employees, or embedded links in collaborative documents. Once clicked, the server-side forgery component executes automatically without further user involvement, retrieving and potentially exposing sensitive data. The CVSS vector (AV:N/AC:L/PR:N/UI:R/S:C/C:H/I:N/A:N) reflects network accessibility, low complexity, and high confidentiality impact.
Remediation
Upgrade Gradio to version 6.20.0 or later immediately. This version includes input validation and sanitization for URLs supplied to file_fetch(), preventing both open redirect and SSRF attacks. Organizations should verify the upgrade is complete and test Gradio endpoints post-deployment. If immediate patching is not feasible, implement network-level mitigations: restrict Gradio server outbound access to only required destinations, use security groups or firewall rules to block access to cloud metadata endpoints (169.254.169.254), and disable or isolate Gradio instances from internal networks if possible. Monitor access logs for suspicious requests to /gradio_api/file= with unusual URL parameters.
Patch guidance
Update Gradio to version 6.20.0 or later. Verify the patch by checking the installed version (pip show gradio or equivalent) and reviewing release notes from the official Gradio repository to confirm the fix addresses CWE-601 and CWE-918. If you are unable to patch immediately, document the delay and apply compensating controls (network isolation, metadata endpoint blocking). Test the patched version in a staging environment to ensure compatibility with existing workflows before rolling out to production.
Detection guidance
Monitor HTTP access logs for requests to /gradio_api/file= that contain suspicious URL parameters, particularly those referencing: cloud metadata endpoints (169.254.169.254, similar GCP/Azure endpoints), internal IP ranges (10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16), localhost (127.0.0.1), or known-malicious external domains. Implement URL filtering at the Gradio application level or upstream proxy to block metadata service access. Set up alerts for multiple failed or suspicious file-fetch requests from the same source or with similar payload patterns. Review web application firewall (WAF) rules to detect URL-encoded or obfuscated references to internal services. If possible, enable Gradio debug logging to capture file_fetch() parameters and review them for anomalies.
Why prioritize this
This vulnerability merits immediate remediation priority due to the potential for credential theft in cloud environments, the widespread use of Gradio in ML/AI workflows, and the ease of crafting a malicious payload. Although user interaction is required, the combination of high confidentiality impact (CVSS 7.4 HIGH) and the realistic threat of social engineering makes it more urgent than vulnerabilities requiring local access or advanced exploitation. Organizations running Gradio on AWS, GCP, or Azure should treat this as critical. Those in isolated or air-gapped networks face lower risk but should still patch during the next maintenance window.
Risk score, explained
The CVSS 3.1 score of 7.4 (HIGH) reflects: Network Accessibility (AV:N) – the endpoint is reachable remotely; Low Attack Complexity (AC:L) – crafting a malicious URL is trivial; No Privilege Required (PR:N) – anyone can invoke the endpoint; User Interaction Required (UI:R) – a user must click the link; Changed Scope (S:C) – impact extends beyond the vulnerable component (to cloud credentials or internal systems); High Confidentiality Impact (C:H) – sensitive data (IAM credentials) can be exposed; No Integrity or Availability impact (I:N/A:N). The user-interaction requirement prevents a higher score, but the confidentiality impact of credential exposure justifies the HIGH rating.
Frequently asked questions
Can this vulnerability be exploited without user interaction?
The open redirect component requires a user to click a malicious link. However, once clicked, the SSRF payload executes server-side automatically to fetch from internal or cloud metadata endpoints. So while initial delivery requires social engineering, the actual credential theft happens without further user action.
Are Gradio instances running on-premises (non-cloud) at risk?
Yes, but with lower severity. On-premises deployments are vulnerable to the open redirect and SSRF components, but the risk of exposing cloud credentials does not apply. However, an attacker could still use SSRF to probe internal networks, extract files from local services, or access internal databases if the Gradio server has network access to them. Patching is still strongly recommended.
What should I do if I cannot patch Gradio immediately?
Apply compensating controls: (1) Block Gradio's outbound access to 169.254.169.254 and other cloud metadata endpoints using firewall rules or security groups; (2) Restrict /gradio_api/file= requests to trusted sources using a WAF or reverse proxy; (3) Disable file-fetch functionality if not needed; (4) Monitor logs aggressively for suspicious requests; (5) Isolate Gradio from the internal network if feasible. Plan patching for the next maintenance window and test the upgrade in staging first.
How can I detect if this vulnerability has been exploited in my environment?
Search web server access logs for requests to /gradio_api/file= with URL parameters pointing to 169.254.169.254, internal IP ranges, or external domains. Check Gradio application logs for file-fetch errors or unusual network requests. Review IAM role credentials (AWS CloudTrail, GCP Cloud Audit Logs) for unexpected access patterns or token usage. If you suspect compromise, rotate affected credentials immediately and run forensic analysis on the Gradio server's network connections.
This analysis is based on CVE-2026-59806 public disclosure and vendor information available as of the publication date. CVSS scores and severity ratings are provided for reference; threat assessments should account for your specific environment and risk tolerance. Exploitation scenarios, detection methods, and mitigation advice are illustrative and should be validated against your infrastructure. Always consult the official Gradio security advisory and release notes before applying patches. This content is for informational purposes and does not constitute legal or professional security advice. Source: NVD (public-domain), retrieved 2026-08-17. Analysis generated by SEC.co (claude-haiku-4-5).
Related vulnerabilities
- CVE-2025-53828HIGHServer-Side Request Forgery in SharePoint for ownCloud Enables Admin Code Execution
- CVE-2026-10055HIGHEclipse Theia SSRF Vulnerability in /services/request-service
- CVE-2026-10068HIGHSSRF in Shibby Tomato 1.28 miniupnpd (Unmaintained)
- CVE-2026-10107HIGHMoviePilot v2 SSRF in Image Proxy Allows Internal Network Access
- CVE-2026-10129HIGHIBM Langflow OSS SSRF Bypass via Redirect Following – HIGH Risk
- CVE-2026-10280HIGHServer-Side Request Forgery in Horizon921 mcpilot 0.1.0
- CVE-2026-10287HIGHSSRF in SourceCodester SEO Meta Tag Extractor 1.0
- CVE-2026-10546HIGHIBM Langflow OSS SSRF via TOCTOU Race Condition