NewApp Monitoring is liveSign up free
AgentbeamBeta
AI agent vulnerability · Gradio

CVE-2026-49119: Gradio FileExplorer preprocess path traversal allows files outside root_dir to reach callbacks

highCVSS 4.0 8.7 · 3.1 7.5GHSA-j36p-7w88-g82j

Gradio's `FileExplorer` component did not keep selected paths inside its `root_dir`. An unauthenticated client could send an absolute path or `..` segments and have a path outside the root passed to the app's callback, which can lead to arbitrary file read. Versions before 6.16.0 are affected. Upgrade gradio to 6.16.0.

Published Jul 1, 2026 · Updated Oct 2, 2026 · Analysis Oct 25, 2026

What an attacker can do

FileExplorer.preprocess() builds the selected path from the segments the browser sends. It used os.path.join(self.root_dir, *segments) followed by os.path.normpath(). When a segment is an absolute path such as /etc/passwd, os.path.join throws away the root_dir prefix. .. segments can also climb out of the root. The resulting path went to the developer's callback. The component's ls() method already used _safe_join and was not affected.

The flaw does not read a file by itself. It hands an attacker-chosen path to your function. If that function opens, returns or serves the file, as a typical file viewer does, the attacker reads any file the Gradio process can read. That includes config files, SSH keys and environment secrets. The attacker needs only network access to the app: the CVSS vector has no privileges and no user interaction.

Apps that expose a Gradio interface publicly or on a shared network and use FileExplorer are the ones at risk.

Who is affected

Affected: pip gradio before 6.16.0, in apps that use the gr.FileExplorer component. Apps that do not use that component are not exposed through this flaw.

pip show gradio

Search your code for FileExplorer to see which apps use it, and read what their callbacks do with the received path.

gradio

Ecosystem
PyPI
Affected
< 6.16.0
Fixed in
6.16.0
Check
pip show gradio

How to fix it

Upgrade to gradio 6.16.0.

pip install --upgrade "gradio>=6.16.0"

Per the fix pull request, both the single and multiple file modes of preprocess() now call _safe_join, the validation ls() already used. Out-of-root paths raise InvalidPathError. The sources give no other workaround. Until you upgrade, validate the path inside your own callback and reject anything that resolves outside root_dir.

How to tell if you were hit

Look in the app's request logs for calls to the FileExplorer event with an absolute path or .. in the selected path. Check for InvalidPathError after upgrading, which would show attempts. In your callback code, check whether it logs the file paths it opens, and look for reads of files such as /etc/passwd or ~/.ssh/ keys. Treat secrets on the host as exposed if you find them.

Original advisory

From the GitHub Advisory Database (CC BY 4.0).

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 root_dir prefix entirely, resulting in arbitrary file read or exposure of sensitive files outside the intended directory.

Credited to PercevalFox.

Questions

Is Gradio 6.15 affected by CVE-2026-49119?

Yes, if the app uses FileExplorer. Every version before 6.16.0 is affected, and 6.16.0 is the fix.

Does the attacker need to log in?

No. The advisory says unauthenticated attackers can exploit it. The attacker needs network access to the Gradio app.

Is it exploited in the wild?

The sources do not report exploitation, and the entry is not in CISA's KEV catalog.

References

How this page is made: the data panel comes from the GitHub Advisory Database, CISA’s KEV catalog, the NVD and FIRST EPSS, and updates twice a day. The analysis is written by an AI model from the sources listed above and checked by automated rules before it is published. Check versions against the vendor's advisory before you act. Methodology

More Gradio vulnerabilities

All Gradio entries