CVE-2023-51449: Gradio Gradio Makes The `/file` Secure Vulnerability
HIGHCVE-2023-51449 is a HIGH (CVSS 8.6) gradio makes the `/file` secure vulnerability (CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')) affecting Gradio libraries in the PyPI ecosystem. The issue involves gradio makes the `/file` secure against file traversal and server-side request forgery attacks. Remediation is available by upgrading affected packages to version 4.11.0.
CVE-2023-51449 at a Glance
Security Impact
CVSS: 8.6
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:L/A:L).
How to Fix CVE-2023-51449
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.11.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-2023-51449, 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.11.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-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal'), where the product uses external input to construct a pathname that is intended to identify a file or directory that is located underneath a restricted parent directory, but the product does not properly neutralize special elements within the pathname that can cause the pathname to resolve to a location that is outside of the restricted directory. 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-2023-51449 Affected Gradio Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
gradio
|
PyPI |
< 4.11.0
|
4.11.0
|
References
Frequently Asked Questions
What is CVE-2023-51449?
Which Gradio versions are affected?
What version fixes CVE-2023-51449?
Is gradio affected?
What is the CVSS score of CVE-2023-51449?
What CWE is associated with CVE-2023-51449?
How can I check PyPI dependencies for CVE-2023-51449?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-6qm2-wpxq-7qh2",
"modified" : "2024-02-16T21:52:40Z",
"published" : "2023-12-21T18:24:28Z",
"aliases" : [ "CVE-2023-51449" ],
"summary" : "Gradio makes the `/file` secure against file traversal and server-side request forgery attacks",
"details" : "Older versions of `gradio` contained a vulnerability in the `/file` route which made them susceptible to file traversal attacks in which an attacker could access arbitrary files on a machine running a Gradio app with a public URL (e.g. if the demo was created with `share=True`, or on Hugging Face Spaces) if they knew the path of files to look for. \n\nThis was not possible through regular URLs passed into a browser, but it was possible through the use of programmatic tools such as `curl` with the `--pass-as-is` flag. \n\nFurthermore, the `/file` route in Gradio apps also contained a vulnerability that made it possible to use it for SSRF attacks.\n\nBoth of these vulnerabilities have been fixed in `gradio==4.11.0`",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:L/A:L"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "PyPI",
"name" : "gradio"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "4.11.0"
} ]
} ]
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/gradio-app/gradio/security/advisories/GHSA-6qm2-wpxq-7qh2"
}, {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2023-51449"
}, {
"type" : "WEB",
"url" : "https://github.com/gradio-app/gradio/commit/1b9d4234d6c25ef250d882c7b90e1f4039ed2d76"
}, {
"type" : "WEB",
"url" : "https://github.com/gradio-app/gradio/commit/7ba8c5da45b004edd12c0460be9222f5b5f5f055"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/gradio-app/gradio"
}, {
"type" : "WEB",
"url" : "https://github.com/pypa/advisory-database/tree/main/vulns/gradio/PYSEC-2023-249.yaml"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-22" ],
"severity" : "HIGH",
"github_reviewed" : true,
"github_reviewed_at" : "2023-12-21T18:24:28Z",
"nvd_published_at" : "2023-12-22T21:15:09Z"
}
}