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.
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.
How to Fix
Mitigation and Workarounds
---
Vulnerable Functions
Functions linked to known vulnerabilities.
References
- https://getsafety.com/vulnerabilities/SFTY-20240327-76535/CVE-2024-2206
- https://nvd.nist.gov/vuln/detail/CVE-2024-2206
- https://github.com/gradio-app/gradio/commit/49d9c48537aa706bf72628e3640389470138bdc6
- https://huntr.com/bounties/2286c1ed-b889-45d6-adda-7014ea06d98e
- https://github.com/advisories/GHSA-r364-m2j9-mf4h
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
