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

Published Jun 1, 2023
·
Updated

The issue involves a security vulnerability in Vite where the server options can be bypassed using a double forward slash (//). This vulnerability poses a potential security risk as it can allow unauthorized access to sensitive directories and files.

Steps to Fix. Update Vite: Ensure that you are using the latest version of Vite. Security issues like this are often fixed in newer releases.\n2. Secure the server configuration: In your vite.config.js file, review and update the server configuration options to restrict access to unauthorized requests or directories.

Impact Only users explicitly exposing the Vite dev server to the network (using --host or the server.host config option) are affected and only files in the immediate Vite project root folder could be exposed.\n\n### Patches\nFixed in vite@4.3.9, vite@4.2.3, vite@4.1.5, vite@4.0.5 and in the latest minors of the previous two majors, vite@3.2.7 and vite@2.9.16.

### Details Vite serves the application with under the root-path of the project while running on the dev mode. By default, Vite uses the server option fs.deny to protect sensitive files. But using a simple double forward-slash, we can bypass this restriction. \n\n### PoC\n1. Create a new latest project of Vite using any package manager. (here I'm using react and vue templates and pnpm for testing)\n2. Serve the application on dev mode using pnpm run dev.\n3. Directly access the file via url using double forward-slash (//) (e.g: //.env, //.env.local)\n4. The server option fs.deny was successfully bypassed.

Proof Images: !proof-1\n!proof-2

Other sources

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 vite@4.3.9, vite@4.2.3, vite@4.1.5, vite@4.0.5, vite@3.2.7, and vite@2.9.16.

Affected Software

12 affected componentsFixes available
npm/vite>=4.3.0<4.3.9
4.3.9
npm/vite>=4.2.0<4.2.3
4.2.3
npm/vite>=4.1.0<4.1.5
4.1.5
npm/vite>=4.0.0<4.0.5
4.0.5
npm/vite>=3.0.2<3.2.7
3.2.7
npm/vite<2.9.16
2.9.16
vitejs Vite Node.js>=3.0.2<3.2.7
vitejs Vite Node.js>=4.0.0<4.0.5
vitejs Vite Node.js>=4.1.0<4.1.5
vitejs Vite Node.js>=4.2.0<4.2.3
vitejs Vite Node.js>=4.3.0<4.3.9
vitejs Vite Node.js=2.9.15

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade npm/vite to a version that resolves this vulnerability.

    Fixed in 4.3.9
  2. Upgrade

    Upgrade npm/vite to a version that resolves this vulnerability.

    Fixed in 4.2.3
  3. Upgrade

    Upgrade npm/vite to a version that resolves this vulnerability.

    Fixed in 4.1.5
  4. Upgrade

    Upgrade npm/vite to a version that resolves this vulnerability.

    Fixed in 4.0.5
  5. Upgrade

    Upgrade npm/vite to a version that resolves this vulnerability.

    Fixed in 3.2.7
  6. Upgrade

    Upgrade npm/vite to a version that resolves this vulnerability.

    Fixed in 2.9.16
  7. Upgrade

    Upgrade vite to a version that resolves this vulnerability.

    Fixed in 4.3.9
  8. Upgrade

    Upgrade vite to a version that resolves this vulnerability.

    Fixed in 4.2.3
  9. Upgrade

    Upgrade vite to a version that resolves this vulnerability.

    Fixed in 4.1.5
  10. Upgrade

    Upgrade vite to a version that resolves this vulnerability.

    Fixed in 4.0.5
  11. Upgrade

    Upgrade vite to a version that resolves this vulnerability.

    Fixed in 3.2.7
  12. Upgrade

    Upgrade vite to a version that resolves this vulnerability.

    Fixed in 2.9.16
  13. Configuration

    Only users explicitly exposing the Vite dev server to the network (via `--host` or `server.host`) are affected. Ensure `server.host`/`--host` is not set to a public/untrusted address; restrict dev-server exposure to trusted networks/localhost.

    Vite dev server server.host (or --host) = Only bind to localhost/internal network; do not expose to untrusted networks

Event History

Jun 1, 2023
CVE Published
via MITRE·04:29 PM
Data Sourced
via MITRE·04:29 PM
DescriptionSeverityWeakness
Data Sourced
05:15 PM
Description
Data Sourced
via NVD·05:15 PM
RemedyDescriptionSeverityWeaknessAffected Software
Jun 6, 2023
Advisory Published
via GitHub·02:01 AM
Free Weekly Intel

Don't miss critical vulnerabilities

Join thousands of security professionals who receive our weekly digest of trending CVEs, zero-days, and exploited vulnerabilities.

No spam. Unsubscribe anytime.

Frequently Asked Questions

1

What is CVE-2023-34092?

CVE-2023-34092 is a security vulnerability in Vite that allows unauthorized access to sensitive directories and files.

2

How severe is CVE-2023-34092?

CVE-2023-34092 has a severity rating of 7.5 (High).

3

How can I fix CVE-2023-34092?

To fix CVE-2023-34092, update Vite to version 4.3.9 or higher.

4

Is Vite version 4.3.9 affected by CVE-2023-34092?

No, Vite version 4.3.9 is not affected by CVE-2023-34092.

5

Where can I find more information about CVE-2023-34092?

You can find more information about CVE-2023-34092 on the GitHub page: [link](https://github.com/vitejs/vite/security/advisories/GHSA-353f-5xf4-qw67)

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203