AgentbeamBeta
AI agent vulnerability · Gradio

CVE-2024-4325: Server-Side Request Forgery in gradio

highCVSS 3.0 8.6GHSA-973g-55hp-3frw

Gradio's `/queue/join` endpoint passes a user-supplied URL to `save_url_to_cache` and fetches it without checking the target. An unauthenticated attacker can make the Gradio server request internal hosts or the AWS metadata endpoint. The advisory data lists 4.36.0 and earlier as vulnerable and gives no patched version.

Published Jun 6, 2024 · Analysis Nov 10, 2026

What an attacker can do

The path value in a /queue/join request is expected to be a URL. The save_url_to_cache function requests it over HTTP with no validation of scheme or destination. The attacker only has to reach the Gradio app over the network (PR:N, UI:N). The server then fetches whatever URL they supply.

That gives access to services on the local network and to the cloud instance metadata endpoint. On AWS, the metadata service can return temporary instance credentials. The CVSS 3.0 vector rates confidentiality impact high and scope changed. The CWE is 918.

A public pull request (8301) proposed an is_safe_url() check that resolves the hostname and refuses non-http(s) schemes and private or multicast addresses. The PR page shows it was closed without merging and points to #8978, where similar checks were implemented. Any Gradio app exposed to untrusted users, such as a public demo or a model front end, is in scope.

Who is affected

pip package gradio 4.36.0 and earlier per the advisory data; the original report was made against 4.21.0. Check:

pip show gradio

Any app that serves the queue endpoints to untrusted clients is exposed.

gradio

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

How to fix it

The advisory data has no patched version for this CVE. Upgrade to the latest gradio release, and check the release notes for the SSRF checks tracked in pull request 8978. I could not confirm from the sources which release first includes them.

Mitigations: block the app's access to link-local and private ranges at the network layer, and require IMDSv2 on AWS so a simple GET cannot read credentials. Do not run Gradio with an instance role that has broad permissions.

How to tell if you were hit

Search access logs for /queue/join requests whose path value is a full URL, especially one pointing at 169.254.169.254, localhost, or RFC 1918 ranges. On AWS, review CloudTrail for use of the instance role from unexpected addresses. Check egress logs for connections from the Gradio host to internal services it normally never calls.

Original advisory

From the GitHub Advisory Database (CC BY 4.0).

A Server-Side Request Forgery (SSRF) vulnerability exists in the gradio-app/gradio and was discovered in version 4.21.0, specifically within the /queue/join endpoint and the save_url_to_cache function. The vulnerability arises when the path value, obtained from the user and expected to be a URL, is used to make an HTTP request without sufficient validation checks. This flaw allows an attacker to send crafted requests that could lead to unauthorized access to the local network or the AWS metadata endpoint, thereby compromising the security of internal servers.

Questions

Does it need authentication?

No. The CVSS vector has PR:N and UI:N. Any client that can reach the Gradio queue endpoint can send the request.

Which Gradio version patches CVE-2024-4325?

The advisory data lists none. It marks 4.36.0 and earlier as vulnerable. Upgrade to the newest release and apply network egress limits.

What is the main risk on AWS?

A request to the metadata endpoint can return instance credentials, which the attacker can reuse. IMDSv2 reduces this.

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