CVE-2024-12217: Gradio: NTFS ADS bypass exposes blocked file paths
GHSA-prpg-p95c-32fv MEDIUM CISA: TRACK*Gradio's `blocked_path` access control on Windows is trivially bypassed using NTFS Alternate Data Streams syntax (e.g., `file.txt::$DATA`), allowing unauthenticated network access to any file the server process can read. No patch is listed—migrate Windows Gradio deployments to Linux immediately or place them behind an authenticated reverse proxy. Rotate any credentials stored in files accessible to the Gradio process.
What is the risk?
CVSS 5.3 understates operational risk. The vulnerability defeats the *only* access control mechanism Gradio provides (blocked_path), requires no authentication, no user interaction, and is exploitable by anyone with network access who knows about NTFS ADS—a well-documented Windows feature. EPSS is low (0.00133) indicating limited active exploitation, but exploitation complexity is trivial. Risk is highest for teams running Gradio on Windows workstations or servers with direct network exposure. No patch available increases residual risk significantly.
What systems are affected?
| Package | Ecosystem | Vulnerable Range | Patched |
|---|---|---|---|
| Gradio | pip | <= 5.0.1 | No patch |
Do you use Gradio? You're affected.
How severe is it?
What is the attack surface?
What should I do?
5 steps-
IMMEDIATE
Deploy Gradio on Linux—NTFS ADS does not exist on Linux/macOS, eliminating this attack surface entirely.
-
SHORT-TERM: Place all Gradio instances behind an authenticated reverse proxy (Nginx + OAuth2 Proxy, or Cloudflare Access); never expose Gradio directly to the network.
-
DEFENSE-IN-DEPTH: Restrict the OS user running Gradio to a minimal permission set; ensure sensitive files (
.env, credentials) are not readable by the Gradio process user. -
DETECTION
Alert on HTTP requests containing
::$DATA,::$INDEX_ALLOCATION, or other ADS stream suffixes in URL paths. -
AUDIT
Inventory all Windows-based Gradio deployments; assume blocked_path bypass was possible and rotate any co-located credentials.
What does CISA's SSVC say?
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:
Frequently Asked Questions
What is CVE-2024-12217?
Gradio's `blocked_path` access control on Windows is trivially bypassed using NTFS Alternate Data Streams syntax (e.g., `file.txt::$DATA`), allowing unauthenticated network access to any file the server process can read. No patch is listed—migrate Windows Gradio deployments to Linux immediately or place them behind an authenticated reverse proxy. Rotate any credentials stored in files accessible to the Gradio process.
Is CVE-2024-12217 actively exploited?
No confirmed active exploitation of CVE-2024-12217 has been reported, but organizations should still patch proactively.
How to fix CVE-2024-12217?
1. IMMEDIATE: Deploy Gradio on Linux—NTFS ADS does not exist on Linux/macOS, eliminating this attack surface entirely. 2. SHORT-TERM: Place all Gradio instances behind an authenticated reverse proxy (Nginx + OAuth2 Proxy, or Cloudflare Access); never expose Gradio directly to the network. 3. DEFENSE-IN-DEPTH: Restrict the OS user running Gradio to a minimal permission set; ensure sensitive files (`.env`, credentials) are not readable by the Gradio process user. 4. DETECTION: Alert on HTTP requests containing `::$DATA`, `::$INDEX_ALLOCATION`, or other ADS stream suffixes in URL paths. 5. AUDIT: Inventory all Windows-based Gradio deployments; assume blocked_path bypass was possible and rotate any co-located credentials.
What systems are affected by CVE-2024-12217?
This vulnerability affects the following AI/ML architecture patterns: ML demo applications, model serving, data science workstations, internal AI tools, agent frameworks.
What is the CVSS score for CVE-2024-12217?
CVE-2024-12217 has a CVSS v3.1 base score of 5.3 (MEDIUM). The EPSS exploitation probability is 0.64%.
What is the AI security impact?
Affected AI Architectures
MITRE ATLAS Techniques
AML.T0025 Exfiltration via Cyber Means AML.T0037 Data from Local System AML.T0049 Exploit Public-Facing Application Compliance Controls Affected
What are the technical details?
Original Advisory
A vulnerability in the gradio-app/gradio repository, version git 67e4044, allows for path traversal on Windows OS. The implementation of the blocked_path functionality, which is intended to disallow users from reading certain files, is flawed. Specifically, while the application correctly blocks access to paths like 'C:/tmp/secret.txt', it fails to block access when using NTFS Alternate Data Streams (ADS) syntax, such as 'C:/tmp/secret.txt::$DATA'. This flaw can lead to unauthorized reading of blocked file paths.
Exploitation Scenario
An attacker scans internal network ranges and identifies a Gradio ML demo running on a Windows data science server (common in enterprise ML teams). The application uses `blocked_path=['C:/app/.env', 'C:/app/config/secrets.json']` to protect credentials. The attacker issues a GET request for `C:/app/.env::$DATA`—Windows NTFS resolves the ADS stream notation transparently to the same file content, but Gradio's string comparison check only blocked the canonical path. The attacker receives the plaintext `.env` file containing the team's OpenAI API key and internal database connection string, enabling lateral movement into ML infrastructure and potential cost-harvesting abuse of the API key.
Weaknesses (CWE)
CWE-22 Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')
Primary
CWE-41 Improper Resolution of Path Equivalence
Primary
CWE-22 Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal') 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.0/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:N References
Timeline
Related Vulnerabilities
CVE-2024-47167 9.8 Gradio: unauthenticated SSRF in /queue/join, internal pivot
Same package: gradio CVE-2024-39236 9.8 Gradio: code injection via component metadata (CVSS 9.8)
Same package: gradio CVE-2023-25823 9.8 Gradio: hardcoded SSH key leaks via share=True demos
Same package: gradio CVE-2024-0964 9.4 Gradio: unauthenticated LFI exposes full server filesystem
Same package: gradio CVE-2023-34239 9.1 Gradio: path traversal + SSRF exposes model files & infra
Same package: gradio