PYSEC-2026-2179: Gradio < 6.16.0 Path Traversal via FileExplorer.preprocess()
Gradio before 6.16.0 contain a path traversal vulnerability in the FileExplorer component's preprocess() method that allows unauthenticated attackers to escape the configured root directory by supplying path segments containing directory traversal sequences or absolute paths. Attackers can provide crafted path segments that cause os.path.join to discard the rootdir prefix entirely, resulting in arbitrary file read or exposure of sensitive files outside the intended directory.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
Gradioto a version that resolves this vulnerability.Fixed in 6.16.0
Event History
Frequently Asked Questions
Who can exploit this issue?
Unauthenticated remote attackers can exploit it. The affected FileExplorer component must be reachable to the attacker.
What does an attacker need to send?
The attacker supplies crafted path segments containing directory-traversal sequences or absolute paths. These can cause path joining to ignore the configured root directory.
Are files outside the configured root directory at risk?
Yes. Successful exploitation can allow arbitrary file reads and exposure of sensitive files outside the intended directory.
What version resolves the issue?
Upgrade Gradio to version 6.16.0 or later. Versions before 6.16.0 are affected.