CVE-2023-34092 Vite Server Options (server.fs.deny) can be bypassed using double forward-slash (//)

High 7.5 Published Updated

Attackers can bypass file access restrictions to read sensitive files from the project root if the Vite dev server is exposed to the network.

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

CVE-2023-34092 is a high-severity path traversal vulnerability in vitejs vite, published on 1 Jun 2023. An attacker can exploit it over the internet without logging in, with no action from the victim.

Official description

Vite provides frontend tooling. Prior to versions 2.9.16, 3.2.7, 4.0.5, 4.1.5, 4.2.3, and 4.3.9, Vite Server Options (`server.fs.deny`) can be bypassed using double forward-slash (//) allows any unauthenticated user to read file from the Vite root-path of the application including the default `fs.deny` settings (`['.env', '.env.*', '*.{crt,pem}']`). Only users explicitly exposing the Vite dev server to the network (using `--host` or `server.host` config option) are affected, and only files in the immediate Vite project root folder could be exposed. This issue is fixed in [email protected], [email protected], [email protected], [email protected], [email protected], and [email protected].

Weakness: CWE-706, CWE-50, CWE-200

Which versions are affected by CVE-2023-34092?

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

PackageAffectedFixed in
vite npmAll versions2.9.16
vite npmAll versions2.9.16
vite npmFrom 3.0.23.2.7
vite npmFrom 3.0.23.2.7
vite npmFrom 4.0.04.0.5
vite npmFrom 4.0.04.0.5
6 more packages
vite npmFrom 4.1.04.1.5
vite npmFrom 4.1.04.1.5
vite npmFrom 4.2.04.2.3
vite npmFrom 4.2.04.2.3
vite npmFrom 4.3.04.3.9
vite npmFrom 4.3.04.3.9

Products include Vitejs Vite.

How do I fix CVE-2023-34092?

Upgrade vite to a fixed version for your release line: 2.9.16, 3.2.7, 4.0.5 or 4.1.5.

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

Is CVE-2023-34092 being exploited?

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

Public exploit code: 1 Nuclei template.

Sources

Also known as GHSA-353f-5xf4-qw67.

Is CVE-2023-34092 in your software?

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

Check your SBOMs for free