CVE-2023-51449
Gradio vulnerability analysis and mitigation

Overview

Gradio, an open-source Python package for building machine learning model demos and web applications, contained a path traversal vulnerability (CVE-2023-51449) in versions prior to 4.11.0. The vulnerability was present in the /file route, which made applications susceptible to file traversal attacks where 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) (GitHub Advisory).

Technical details

The vulnerability exists in the file endpoint's path validation mechanism. The check to prevent path traversal was flawed as it didn't properly account for subdirectories inside the temp folder. Attackers could use the upload endpoint to first create a subdirectory within the temp directory, and then traverse out from that subdirectory to read arbitrary files using the '../' or '%2e%2e%2f' sequence. The vulnerability has a CVSS v3.1 base score of 7.5 HIGH (CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N) according to NVD's assessment (Horizon3).

Impact

The vulnerability allows unauthorized users to bypass the intended restrictions and access arbitrary files on the system running the Gradio application. In a Hugging Face space environment, attackers could exploit this vulnerability to access secrets stored in environment variables by reading the /proc/self/environ pseudo-file (Horizon3).

Mitigation and workarounds

The vulnerability has been patched in Gradio version 4.11.0. Users are strongly recommended to upgrade to this version or later. The fix includes improved path validation mechanisms to prevent file traversal attacks (GitHub Commit).

Additional resources


SourceThis report was generated using AI

Related Gradio vulnerabilities:

CVE ID

Severity

Score

Technologies

Component name

CISA KEV exploit

Has fix

Published date

CVE-2025-48889HIGH7.5
  • GradioGradio
  • gradio
NoYesMay 30, 2025
CVE-2024-8966HIGH7.5
  • GradioGradio
  • gradio
NoNoMar 20, 2025
CVE-2025-5320MEDIUM6.3
  • GradioGradio
  • gradio
NoNoMay 29, 2025
CVE-2024-8021MEDIUM6.1
  • GradioGradio
  • gradio
NoNoMar 20, 2025
CVE-2024-12217MEDIUM5.3
  • GradioGradio
  • gradio
NoNoMar 20, 2025

Free Vulnerability Assessment

Benchmark your Cloud Security Posture

Evaluate your cloud security practices across 9 security domains to benchmark your risk level and identify gaps in your defenses.

Request assessment

Get a personalized demo

Ready to see Wiz in action?

"Best User Experience I have ever seen, provides full visibility to cloud workloads."
David EstlickCISO
"Wiz provides a single pane of glass to see what is going on in our cloud environments."
Adam FletcherChief Security Officer
"We know that if Wiz identifies something as critical, it actually is."
Greg PoniatowskiHead of Threat and Vulnerability Management