AgentbeamBeta
AI agent vulnerability · Gradio

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

mediumCVSS 3.0 6.5GHSA-qh6x-j82h-vpf9

Gradio before 4.10.0 has an SSRF-style flaw in its file route. By changing the file parameter of a GET request, an attacker can scan internal ports: the response shows either a Location header or a "File not allowed" error depending on whether the port is open. Upgrade to gradio 4.10.0.

Published Apr 16, 2024 · Analysis Nov 18, 2026

What an attacker can do

The /file= route decides whether to redirect to a URL given in the file parameter. Before the fix it used utils.validate_url on the supplied value, which the server evaluates by making a request. The response differs based on the result: a Location header, or a "File not allowed" error. That difference is an oracle. An attacker with a list of internal addresses and ports can send many requests and learn which ones are open from the server's point of view.

This is reconnaissance, not file or data theft. The advisory does not describe reading internal responses. CVSS 3.0 rates it medium at 6.5 (AV:N/AC:L/PR:N/UI:R). The attacker needs the app to be reachable, and the vector requires user interaction. The result helps map an internal network behind a public Gradio app, including apps shared with launch(share=True).

Who is affected

The pip package gradio is affected before 4.10.0, in any app whose /file= route can be reached by untrusted users.

Check the version:

pip show gradio

Check the environment the app runs in, such as a container or a Hugging Face Space.

gradio

Ecosystem
PyPI
Affected
< 4.10.0
Fixed in
4.10.0
Check
pip show gradio

How to fix it

Upgrade to gradio 4.10.0:

pip install --upgrade gradio==4.10.0

The advisory links two fix commits, including 2ad3d9e7. That one changes the /file= route in gradio/routes.py so the redirect check uses client_utils.is_http_url_like instead of utils.validate_url. The sources describe no workaround.

How to tell if you were hit

Look in access logs for bursts of GET requests to /file= with URL values that point to internal addresses and a range of ports. Look for responses that alternate between redirects and "File not allowed" for the same source. The server also makes outbound connections to internal hosts that the app has no reason to contact.

Original advisory

From the GitHub Advisory Database (CC BY 4.0).

An SSRF (Server-Side Request Forgery) vulnerability exists in the gradio-app/gradio repository, allowing attackers to scan and identify open ports within an internal network. By manipulating the 'file' parameter in a GET request, an attacker can discern the status of internal ports based on the presence of a 'Location' header or a 'File not allowed' error in the response.

Questions

Which Gradio version fixes CVE-2024-1183?

Gradio 4.10.0 fixes it. Every version below 4.10.0 is affected, so upgrade the package.

Can an attacker read internal pages with this?

The advisory only describes port scanning. It says the attacker can tell open from closed ports through a Location header or a "File not allowed" error.

Is it severe?

It is rated medium (CVSS 3.0 6.5). It maps internal ports but the advisory does not describe data theft.

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