NewApp Monitoring is liveSign up free
AgentbeamBeta
AI agent vulnerability · Gradio

CVE-2024-48052: gradio Server Side Request Forgery vulnerability

mediumCVSS 4.0 5.7 · 3.1 6.5GHSA-3gf9-wv65-gwh9

Gradio 4.42.0 and earlier has a server-side request forgery flaw in gr.DownloadButton. The save_url_to_cache function puts no limits on the URL, so the server can be made to fetch local or internal resources and hand back the result. The advisory data lists no patched version.

Published Nov 5, 2024 · Updated Nov 7, 2024 · Analysis Nov 1, 2026

What an attacker can do

gr.DownloadButton can take a URL, and Gradio saves that resource to its cache through save_url_to_cache. According to the advisory and the researcher's gist, that function has no restrictions on the URL. An attacker who can supply a URL to the button can point the server at an address that only the server can reach, such as a local file target, loopback service or internal network host.

What comes back is the content of that resource, downloaded through Gradio. The advisory says this can expose local resources and sensitive information. The CVSS vectors show network access, low privileges, no user interaction and high confidentiality impact, with no integrity or availability effect.

For a team that runs a Gradio demo on a machine with cloud metadata, internal admin panels or other services on localhost, the realistic risk is credential and data theft through those services. The gist gives no proof of concept and no call chain. The longer write-up it points to was not read here.

Who is affected

gradio on pip, version 4.42.0 and earlier. Apps that use gr.DownloadButton are the ones in scope. Check the installed version:

pip show gradio

Then search your code for DownloadButton to see whether any app uses it.

gradio

Ecosystem
PyPI
Affected
<= 4.42.0
Fixed in
No patched version yet
Check
pip show gradio

How to fix it

The package data lists no patched version for this advisory, and the sources read do not name one. Check the Gradio release notes and the project's security advisories before relying on a newer version. Until a fix is confirmed, avoid gr.DownloadButton in apps reachable by untrusted users, or restrict network access to the app. Also limit what the Gradio host can reach on internal networks, including cloud metadata endpoints.

How to tell if you were hit

Review the Gradio host's outbound requests for connections to loopback, link-local or internal addresses that the app has no reason to contact. Look in the Gradio cache directory for files that hold content from internal URLs. Check application logs for DownloadButton events that carry unusual URLs, such as file or localhost addresses.

Original advisory

From the GitHub Advisory Database (CC BY 4.0).

In gradio <=4.42.0, the gr.DownloadButton function has a hidden server-side request forgery (SSRF) vulnerability. The reason is that within the save_url_to_cache function, there are no restrictions on the URL, which allows access to local target resources. This can lead to the download of local resources and sensitive information.

Questions

Which Gradio component is vulnerable to CVE-2024-48052?

gr.DownloadButton. The save_url_to_cache function it uses applies no restrictions to the URL.

Is there a fixed version?

None is listed in the advisory data, and the sources read name none. Check Gradio's release notes and advisories for a current status.

What can an attacker get from it?

Content of local or internal resources that the Gradio server can reach. The advisory describes this as download of local resources and sensitive information.

References

How this page is made: the data panel comes from the GitHub Advisory Database, CISA’s KEV catalog, the NVD and FIRST EPSS, and updates twice a day. The analysis is written by an AI model from the sources listed above and checked by automated rules before it is published. Check versions against the vendor's advisory before you act. Methodology

More Gradio vulnerabilities

All Gradio entries