{"id":"CVE-2024-4941","published":"2024-06-06T17:55:11Z","modified":"2025-10-15T12:49:40Z","title":"Local File Inclusion in JSON component in gradio-app/gradio","vendor":"gradio-app","product":"gradio-app/gradio","tier":"tail","description":{"text":"A local file inclusion vulnerability exists in the JSON component of gradio-app/gradio version 4.25. The vulnerability arises from improper input validation in the `postprocess()` function within `gradio/components/json_component.py`, where a user-controlled string is parsed as JSON. If the parsed JSON object contains a `path` key, the specified file is moved to a temporary directory, making it possible to retrieve it later via the `/file=..` endpoint. This issue is due to the `processing_utils.move_files_to_cache()` function traversing any object passed to it, looking for a dictionary with a `path` key, and then copying the specified file to a temporary directory. The vulnerability can be exploited by an attacker to read files on the remote system, posing a significant security risk.","provenance":"source","from":"CVE.org"},"cvss":{"score":7.5,"severity":"HIGH","version":"3.0","vector":"CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N","provenance":"source","from":"CVE.org CNA"},"epss":{"score":0.0083,"percentile":0.57533,"provenance":"source"},"cwes":[{"id":"CWE-22","name":"Improper Limitation of a Pathname to a Restricted Directory"}],"references":[{"url":"https://huntr.com/bounties/39889ce1-298d-4568-aecd-7ae40c2ca58e","tags":[]},{"url":"https://github.com/gradio-app/gradio/commit/ee1e2942e0a1ae84a08a05464e41c8108a03fa9c","tags":[]}],"priority":{"score":16.8,"factors":[{"name":"EPSS percentile","points":11.51},{"name":"CVSS severity","points":5.25}]},"vendorSlug":"gradio-app","affectedVersions":[{"vendor":"gradio-app","product":"gradio-app/gradio","versions":[">= unspecified, < 4.31.4"]}],"affected":[{"ecosystem":"PyPI","package":"gradio","vulnerableRanges":["<4.31.3","<4.31.4"],"patched":["4.31.3","4.31.4"],"from":["GHSA-6v6g-j5fq-hpvw","PYSEC-2024-184"],"provenance":"source"}],"euvd":{"id":"EUVD-2024-0063","exploited":false,"provenance":"source"},"lineage":{"familyId":"fam-gradio-app-gradio-cve-2023-34239","parents":[{"from":"CVE-2024-2206","to":"CVE-2024-4941","relation":"related","confidence":"medium","kind":"lineage","evidence":[{"kind":"same-code","provenance":"machine","files":["gradio/components/base.py","gradio/data_classes.py","gradio/processing_utils.py"],"commits":["https://github.com/gradio-app/gradio/commit/49d9c48537aa706bf72628e3640389470138bdc6","https://github.com/gradio-app/gradio/commit/ee1e2942e0a1ae84a08a05464e41c8108a03fa9c"],"basis":"shared function","functions":["_move_to_cache","move_resource_to_block_cache"]}]},{"from":"CVE-2024-1728","to":"CVE-2024-4941","relation":"related","confidence":"medium","kind":"lineage","evidence":[{"kind":"same-code","provenance":"machine","files":["gradio/processing_utils.py"],"commits":["https://github.com/gradio-app/gradio/commit/16fbe9cd0cffa9f2a824a0165beb43446114eec7","https://github.com/gradio-app/gradio/commit/ee1e2942e0a1ae84a08a05464e41c8108a03fa9c"],"basis":"shared function","functions":["_move_to_cache"]}]}],"packageHistory":[{"cve":"CVE-2024-1729","published":"2024-03-29","fixed":"4.19.2","kev":false},{"cve":"CVE-2024-34510","published":"2024-05-05","fixed":"4.20.0","kev":false},{"cve":"CVE-2024-4253","published":"2024-06-04","fixed":"4.29.0","kev":false,"link":{"from":"CVE-2024-4253","to":"CVE-2024-4941","relation":"successor","confidence":"low","kind":"sequence","evidence":[{"kind":"version-step","provenance":"source","package":"PyPI:gradio","fromFixed":"4.29.0","toFixed":"4.31.3","daysApart":2}]}},{"cve":"CVE-2024-4941","published":"2024-06-06","fixed":"4.31.4","kev":false},{"cve":"CVE-2024-47084","published":"2024-10-10","fixed":"4.44.0","kev":false},{"cve":"CVE-2024-47166","published":"2024-10-10","fixed":"4.44.0","kev":false},{"cve":"CVE-2024-47168","published":"2024-10-10","fixed":"4.44.0","kev":false}],"package":"PyPI:gradio"}}