Skip to content
MediumVulnerability

CVE-2024-47164: Gradio directory traversal check bypass in is_in_or_equal function

Identifier
CVE-2024-47164
Published
Record updated
View JSON
Affected
  • gradio < 5.0.0
Fixed in
5.0.0
  • released October 9, 2024, 2 days before disclosure
Known exploitation
Not listed in the CISA Known Exploited Vulnerabilities catalog at the last check.
EPSS
0.7%

Summary

Gradio, an open-source Python package for quick prototyping, has a bypass of directory traversal checks in its `is_in_or_equal` function. The function, meant to confirm a file sits inside a given directory, can be defeated with payloads that use `..` parent directory sequences, letting an attacker reach restricted files. The flaw mainly affects users who rely on Gradio's blocklist or directory access validation, especially around file uploads, and exploitation is described as difficult.

Mitigation

Upgrade to `gradio>=5.0`. As a workaround, manually sanitize and normalize file paths before passing them to `is_in_or_equal`, ensuring all paths are properly resolved and absolute.