CVE-2023-51449 Make the `/file` secure against file traversal attacks

Medium 5.6 Published Updated

Attackers can read arbitrary files on servers running Gradio apps with public URLs via path traversal in the /file route.

Exploited in the wild
Not known
Login needed
Not needed
Attackable
Over the internet
Victim action needed
Not needed
Fix
Available

What is CVE-2023-51449?

CVE-2023-51449 is a medium-severity path traversal vulnerability in Gradio Project Gradio, published on 22 Dec 2023. An attacker can exploit it over the internet without logging in, with no action from the victim.

Official description

Gradio is an open-source Python package that allows you to quickly build a demo or web application for your machine learning model, API, or any arbitary Python function. Versions of `gradio` prior to 4.11.0 contained a vulnerability in the `/file` route which made them susceptible to file traversal attacks in which an attacker could access arbitrary files on a machine running a Gradio app with a public URL (e.g. if the demo was created with `share=True`, or on Hugging Face Spaces) if they knew the path of files to look for. This issue has been patched in version 4.11.0.

Weakness: CWE-22

Which versions are affected by CVE-2023-51449?

3 open source packages ship an affected version, including gradio. It affects 1 product.

PackageAffectedFixed in
gradio PyPIAll versions4.11.0
gradio PyPIAll versions4.11.0
gradio PyPIAll versions4.11.0

Products include Gradio Project Gradio.

How do I fix CVE-2023-51449?

Upgrade gradio to 4.11.0 or later.

Upgrade, and resolve every user-supplied path against an allowed base folder before opening it. More about Path traversal.

Is CVE-2023-51449 being exploited?

It is not confirmed as exploited in the wild, but public exploit code for CVE-2023-51449 exists.

Public exploit code: 1 Nuclei template.

All Gradio Project Gradio vulnerabilities

Sources

Also known as GHSA-6qm2-wpxq-7qh2, PYSEC-2023-249.

Is CVE-2023-51449 in your software?

Upload an SBOM and sbomify checks it against every vulnerability here, every day.

Check your SBOMs for free