{"id":"CVE-2024-47164","published":"2024-10-10T21:52:27Z","modified":"2024-10-11T15:24:48Z","title":"The `is_in_or_equal` function may be bypassed in Gradio","vendor":"gradio-app","product":"gradio","tier":"tail","description":{"text":"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.","provenance":"source","from":"CVE.org"},"cvss":{"score":2.3,"severity":"LOW","version":"4.0","vector":"CVSS:4.0/AV:N/AC:H/AT:P/PR:L/UI:N/VC:L/VI:N/VA:N/SC:N/SI:N/SA:N","provenance":"source","from":"CVE.org CNA"},"epss":{"score":0.01005,"percentile":0.6191,"provenance":"source"},"cwes":[{"id":"CWE-22","name":"Improper Limitation of a Pathname to a Restricted Directory"}],"references":[{"url":"https://github.com/gradio-app/gradio/security/advisories/GHSA-77xq-6g77-h274","tags":["x_refsource_CONFIRM"]}],"priority":{"score":14.0,"factors":[{"name":"EPSS percentile","points":12.38},{"name":"CVSS severity","points":1.61}]},"vendorSlug":"gradio-app","affectedVersions":[{"vendor":"gradio-app","product":"gradio","versions":["< 5.0"]}],"ssvc":{"exploitation":"none","automatable":"no","technicalImpact":"partial","timestamp":"2024-10-11T15:24:39.412913Z","from":"CISA ADP","provenance":"source"},"affected":[{"ecosystem":"PyPI","package":"gradio","vulnerableRanges":["<5.0.0"],"patched":["5.0.0"],"from":["GHSA-77xq-6g77-h274","PYSEC-2024-213"],"provenance":"source"}],"summary":{"text":"The flaw is a path traversal bypass in the is_in_or_equal function of the gradio Python package (gradio-app), which is meant to confirm that a file lies within a given directory but can be defeated by manipulating paths with .. sequences. An attacker who can reach the Gradio application with low-privilege access, and who crafts a suitably malformed path, could read restricted files, though exploiting it is considered difficult.","provenance":"ai","model":"claude-haiku-5-5","generatedAt":"2026-11-20T21:57:37Z"},"euvd":{"id":"EUVD-2024-0068","exploited":false,"provenance":"source"},"lineage":{"familyId":"fam-gradio-app-gradio-cve-2023-34239","parents":[{"from":"CVE-2023-34239","to":"CVE-2024-47164","relation":"related","confidence":"medium","kind":"lineage","evidence":[{"kind":"same-code","provenance":"machine","files":["gradio/blocks.py"],"commits":["https://github.com/gradio-app/gradio/commit/37967617bd97615fb6f3b44e7750c0e0be58479a","https://github.com/gradio-app/gradio/commit/cd64130d54e678525774bbb200ef9c7166fa1543","https://github.com/gradio-app/gradio/commit/08b51590163b306fd874f543f6fcaf23ac7d2646"],"basis":"shared function","functions":["__init__","file","is_in_or_equal"]}]},{"from":"CVE-2023-51449","to":"CVE-2024-47164","relation":"related","confidence":"medium","kind":"lineage","evidence":[{"kind":"same-code","provenance":"machine","files":["gradio/routes.py","gradio/utils.py"],"commits":["https://github.com/gradio-app/gradio/commit/1b9d4234d6c25ef250d882c7b90e1f4039ed2d76","https://github.com/gradio-app/gradio/commit/7ba8c5da45b004edd12c0460be9222f5b5f5f055","https://github.com/gradio-app/gradio/commit/08b51590163b306fd874f543f6fcaf23ac7d2646"],"basis":"shared function","functions":["is_in_or_equal"]}]},{"from":"CVE-2024-2206","to":"CVE-2024-47164","relation":"related","confidence":"medium","kind":"lineage","evidence":[{"kind":"same-code","provenance":"machine","files":["gradio/blocks.py","gradio/components/base.py","gradio/data_classes.py","gradio/route_utils.py"],"commits":["https://github.com/gradio-app/gradio/commit/49d9c48537aa706bf72628e3640389470138bdc6","https://github.com/gradio-app/gradio/commit/08b51590163b306fd874f543f6fcaf23ac7d2646"],"basis":"shared function","functions":["__init__"]}]},{"from":"CVE-2024-1728","to":"CVE-2024-47164","relation":"related","confidence":"medium","kind":"lineage","evidence":[{"kind":"same-code","provenance":"machine","files":["gradio/blocks.py"],"commits":["https://github.com/gradio-app/gradio/commit/16fbe9cd0cffa9f2a824a0165beb43446114eec7","https://github.com/gradio-app/gradio/commit/08b51590163b306fd874f543f6fcaf23ac7d2646"],"basis":"shared function","functions":["__init__"]}]},{"from":"CVE-2024-1561","to":"CVE-2024-47164","relation":"related","confidence":"medium","kind":"lineage","evidence":[{"kind":"same-code","provenance":"machine","files":["gradio/components/file_explorer.py"],"commits":["https://github.com/gradio-app/gradio/commit/24a583688046867ca8b8b02959c441818bdb34a2","https://github.com/gradio-app/gradio/commit/08b51590163b306fd874f543f6fcaf23ac7d2646"],"basis":"rarely changed file"}]},{"from":"CVE-2024-4941","to":"CVE-2024-47164","relation":"related","confidence":"medium","kind":"lineage","evidence":[{"kind":"same-code","provenance":"machine","files":["gradio/components/base.py","gradio/data_classes.py"],"commits":["https://github.com/gradio-app/gradio/commit/08b51590163b306fd874f543f6fcaf23ac7d2646","https://github.com/gradio-app/gradio/commit/ee1e2942e0a1ae84a08a05464e41c8108a03fa9c"],"basis":"rarely changed file"}]}],"children":[{"from":"CVE-2024-47164","to":"CVE-2026-49119","relation":"related","confidence":"medium","kind":"lineage","evidence":[{"kind":"same-code","provenance":"machine","files":["gradio/components/file_explorer.py"],"commits":["https://github.com/gradio-app/gradio/commit/08b51590163b306fd874f543f6fcaf23ac7d2646","https://github.com/gradio-app/gradio/commit/97d541f3d5fd05b2587a69ecc94b68fe5d2d7004"],"basis":"rarely changed file"}]}]}}