CVE-2024-31207 Vite's `server.fs.deny` did not deny requests for patterns with directories
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.
Which versions are affected by CVE-2024-31207?
12 open source packages ship an affected version, including vite.
| Package | Affected | Fixed in |
|---|---|---|
vite npm | From 2.7.0 | 2.9.18 |
vite npm | From 2.7.0 | 2.9.18 |
vite npm | From 3.0.0 | 3.2.10 |
vite npm | From 3.0.0 | 3.2.10 |
vite npm | From 4.0.0 | 4.5.3 |
vite npm | From 4.0.0 | 4.5.3 |
6 more packages
vite npm | From 5.0.0 | 5.0.13 |
vite npm | From 5.0.0 | 5.0.13 |
vite npm | From 5.1.0 | 5.1.7 |
vite npm | From 5.1.0 | 5.1.7 |
vite npm | From 5.2.0 | 5.2.6 |
vite npm | From 5.2.0 | 5.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.