Gradio makes the `/file` secure against file traversal and server-side request forgery attacksGHSA-6qm2-wpxq-7qh2
HIGHFix: gradio-app/gradio@1b9d423GHSA-6qm2-wpxq-7qh2 is a high-severity (CVSS 8.6) Path Traversal vulnerability in gradio. EPSS puts its 30-day exploitation probability at 28.3% (98th percentile). A fix is available for gradio — see the affected versions and patch details below.
Exploitation Status
No confirmed exploitation observed yet
- CISA’s own triage has not observed active exploitation or public proof-of-concept code for this CVE as of its last assessment.
Exploitation and automatability from CISA’s SSVC triage for GHSA-6qm2-wpxq-7qh2.
EPSS Exploitation Probability
Probability of exploitation in the next 30 days, from FIRST.org EPSS.
How urgent is this, really
Where this sits among everything scored
Real-World Exposure
gradioReal-time download stats are indexed for npm and PyPI packages. This vulnerability affects PyPI packages — download data is not available via public APIs for these ecosystems.
Description
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.
This 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.
Furthermore, the /file route in Gradio apps also contained a vulnerability that made it possible to use it for SSRF attacks.
Both of these vulnerabilities have been fixed in gradio==4.11.0
Affected Packages
| Ecosystem | Package | Vulnerable range | Fix |
|---|---|---|---|
| 🐍PyPI | gradio | all versions | 4.11.0pip install --upgrade 'gradio==4.11.0' |
Affected Products
gradiogradio_projectDetection & mitigation playbook
Open-source dependencyDetect
Scan your dependency tree (package-lock.json, pnpm-lock.yaml, requirements.txt, go.sum, etc.) for gradio, including transitive dependencies — a direct dependency you never call can still pull in a vulnerable version.
Fix
Update gradio to 4.11.0 or later, then make sure no transitive (indirect) dependency still pins the vulnerable range — O3 confirms GHSA-6qm2-wpxq-7qh2 is resolved across your whole dependency graph.
Workarounds
Resolve every user-supplied path to its canonical form and reject anything that escapes the intended directory, and run the component under an account that has no read or write access outside the directory it legitimately serves.
How to detect GHSA-6qm2-wpxq-7qh2
A community-maintained Nuclei template exists for this CVE. You can scan for it directly:
nuclei -id ghsa-6qm2-wpxq-7qh2 -u https://target- Template
- Gradio Hugging Face - Local File Inclusion
- Severity
- high
- Impact
- Unauthenticated attackers can read arbitrary files from the server when authentication is not enabled, potentially exposing sensitive configuration files and credentials.
- Remediation
- Upgrade Gradio to version 3.33 or later (for Gradio < 3.x) or to version 4.11 or later (for Gradio 4.x).
Template by ProjectDiscovery nuclei-templates (nvn1729), MIT licensed. View the full template. Scan only systems you are authorised to test.
Frequently Asked Questions
Is GHSA-6qm2-wpxq-7qh2 in your dependencies?
Find it across PyPI, including transitive dependencies.