GradioApplication · Gradio Project

CVE-2024-47164

MEDIUM · 6.5 CVSS v3.1 Published 2024-10-10
Fix available
A fix is available. Upgrade to 5.0.0 or later.
See remediation →
74/100
Remediation priority · Elevated
Remotely reachable No privileges Zero-click

Official description Straight from the sourceThe vendor's or NVD's own wording, published unedited. Authoritative, but often terse — it says what broke, rarely what to do.

NVD · unedited
Gradio is an open-source Python package designed for quick prototyping. This vulnerability relates to the **bypass of directory traversal checks** within the `is_in_or_equal` function. This function, intended to check if a file resides within a given directory, can be bypassed with certain payloads that manipulate file paths using `..` (parent directory) sequences. Attackers could potentially access restricted files if they are able to exploit this flaw, although the difficulty is high. This primarily impacts users relying on Gradio’s blocklist or directory access validation, particularly when handling file uploads. Users are advised to upgrade to `gradio>=5.0` to address this issue. As a workaround, users can manually sanitize and normalize file paths in their Gradio deployment before passing them to the `is_in_or_equal` function. Ensuring that all file paths are properly resolved and absolute can help mitigate the bypass vulnerabilities caused by the improper handling of `..` sequences or malformed paths.

Technical summary Written by usOur analysis, written from the advisory, the CVSS vector and the affected-version data. It adds context the advisory leaves out, and never invents facts that are not in the source.

dbcve analysis · high confidence

The `is_in_or_equal` function in Gradio fails to properly validate file paths when `..` sequences are used, allowing attackers to bypass directory restrictions and access files outside the intended directory. This is a classic directory traversal vulnerability in the path validation logic that impacts file upload and blocklist functionality.

MitigationUpgrade to Gradio version 5.0 or later, or implement manual path sanitization using `os.path.abspath()` and validation to resolve and verify all paths before use.

Verify against the referenced sources before acting — the references below are authoritative for this CVE, this summary is not.

Affected products & versions What the vendor confirmedThe version ranges the vendor confirmed as vulnerable. If your version sits inside a range here, treat yourself as exposed until you have upgraded.

NVD · CPE data
GradioApplication
Affected:< 5.0.0

CVSS breakdown How the score is builtThe industry scoring standard. It rates how the flaw is reached, what it takes to exploit, and what an attacker gains — the score is derived from those, not the other way round.

From the vector
Attack vector
Network
Complexity
Low
Privileges
None
User interaction
None
Scope
Unchanged
Confidentiality
Low
Integrity
Low
Availability
None

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

Am I affected? How to checkSteps we derive from the advisory and the affected-version data, so you can decide whether this CVE reaches your setup. They are a guide, not a scan — your own configuration is the authority.

dbcve checks

Work through these to decide whether this CVE applies to you.

  1. Check installed Gradio version
    Run `pip show gradio` or `python -c "import gradio; print(gradio.__version__)"` to determine the installed version number
    Affected if Version is less than 5.0.0 (e.g., 4.x, 4.x.x)
  2. Verify file upload component usage
    Search your Gradio application code for `File` component or `gradio.File` class instantiation, which uses the vulnerable path validation
    Affected if Your application uses File components for uploads and the Gradio version is below 5.0.0
  3. Inspect blocklist configuration
    Search your codebase for blocklist-related settings in Gradio configuration, particularly any path-based blocklists that restrict access to specific directories
    Affected if Blocklist functionality using path restrictions is configured and Gradio version is below 5.0.0
  4. Examine custom path validation code
    Search your application code for usage of the `is_in_or_equal` function or any custom path validation logic that checks whether paths remain within allowed directories
    Affected if Custom code implements directory restriction checks using similar logic to the vulnerable function, and Gradio version is below 5.0.0

Your environment is affected if Gradio version is below 5.0.0 AND your application uses file upload components, blocklist path restrictions, or custom directory validation logic that relies on Gradio's path checking functions.

Generated from the published advisory. Verify against your own configuration.

Check your environment

Paste your version and any relevant configuration and it will be compared against the affected criteria above. Do not include secrets or credentials.

AI-assisted, checked against the advisory. Informational, not a guarantee.

Remediation Closing itWhat it takes to close this. Where a vendor fix exists we point at it; where none exists we say so plainly, and can build one. Effort estimates are scoped from the advisory, not from your codebase.

dbcve · scoped
Upgrade available Upgrade to 5.0.0 or later
Fixed in 5.0.0
Interim mitigation

Upgrade to Gradio version 5.0 or later, or implement manual path sanitization using `os.path.abspath()` and validation to resolve and verify all paths before use.

Recommended fix High confidence

gradio>=5.0.0

  1. Check the current Gradio version installed in your environment using `pip show gradio` or `pip list | grep gradio`
  2. Upgrade Gradio to version 5.0.0 or later by running `pip install --upgrade gradio>=5.0.0`
  3. Verify the upgrade was successful by running `pip show gradio` and confirming the version is 5.0.0 or higher
  4. If using a requirements.txt or lock file, update the Gradio dependency entry to specify `gradio>=5.0.0`
  5. Test your application to ensure the file handling functionality works correctly after the upgrade
Caveat Major version upgrades (4.x to 5.x) typically include breaking changes; review Gradio 5.0 release notes for API changes and migration steps before upgrading in production environments

Generated from the published advisory — verify against the referenced sources before acting.

Fix this in Gradio Scoped from the published advisory
  • Consultation2.0 h
  • Implementation4.0 h
  • Testing3.0 h
  • Review / QA2.0 h
11.0 hours of engineering $1,930
Get the upgrade done

An estimate, not a bill — we confirm scope with you before any work starts. Need it this week? Rush from $3,088.

Scan for this in your stack

Free · runs locally
dbcve dependency scanner

Check whether your project pulls in CVE-2024-47164 — or any other known-vulnerable package — straight from your lock files. Free and open source; it runs locally and uploads nothing.

References Go to the primary sourcePrimary sources — vendor advisories, patches and trackers. Where our summary and a reference disagree, the reference wins.

Primary sources

Practitioner notes

Contributed

Peer-ranked notes from engineers who’ve handled CVE-2024-47164 in production — separate from our analysis above.

No notes yet

Be the first to add a field note for this CVE — a mitigation you’ve verified, a version caveat, or a link to a working fix. Sign in above to contribute.

What this is

A place for practitioners to share what actually worked: a mitigation you’ve tested, a configuration change, a version- or environment-specific caveat, or a link to a verified patch. The most useful notes rise to the top as peers upvote them, so the signal stays high.

What belongs here
  • Verified mitigations, workarounds, and config changes
  • Version or environment caveats, and links to real fixes
  • No weaponised exploit code, or anything meant to cause harm
  • No spam, self-promotion, credentials, or personal data