CVE-2024-12217: Gradio Path Traversal Vulnerability

MODERATE
Advisory Identifier: GHSA-prpg-p95c-32fv
CVSS 5.3
CWE-41 CWE-22
Published
Advisory Summary

CVE-2024-12217 is a MODERATE (CVSS 5.3) path traversal vulnerability (CWE-41: Improper Resolution of Path Equivalence) affecting Gradio libraries in the PyPI ecosystem. The issue involves gradio path traversal vulnerability. Remediation is available in the latest vendor maintenance releases.

CVE-2024-12217 at a Glance

CVE Identifier CVE-2024-12217
GHSA Identifier GHSA-prpg-p95c-32fv
Severity MODERATE
CVSS v3.1 Base Score 5.3
CWE Classification CWE-41: Improper Resolution of Path Equivalence
Affected Product Gradio
Package Ecosystem PyPI
Published Date
Last Updated

Security Impact

CVSS: 5.3

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:N).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required None (PR:N)
User Interaction None (UI:N)
Scope Unchanged (S:U)
Confidentiality Low (C:L)
Integrity None (I:N)
Availability None (A:N)

How to Fix CVE-2024-12217

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.

gradio fixed: Latest secure release
pip install gradio>=Latest secure release
Verify Direct and Transitive Dependencies

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-2024-12217, 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 the patched release), 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-41: Improper Resolution of Path Equivalence, where the product is vulnerable to file system contents disclosure through path equivalence. path equivalence involves the use of special characters in file and directory names. the associated manipulations are intended to generate multiple names for the same object. 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

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.

CVE-2024-12217 Affected Gradio Versions

1 component(s)
Product / Package Ecosystem Affected Versions Fixed Version
gradio
PyPI
≤ 5.0.1

References

Frequently Asked Questions

What is CVE-2024-12217?
CVE-2024-12217 is a security vulnerability in Gradio involving Gradio Path Traversal vulnerability under CWE-41: Improper Resolution of Path Equivalence.
Which Gradio versions are affected?
Affected versions include releases prior to current release patches across affected packages: gradio.
What version fixes CVE-2024-12217?
Upgrading to current release patches (or the latest patched release for your respective branch) resolves the vulnerability.
Is gradio affected?
Yes, gradio is affected in releases prior to Latest secure release. Upgrade your dependency to Latest secure release or later.
What is the CVSS score of CVE-2024-12217?
CVE-2024-12217 has a CVSS v3.1 base score of 5.3 (MODERATE) with vector string CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:N.
What CWE is associated with CVE-2024-12217?
CVE-2024-12217 is classified under CWE-41: Improper Resolution of Path Equivalence (The product is vulnerable to file system contents disclosure through path equivalence. Path equivalence involves the use of special characters in file and directory names. The associated manipulations are intended to generate multiple names for the same object.).
How can I check PyPI dependencies for CVE-2024-12217?
Run the dependency tree command: 'pip show gradio'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-prpg-p95c-32fv",
  "modified" : "2025-03-21T17:12:10Z",
  "published" : "2025-03-20T12:32:42Z",
  "aliases" : [ "CVE-2024-12217" ],
  "summary" : "Gradio Path Traversal vulnerability",
  "details" : "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.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "PyPI",
      "name" : "gradio"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "last_affected" : "5.0.1"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2024-12217"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/gradio-app/gradio"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/gradio-app/gradio/blob/67e4044c9ca8358eceeb1fa72fa415df03397d20/gradio/utils.py#L1061-L1074"
  }, {
    "type" : "WEB",
    "url" : "https://huntr.com/bounties/0439bf3d-cb38-43a5-8314-0fadf85cc5a0"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-22", "CWE-41" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2025-03-21T17:12:10Z",
    "nvd_published_at" : "2025-03-20T10:15:27Z"
  }
}