chore(deps): update dependency vite to v7.0.8 [security]
This MR contains the following updates:
| Package | Change | Age | Confidence |
|---|---|---|---|
| vite (source) | 7.0.0 -> 7.0.8 |
Vite's server.fs settings were not applied to HTML files
CVE-2025-58752 / GHSA-jqfw-vq24-v9c3
More information
Details
Summary
Any HTML files on the machine were served regardless of the server.fs settings.
Impact
Only apps that match the following conditions are affected:
- explicitly exposes the Vite dev server to the network (using --host or server.host config option)
-
appType: 'spa'(default) orappType: 'mpa'is used
This vulnerability also affects the preview server. The preview server allowed HTML files not under the output directory to be served.
Details
The serveStaticMiddleware function is in charge of serving static files from the server. It returns the viteServeStaticMiddleware function which runs the needed tests and serves the page. The viteServeStaticMiddleware function checks if the extension of the requested file is ".html". If so, it doesn't serve the page. Instead, the server will go on to the next middlewares, in this case htmlFallbackMiddleware, and then to indexHtmlMiddleware. These middlewares don't perform any test against allow or deny rules, and they don't make sure that the accessed file is in the root directory of the server. They just find the file and send back its contents to the client.
PoC
Execute the following shell commands:
npm create vite@latest
cd vite-project/
echo "secret" > /tmp/secret.html
npm install
npm run dev
Then, in a different shell, run the following command:
curl -v --path-as-is 'http://localhost:5173/../../../../../../../../../../../tmp/secret.html'
The contents of /tmp/secret.html will be returned.
This will also work for HTML files that are in the root directory of the project, but are in the deny list (or not in the allow list). Test that by stopping the running server (CTRL+C), and running the following commands in the server's shell:
echo 'import path from "node:path"; import { defineConfig } from "vite"; export default defineConfig({server: {fs: {deny: [path.resolve(__dirname, "secret_files/*")]}}})' > [vite.config.js](http://vite.config.js)
mkdir secret_files
echo "secret txt" > secret_files/secret.txt
echo "secret html" > secret_files/secret.html
npm run dev
Then, in a different shell, run the following command:
curl -v --path-as-is 'http://localhost:5173/secret_files/secret.txt'
You will receive a 403 HTTP Response, because everything in the secret_files directory is denied.
Now in the same shell run the following command:
curl -v --path-as-is 'http://localhost:5173/secret_files/secret.html'
You will receive the contents of secret_files/secret.html.
Severity
- CVSS Score: Unknown
- Vector String:
CVSS:4.0/AV:N/AC:L/AT:P/MR:N/UI:P/VC:L/VI:N/VA:N/SC:N/SI:N/SA:N
References
- https://github.com/vitejs/vite/security/advisories/GHSA-jqfw-vq24-v9c3
- https://nvd.nist.gov/vuln/detail/CVE-2025-58752
- https://github.com/vitejs/vite/commit/0ab19ea9fcb66f544328f442cf6e70f7c0528d5f
- https://github.com/vitejs/vite/commit/14015d794f69accba68798bd0e15135bc51c9c1e
- https://github.com/vitejs/vite/commit/482000f57f56fe6ff2e905305100cfe03043ddea
- https://github.com/vitejs/vite/commit/6f01ff4fe072bcfcd4e2a84811772b818cd51fe6
- https://github.com/vitejs/vite
- https://github.com/vitejs/vite/blob/v7.1.5/packages/vite/CHANGELOG.md
This data is provided by OSV and the GitHub Advisory Database (CC-BY 4.0).
Vite middleware may serve files starting with the same name with the public directory
CVE-2025-58751 / GHSA-g4jq-h2w9-997c
More information
Details
Summary
Files starting with the same name with the public directory were served bypassing the server.fs settings.
Impact
Only apps that match the following conditions are affected:
- explicitly exposes the Vite dev server to the network (using --host or
server.hostconfig option) - uses the public directory feature (enabled by default)
- a symlink exists in the public directory
Details
The servePublicMiddleware function is in charge of serving public files from the server. It returns the viteServePublicMiddleware function which runs the needed tests and serves the page. The viteServePublicMiddleware function checks if the publicFiles variable is defined, and then uses it to determine if the requested page is public. In the case that the publicFiles is undefined, the code will treat the requested page as a public page, and go on with the serving function. publicFiles may be undefined if there is a symbolic link anywhere inside the public directory. In that case, every requested page will be passed to the public serving function. The serving function is based on the sirv library. Vite patches the library to add the possibility to test loading access to pages, but when the public page middleware disables this functionality since public pages are meant to be available always, regardless of whether they are in the allow or deny list.
In the case of public pages, the serving function is provided with the path to the public directory as a root directory. The code of the sirv library uses the join function to get the full path to the requested file. For example, if the public directory is "/www/public", and the requested file is "myfile", the code will join them to the string "/www/public/myfile". The code will then pass this string to the normalize function. Afterwards, the code will use the string's startsWith function to determine whether the created path is within the given directory or not. Only if it is, it will be served.
Since sirv trims the trailing slash of the public directory, the string's startsWith function may return true even if the created path is not within the public directory. For example, if the server's root is at "/www", and the public directory is at "/www/p", if the created path will be "/www/private.txt", the startsWith function will still return true, because the string "/www/private.txt" starts with "/www/p". To achieve this, the attacker will use ".." to ask for the file "../private.txt". The code will then join it to the "/www/p" string, and will receive "/www/p/../private.txt". Then, the normalize function will return "/www/private.txt", which will then be passed to the startsWith function, which will return true, and the processing of the page will continue without checking the deny list (since this is the public directory middleware which doesn't check that).
PoC
Execute the following shell commands:
npm create vite@latest
cd vite-project/
mkdir p
cd p
ln -s a b
cd ..
echo 'import path from "node:path"; import { defineConfig } from "vite"; export default defineConfig({publicDir: path.resolve(__dirname, "p/"), server: {fs: {deny: [path.resolve(__dirname, "private.txt")]}}})' > vite.config.js
echo "secret" > private.txt
npm install
npm run dev
Then, in a different shell, run the following command:
curl -v --path-as-is 'http://localhost:5173/private.txt'
You will receive a 403 HTTP Response, because private.txt is denied.
Now in the same shell run the following command:
curl -v --path-as-is 'http://localhost:5173/../private.txt'
You will receive the contents of private.txt.
Related links
Severity
- CVSS Score: Unknown
- Vector String:
CVSS:4.0/AV:N/AC:L/AT:P/MR:N/UI:P/VC:L/VI:N/VA:N/SC:N/SI:N/SA:N
References
- https://github.com/vitejs/vite/security/advisories/GHSA-g4jq-h2w9-997c
- https://nvd.nist.gov/vuln/detail/CVE-2025-58751
- https://github.com/lukeed/sirv/commit/f0113f3f8266328d804ee808f763a3c11f8997eb
- https://github.com/vitejs/vite/commit/09f2b52e8d5907f26602653caf41b3a56692600d
- https://github.com/vitejs/vite/commit/4f1c35bcbb5830290c694aa14b6789e07450f069
- https://github.com/vitejs/vite/commit/63e2a5d232218f3f8d852056751e609a5367aaec
- https://github.com/vitejs/vite/commit/e11d24008b97d4ca731ecc1a3b95260a6d12e7e0
- https://github.com/vitejs/vite
This data is provided by OSV and the GitHub Advisory Database (CC-BY 4.0).
vite allows server.fs.deny bypass via backslash on Windows
CVE-2025-62522 / GHSA-93m4-6634-74q7
More information
Details
Summary
Files denied by server.fs.deny were sent if the URL ended with \ when the dev server is running on Windows.
Impact
Only apps that match the following conditions are affected:
- explicitly exposes the Vite dev server to the network (using --host or
server.hostconfig option) - running the dev server on Windows
Details
server.fs.deny can contain patterns matching against files (by default it includes .env, .env.*, *.{crt,pem} as such patterns). These patterns were able to bypass by using a back slash(\). The root cause is that fs.readFile('/foo.png/') loads /foo.png.
PoC
npm create vite@latest
cd vite-project/
cat "secret" > .env
npm install
npm run dev
curl --request-target /.env\ http://localhost:5173
Severity
- CVSS Score: Unknown
- Vector String:
CVSS:4.0/AV:N/AC:L/AT:P/MR:N/UI:P/VC:H/VI:N/VA:N/SC:N/SI:N/SA:N
References
- https://github.com/vitejs/vite/security/advisories/GHSA-93m4-6634-74q7
- https://nvd.nist.gov/vuln/detail/CVE-2025-62522
- https://github.com/vitejs/vite/commit/f479cc57c425ed41ceb434fecebd63931b1ed4ed
- https://github.com/vitejs/vite
This data is provided by OSV and the GitHub Advisory Database (CC-BY 4.0).
Release Notes
vitejs/vite (vite)
v7.0.8
Please refer to CHANGELOG.md for details.
v7.0.7
Please refer to CHANGELOG.md for details.
v7.0.6
Features
- support files with more than 1000 lines by
generateCodeFrame(#20508) (e7d0b2a) - add
import.meta.mainsupport in config (bundle config loader) (#20516) (5d3e3c2) - optimizer: improve dependency optimization error messages with esbuild formatMessages (#20525) (d17cfed)
-
ssr: add
import.meta.mainsupport for Node.js module runner (#20517) (794a8f2) - add
future: 'warn'(#20473) (e6aaf17) - add
removeServerPluginContainerfuture deprecation (#20437) (c1279e7) - add
removeServerReloadModulefuture deprecation (#20436) (6970d17) - add
server.warmupRequestto future deprecation (#20431) (8ad388a) - add
ssrFixStacktrace/ssrRewriteStacktracetoremoveSsrLoadModulefuture deprecation (#20435) (8c8f587) - client: ping from SharedWorker (#19057) (5c97c22)
-
dev: add
this.fssupport (#20301) (0fe3f2f) - export
defaultExternalConditions(#20279) (344d302) - implement
removePluginHookSsrArgumentfuture deprecation (#20433) (95927d9) - implement
removeServerHotfuture deprecation (#20434) (259f45d) - resolve server URLs before calling other listeners (#19981) (45f6443)
-
ssr: resolve externalized packages with
resolve.externalConditionsand addmodule-syncto default external condition (#20409) (c669c52) -
ssr: support
import.meta.resolvein module runner (#20260) (62835f7)
Bug Fixes
-
css: avoid warnings for
image-setcontaining__VITE_ASSET__(#20520) (f1a2635) - css: empty CSS entry points should generate CSS files, not JS files (#20518) (bac9f3e)
- dev: denied request stalled when requested concurrently (#20503) (64a52e7)
-
manifest: initialize
entryCssAssetFileNamesas an empty Set (#20542) (6a46cda) - skip prepareOutDirPlugin in workers (#20556) (97d5111)
-
asset: only watch existing files for
new URL(, import.meta.url)(#20507) (1b211fd) - client: keep ping on WS constructor error (#20512) (3676da5)
- deps: update all non-major dependencies (#20537) (fc9a9d3)
- don't resolve as relative for specifiers starting with a dot (#20528) (c5a10ec)
- html: allow control character in input stream (#20483) (c12a4a7)
- merge old and new
noExternal: truecorrectly (#20502) (9ebe4a5) - deps: update all non-major dependencies (#20489) (f6aa04a)
- dev: denied requests overly (#20410) (4be5270)
-
hmr: register css deps as
type: asset(#20391) (7eac8dd) - optimizer: discover correct jsx runtime during scan (#20495) (10d48bb)
-
preview: set correct host for
resolvedUrls(#20496) (62b3e0d) - worker: resolve WebKit compat with inline workers by deferring blob URL revocation (#20460) (8033e5b)
Performance Improvements
Miscellaneous Chores
- deps: update rolldown-related dependencies (#20536) (8be2787)
- deps: update dependency parse5 to v8 (#20490) (744582d)
- format (f20addc)
- stablize
cssScopeTo(#19592) (ced1343)
Code Refactoring
- use hook filters in the worker plugin (#20527) (958cdf2)
- extract prepareOutDir as a plugin (#20373) (2c4af1f)
- extract resolve rollup options (#20375) (61a9778)
- rewrite openchrome.applescript to JXA (#20424) (7979f9d)
- use
http-proxy-3(#20402) (26d9872) - use hook filters in internal plugins (#20358) (f19c4d7)
- use hook filters in internal resolve plugin (#20480) (acd2a13)
Tests
- detect ts support via
process.features(#20544) (856d3f0) - fix unimportant errors in test-unit (#20545) (1f23554)
Beta Changelogs
7.1.0-beta.1 (2025-08-05)
7.1.0-beta.0 (2025-07-30)
v7.0.5
Bug Fixes
- deps: update all non-major dependencies (#20406) (1a1cc8a)
- remove special handling for
Accept: text/html(#20376) (c9614b9) - watch assets referenced by
new URL(, import.meta.url)(#20382) (6bc8bf6)
Miscellaneous Chores
Code Refactoring
v7.0.4
Bug Fixes
Build System
v7.0.3
Bug Fixes
- client: protect against window being defined but addEv undefined (#20359) (31d1467)
- define: replace optional values (#20338) (9465ae1)
- deps: update all non-major dependencies (#20366) (43ac73d)
Miscellaneous Chores
- deps: update dependency dotenv to v17 (#20325) (45040d4)
- deps: update dependency rolldown to ^1.0.0-beta.24 (#20365) (5ab25e7)
- use
n/prefer-node-protocolrule (#20368) (38bb268)
Code Refactoring
v7.0.2
Bug Fixes
v7.0.1
Bug Fixes
- css: skip resolving resolved paths in sass (#20300) (ac528a4)
- deps: update all non-major dependencies (#20324) (3e81af3)
- types: add a global interface for Worker (#20243) (37bdfc1)
Miscellaneous Chores
Configuration
-
If you want to rebase/retry this MR, check this box
This MR has been generated by Renovate Bot.