CVE-2023-51449: Gradio: path traversal grants arbitrary file read

HIGH PoC AVAILABLE NUCLEI TEMPLATE
Published December 22, 2023
CISO Take

Any Gradio app below version 4.11.0 with a public URL — Hugging Face Spaces or share=True demos — exposes the entire host filesystem to unauthenticated remote attackers. Upgrade to 4.11.0 immediately and rotate all secrets on affected hosts. Assume model weights, API keys, and credentials may already be exfiltrated.

What is the risk?

High risk in practice. CVSS 7.5 understates operational exposure: zero authentication, trivial exploit, and the ML demo use case means thousands of instances run publicly by design. Hugging Face Spaces deployments are especially exposed. Sensitive assets at risk include .env files with LLM API keys, cloud credentials, proprietary model weights, and training data. No active KEV listing but the exploit pattern is well-known and automatable.

What systems are affected?

Package Ecosystem Vulnerable Range Patched
Gradio pip No patch
43.0K OpenSSF 5.6 685 dependents Pushed 4d ago 26% patched ~110d to patch Full package profile →

Do you use Gradio? You're affected.

How severe is it?

CVSS 3.1
7.5 / 10
EPSS
2.3%
chance of exploitation in 30 days
Higher than 81% of all CVEs
Exploitation Status
Exploit Available
Exploitation: MEDIUM
Sophistication
Trivial
Exploitation Confidence
medium
Public PoC indexed (trickest/cve)
Nuclei detection template available
Composite signal derived from CISA KEV, VulnCheck KEV, CISA SSVC, EPSS, Metasploit, Exploit-DB, trickest/cve, Nuclei templates, and inthewild.io exploitation reports.

What is the attack surface?

AV AC PR UI S C I A
AV Network
AC Low
PR None
UI None
S Unchanged
C High
I None
A None

What should I do?

5 steps
  1. Immediate: Upgrade gradio to >= 4.11.0 across all environments.

  2. Audit: Inventory all Gradio instances — flag any running with share=True or deployed to Hugging Face Spaces on vulnerable versions.

  3. Rotate: All secrets (API keys, cloud credentials, tokens) on hosts running vulnerable versions.

  4. Detection: Grep web server / application logs for /file route requests containing traversal sequences: ../, %2e%2e, %252e%252e, encoded variants.

  5. Harden: Place Gradio apps behind an authenticated reverse proxy in production; never expose share=True publicly for sensitive workloads.

What does CISA's SSVC say?

Decision Track
Exploitation none
Automatable No
Technical Impact partial

Source: CISA Vulnrichment (SSVC v2.0). Decision based on the CISA Coordinator decision tree.

How is it classified?

Which compliance frameworks are affected?

This CVE is relevant to:

EU AI Act
Article 15 - Accuracy, robustness and cybersecurity
ISO 42001
A.6.2.6 - AI system security and resilience
NIST AI RMF
MANAGE 2.2 - Mechanisms are in place to sustain AI risk management
OWASP LLM Top 10
LLM05:2025 - Insecure Output Handling / Supply Chain Vulnerabilities

Frequently Asked Questions

What is CVE-2023-51449?

Any Gradio app below version 4.11.0 with a public URL — Hugging Face Spaces or share=True demos — exposes the entire host filesystem to unauthenticated remote attackers. Upgrade to 4.11.0 immediately and rotate all secrets on affected hosts. Assume model weights, API keys, and credentials may already be exfiltrated.

Is CVE-2023-51449 actively exploited?

Proof-of-concept exploit code is publicly available for CVE-2023-51449, increasing the risk of exploitation.

How to fix CVE-2023-51449?

1. Immediate: Upgrade gradio to >= 4.11.0 across all environments. 2. Audit: Inventory all Gradio instances — flag any running with share=True or deployed to Hugging Face Spaces on vulnerable versions. 3. Rotate: All secrets (API keys, cloud credentials, tokens) on hosts running vulnerable versions. 4. Detection: Grep web server / application logs for /file route requests containing traversal sequences: ../, %2e%2e, %252e%252e, encoded variants. 5. Harden: Place Gradio apps behind an authenticated reverse proxy in production; never expose share=True publicly for sensitive workloads.

What systems are affected by CVE-2023-51449?

This vulnerability affects the following AI/ML architecture patterns: ML demo platforms, model serving, inference endpoints, training pipelines.

What is the CVSS score for CVE-2023-51449?

CVE-2023-51449 has a CVSS v3.1 base score of 7.5 (HIGH). The EPSS exploitation probability is 2.28%.

What is the AI security impact?

Affected AI Architectures

ML demo platformsmodel servinginference endpointstraining pipelines

MITRE ATLAS Techniques

AML.T0010.001 AI Software
AML.T0025 Exfiltration via Cyber Means
AML.T0035 AI Artifact Collection
AML.T0037 Data from Local System
AML.T0049 Exploit Public-Facing Application

Compliance Controls Affected

EU AI Act: Article 15
ISO 42001: A.6.2.6
NIST AI RMF: MANAGE 2.2
OWASP LLM Top 10: LLM05:2025

What are the technical details?

Original Advisory

Gradio is an open-source Python package that allows you to quickly build a demo or web application for your machine learning model, API, or any arbitary Python function. Versions of `gradio` prior to 4.11.0 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 issue has been patched in version 4.11.0.

Exploitation Scenario

Attacker mass-scans Hugging Face Spaces and public Gradio instances for version disclosure via response headers or HTML metadata. Against a vulnerable target, they craft GET requests to /file=../../.env or /file=../../root/.aws/credentials — no authentication required, low complexity. Automated scripts enumerate common sensitive paths in seconds. Exfiltrated API keys fund further attacks (LLM abuse, cloud resource theft). Attack is silent, leaves minimal forensic trace beyond HTTP access logs that operators rarely monitor.

Weaknesses (CWE)

CWE-22 — Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal'): 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.

  • [Implementation] Assume all input is malicious. Use an "accept known good" input validation strategy, i.e., use a list of acceptable inputs that strictly conform to specifications. Reject any input that does not strictly conform to specifications, or transform it into something that does. When performing input validation, consider all potentially relevant properties, including length, type of input, the full range of acceptable values, missing or extra inputs, syntax, consistency across related fields, and conformance to business rules. As an example of business rule logic, "boat" may be syntactically valid because it only contains alphanumeric characters, but it is not valid if the input is only expected to contain colors such as "red" or "blue." Do not rely exclusively on looking for malicious or malformed inputs. This is likely to miss at least one undesirable input, especially if the code's environment changes. This can give attackers enough room to bypass the intended validation. However, denylis
  • [Architecture and Design] For any security checks that are performed on the client side, ensure that these checks are duplicated on the server side, in order to avoid CWE-602. Attackers can bypass the client-side checks by modifying values after the checks have been performed, or by changing the client to remove the client-side checks entirely. Then, these modified values would be submitted to the server.

Source: MITRE CWE corpus.

CVSS Vector

CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N

Timeline

Published
December 22, 2023
Last Modified
November 21, 2024
First Seen
December 22, 2023

Scanner Template Available

A Nuclei vulnerability scanner template exists for this CVE. You can scan your infrastructure for this vulnerability immediately.

View template on GitHub
nuclei -t http/cves/2023/CVE-2023-51449.yaml -u https://target.example.com

Related Vulnerabilities