CVE-2024-23331 Vite dev server option `server.fs.deny` can be bypassed when hosted on case-insensitive filesystem

High 7.5 Published Updated

Attackers can bypass file access restrictions on case-insensitive systems to read sensitive files via case-augmented paths.

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

What is CVE-2024-23331?

CVE-2024-23331 is a high-severity path traversal vulnerability in vitejs vite, published on 19 Jan 2024. An attacker can exploit it over the internet without logging in, with no action from the victim.

Official description

Vite is a frontend tooling framework for javascript. The Vite dev server option `server.fs.deny` can be bypassed on case-insensitive file systems using case-augmented versions of filenames. Notably this affects servers hosted on Windows. This bypass is similar to CVE-2023-34092 -- with surface area reduced to hosts having case-insensitive filesystems. Since `picomatch` defaults to case-sensitive glob matching, but the file server doesn't discriminate; a blacklist bypass is possible. By requesting raw filesystem paths using augmented casing, the matcher derived from `config.server.fs.deny` fails to block access to sensitive files. This issue has been addressed in [email protected], [email protected], [email protected], and [email protected]. Users are advised to upgrade. Users unable to upgrade should restrict access to dev servers.

Weakness: CWE-284, CWE-200, CWE-178

Which versions are affected by CVE-2024-23331?

8 open source packages ship an affected version, including vite. It affects 1 product.

PackageAffectedFixed in
vite npmFrom 2.7.02.9.17
vite npmFrom 2.7.02.9.17
vite npmFrom 3.0.03.2.8
vite npmFrom 3.0.03.2.8
vite npmFrom 4.0.04.5.2
vite npmFrom 4.0.04.5.2
2 more packages
vite npmFrom 5.0.05.0.12
vite npmFrom 5.0.05.0.12

Products include Vitejs Vite.

How do I fix CVE-2024-23331?

Upgrade vite to a fixed version for your release line: 2.9.17, 3.2.8, 4.5.2 or 5.0.12.

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

Is CVE-2024-23331 being exploited?

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

Sources

Also known as GHSA-c24v-8rfc-w8vw, MINI-67fx-6233-979c.

Is CVE-2024-23331 in your software?

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

Check your SBOMs for free