PyPI: gradio

CVE-2024-2206

Safety vulnerability ID: SFTY-20240327-76535

Safety legacy ID: pyup.io-71660

Affected versions of the gradio package are vulnerable to Server-Side Request Forgery (SSRF) due to insufficient validation of user-supplied URLs in the /proxy route. The vulnerability exists in the build_proxy_request function's inadequate checking of safe URLs, allowing attackers to manipulate the self.replica_urls set through the X-Direct-Url header in requests to the / and /config routes.

Created at: Jul 5, 2026Updated at: Jul 5, 2026

Overview

gradio Server-Side Request Forgery vulnerability

Advisory

Affected versions of the gradio package are vulnerable to Server-Side Request Forgery (SSRF) due to insufficient validation of user-supplied URLs in the /proxy route. The vulnerability exists in the build_proxy_request function's inadequate checking of safe URLs, allowing attackers to manipulate the self.replica_urls set through the X-Direct-Url header in requests to the / and /config routes.

Affected Package

Affecting gradio package, versions<4.18.0

Also affects

---

How to Fix

Upgradegradioto4.18.0or higher.

Mitigation and Workarounds

---

Vulnerable Functions

Functions linked to known vulnerabilities.

Vulnerable function data is available for Enterprise customers

Book a call with us to see Safety in action.

Safety

Verified by Safety

Our Cybersecurity Intelligence Team reviewed this vulnerability. We combine public data with our own research to find issues not yet reported to public sources.

Learn more