CVE-2024-2206: Gradio Gradio Server-Side Request Forgery Vulnerability Vulnerability
HIGHCVE-2024-2206 is a HIGH (CVSS 7.3) gradio server-side request forgery vulnerability vulnerability (CWE-918: Server-Side Request Forgery (SSRF)) affecting Gradio libraries in the PyPI ecosystem. The issue involves gradio server-side request forgery vulnerability. Remediation is available by upgrading affected packages to version 4.18.0.
CVE-2024-2206 at a Glance
Security Impact
CVSS: 7.3
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:L).
How to Fix CVE-2024-2206
To remediate this vulnerability, upgrade all affected Gradio dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
pip install gradio>=4.18.0
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
pip show gradio
How to Check if You Are Affected
To determine whether your Python environment is affected by CVE-2024-2206, inspect your installed packages using pip:
pip show gradio
Analyze the terminal output to locate any version of Gradio in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 4.18.0), your application is affected.
Note: The pip show gradio command checks currently installed packages in your active Python environment.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under CWE-918: Server-Side Request Forgery (SSRF), where the web server receives a url or similar request from an upstream component and retrieves the contents of this url, but it does not sufficiently ensure that the request is being sent to the expected destination. In Gradio, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.
Source Advisory Statement
CVE-2024-2206 Affected Gradio Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
gradio
|
PyPI |
< 4.18.0
|
4.18.0
|
References
Frequently Asked Questions
What is CVE-2024-2206?
Which Gradio versions are affected?
What version fixes CVE-2024-2206?
Is gradio affected?
What is the CVSS score of CVE-2024-2206?
What CWE is associated with CVE-2024-2206?
How can I check PyPI dependencies for CVE-2024-2206?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-r364-m2j9-mf4h",
"modified" : "2024-04-16T15:51:15Z",
"published" : "2024-03-27T03:31:16Z",
"aliases" : [ "CVE-2024-2206" ],
"summary" : "gradio Server-Side Request Forgery vulnerability",
"details" : "An SSRF vulnerability exists in the gradio-app/gradio due to insufficient validation of user-supplied URLs in the `/proxy` route. Attackers can exploit this vulnerability by manipulating the `self.replica_urls` set through the `X-Direct-Url` header in requests to the `/` and `/config` routes, allowing the addition of arbitrary URLs for proxying. This flaw enables unauthorized proxying of requests and potential access to internal endpoints within the Hugging Face space. The issue arises from the application's inadequate checking of safe URLs in the `build_proxy_request` function.",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:L"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "PyPI",
"name" : "gradio"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "4.18.0"
} ]
} ]
} ],
"references" : [ {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2024-2206"
}, {
"type" : "WEB",
"url" : "https://github.com/gradio-app/gradio/commit/49d9c48537aa706bf72628e3640389470138bdc6"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/gradio-app/gradio"
}, {
"type" : "WEB",
"url" : "https://huntr.com/bounties/2286c1ed-b889-45d6-adda-7014ea06d98e"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-918" ],
"severity" : "HIGH",
"github_reviewed" : true,
"github_reviewed_at" : "2024-03-27T21:58:06Z",
"nvd_published_at" : "2024-03-27T01:15:46Z"
}
}