CVE-2024-31207 Vite's `server.fs.deny` did not deny requests for patterns with directories

Medium 5.9 Published Updated

Vite's file system deny list fails to block directory patterns, allowing attackers to read restricted files during development.

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-31207?

CVE-2024-31207 is a medium-severity path traversal vulnerability in vitejs vite, published on 4 Apr 2024. An attacker can exploit it over the internet without logging in, with no action from the victim.

Official description

Vite (French word for "quick", pronounced /vit/, like "veet") is a frontend build tooling to improve the frontend development experience.`server.fs.deny` does not deny requests for patterns with directories. This vulnerability has been patched in version(s) 5.2.6, 5.1.7, 5.0.13, 4.5.3, 3.2.10 and 2.9.18.

Weakness: CWE-284, CWE-200

Which versions are affected by CVE-2024-31207?

12 open source packages ship an affected version, including vite.

PackageAffectedFixed in
vite npmFrom 2.7.02.9.18
vite npmFrom 2.7.02.9.18
vite npmFrom 3.0.03.2.10
vite npmFrom 3.0.03.2.10
vite npmFrom 4.0.04.5.3
vite npmFrom 4.0.04.5.3
6 more packages
vite npmFrom 5.0.05.0.13
vite npmFrom 5.0.05.0.13
vite npmFrom 5.1.05.1.7
vite npmFrom 5.1.05.1.7
vite npmFrom 5.2.05.2.6
vite npmFrom 5.2.05.2.6

How do I fix CVE-2024-31207?

Upgrade vite to a fixed version for your release line: 2.9.18, 3.2.10, 4.5.3 or 5.0.13.

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

Is CVE-2024-31207 being exploited?

There is no known exploitation of CVE-2024-31207 in the wild and no public exploit code.

Sources

Also known as GHSA-8jhw-289h-jh2g, MINI-76f4-jr6c-p83w.

Is CVE-2024-31207 in your software?

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

Check your SBOMs for free