CVE-2024-47164
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 · uneditedGradio 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 confidenceThe `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.
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< 5.0.0CVSS 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 checksWork through these to decide whether this CVE applies to you.
-
Check installed Gradio versionRun `pip show gradio` or `python -c "import gradio; print(gradio.__version__)"` to determine the installed version numberAffected if Version is less than 5.0.0 (e.g., 4.x, 4.x.x)
-
Verify file upload component usageSearch your Gradio application code for `File` component or `gradio.File` class instantiation, which uses the vulnerable path validationAffected if Your application uses File components for uploads and the Gradio version is below 5.0.0
-
Inspect blocklist configurationSearch your codebase for blocklist-related settings in Gradio configuration, particularly any path-based blocklists that restrict access to specific directoriesAffected if Blocklist functionality using path restrictions is configured and Gradio version is below 5.0.0
-
Examine custom path validation codeSearch 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 directoriesAffected 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.
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 · scoped5.0.0
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.
gradio>=5.0.0
- Check the current Gradio version installed in your environment using `pip show gradio` or `pip list | grep gradio`
- Upgrade Gradio to version 5.0.0 or later by running `pip install --upgrade gradio>=5.0.0`
- Verify the upgrade was successful by running `pip show gradio` and confirming the version is 5.0.0 or higher
- If using a requirements.txt or lock file, update the Gradio dependency entry to specify `gradio>=5.0.0`
- Test your application to ensure the file handling functionality works correctly after the upgrade
Generated from the published advisory — verify against the referenced sources before acting.
- Consultation2.0 h
- Implementation4.0 h
- Testing3.0 h
- Review / QA2.0 h
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 locallyCheck 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 sourcesPractitioner notes
ContributedPeer-ranked notes from engineers who’ve handled CVE-2024-47164 in production — separate from our analysis above.
The advisory tells you what broke. It rarely tells you what actually worked. If you’ve dealt with this one, that detail is what the next engineer is searching for.
- The version that genuinely resolved it — not the one the vendor claimed
- A config change or rule that shut the vector down
- A gotcha in the upgrade path that cost you an afternoon
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.
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.
- 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