Gradio Path Traversal vulnerability
The blocked_path feature in Gradio fails to block access to files when the path uses NTFS Alternate Data Streams syntax, so a user can read files that should be restricted. An attacker could use this to read blocked files on Windows.
gradio-app/gradio
Originally disclosed on huntr
A vulnerability in the gradio-app/gradio repository, version git 67e4044, allows for path traversal on Windows OS. The implementation of the blocked_path functionality, which is intended to disallow users from reading certain files, is flawed. Specifically, while the application correctly blocks access to paths like 'C:/tmp/secret.txt', it fails to block access when using NTFS Alternate Data Streams (ADS) syntax, such as 'C:/tmp/secret.txt::$DATA'. This flaw can lead to unauthorized reading of blocked file paths.
From the GitHub Advisory Database (GHSA-prpg-p95c-32fv, CC BY 4.0).
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
How it worked
Root cause
Likely the path validation only checks the normal file path and does not normalise or strip NTFS Alternate Data Stream suffixes before comparing against the blocklist.
Impact
An attacker could read files that the blocked_path setting was meant to protect, but only on Windows.
What the attacker needed
Windows OS; blocked_path configured
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
Gradio has a feature to stop people from reading certain files. On Windows, there is a special way to write a file path that includes extra data streams, and the check did not account for that. So someone could still read a file that was supposed to be blocked.
What is Path traversal?
Input that builds a file path escapes the intended folder, reading or writing files the application should never touch.