AgentbeamBeta
AI agent vulnerability · Gradio

CVE-2024-4940: Open redirect in gradio

mediumCVSS 3.0 5.4GHSA-g6c9-f4xm-9j4x

Gradio, the Python library for machine learning web demos, has an open redirect in versions up to 4.36.1. A crafted URL sent to a Gradio app can send a user to an attacker's site, which helps phishing. The GitHub advisory lists no patched version, and the sources do not name the vulnerable route.

Published Jun 22, 2024 · Updated Jun 24, 2024 · Analysis Nov 17, 2026

What an attacker can do

The advisory says Gradio does not properly validate user-supplied input when it handles URLs (CWE-601). A link that points at a Gradio app, built with a hostile URL value, makes the app redirect the visitor to a site the attacker controls.

The attacker needs no account and no access to the server. The victim must click the link, so user interaction is required. Because the link starts on the trusted Gradio host, it looks safe in chat or email, and the redirect target can be a fake login page or a malware download. The description also says redirects of this kind can feed XSS or SSRF chains, but it gives no concrete chain.

CVSS 3.0 scores it 5.4 (medium) with low confidentiality and integrity impact. It does not give the attacker code execution or server access. The advisory and the huntr report reference could not be read for the exact endpoint or parameter, so this analysis does not name them.

Who is affected

The gradio package on PyPI at version 4.36.1 and earlier. Any app built with Gradio and served to users, including public Spaces-style demos, uses the library. Check your version:

pip show gradio

If the reported version is 4.36.1 or lower, it is in the affected range.

gradio

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

How to fix it

The GitHub advisory lists no patched version for the range up to 4.36.1. The sources give no workaround. Check the Gradio releases for a version newer than 4.36.1 and upgrade with:

pip install --upgrade gradio

Confirm the changelog before relying on it, since the advisory does not link a fix. Reasonable steps beyond the sources: keep Gradio apps behind a reverse proxy that you control, and teach users to check the final address after a redirect.

How to tell if you were hit

Look in web server or proxy logs for requests to your Gradio app whose query string or path carries a full external URL, then a 3xx response sending the client to a foreign host. Also review phishing reports from users who clicked links on your Gradio domain. The sources give no specific log line.

Original advisory

From the GitHub Advisory Database (CC BY 4.0).

An open redirect vulnerability exists in the gradio-app/gradio, affecting the latest version. The vulnerability allows an attacker to redirect users to arbitrary websites, which can be exploited for phishing attacks, Cross-site Scripting (XSS), Server-Side Request Forgery (SSRF), amongst others. This issue is due to improper validation of user-supplied input in the handling of URLs. Attackers can exploit this vulnerability by crafting a malicious URL that, when processed by the application, redirects the user to an attacker-controlled web page.

Questions

Is there a patched version for CVE-2024-4940?

The GitHub advisory lists none. It marks gradio versions up to and including 4.36.1 as vulnerable. Check the Gradio release notes for newer versions.

Does the attacker need to log in?

No. The attacker only needs to get a user to open a crafted link. The CVSS vector requires user interaction and no privileges.

How serious is it?

Medium, CVSS 5.4. It supports phishing by redirecting users to another site. It does not give code execution on the server.

Is it exploited in the wild?

The sources do not say so. It is not a CISA KEV entry.

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