Логотип exploitDog
Консоль
Логотип exploitDog

exploitDog

github логотип

GHSA-353f-5xf4-qw67

Опубликовано: 06 июн. 2023
Источник: github
Github: Прошло ревью
CVSS3: 7.5

Описание

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

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\nproof-2

Пакеты

Наименование

vite

npm
Затронутые версииВерсия исправления

< 2.9.16

2.9.16

Наименование

vite

npm
Затронутые версииВерсия исправления

>= 3.0.2, < 3.2.7

3.2.7

Наименование

vite

npm
Затронутые версииВерсия исправления

>= 4.0.0, < 4.0.5

4.0.5

Наименование

vite

npm
Затронутые версииВерсия исправления

>= 4.1.0, < 4.1.5

4.1.5

Наименование

vite

npm
Затронутые версииВерсия исправления

>= 4.2.0, < 4.2.3

4.2.3

Наименование

vite

npm
Затронутые версииВерсия исправления

>= 4.3.0, < 4.3.9

4.3.9

EPSS

Процентиль: 60%
0.00399
Низкий

7.5 High

CVSS3

Дефекты

CWE-200
CWE-50
CWE-706

Связанные уязвимости

CVSS3: 7.5
nvd
больше 2 лет назад

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.

CVSS3: 7.5
debian
больше 2 лет назад

Vite provides frontend tooling. Prior to versions 2.9.16, 3.2.7, 4.0.5 ...

EPSS

Процентиль: 60%
0.00399
Низкий

7.5 High

CVSS3

Дефекты

CWE-200
CWE-50
CWE-706