-
-
Notifications
You must be signed in to change notification settings - Fork 3.5k
chore(deps): update dependency vite to v5 [security] #9708
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
|
WalkthroughDevDependency Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
Poem
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
Comment |
View your CI Pipeline Execution ↗ for commit f36aca1
☁️ Nx Cloud last updated this comment at |
Sizes for commit f36aca1:
|
993ff9a
to
b72a56f
Compare
5c81be8
to
c15730d
Compare
c15730d
to
42e2d9c
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 2
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
examples/vue/2.6-basic/package.json
(1 hunks)examples/vue/2.7-basic/package.json
(1 hunks)
"typescript": "5.8.3", | ||
"vite": "^4.5.14", | ||
"vite": "^5.4.20", | ||
"vite-plugin-vue2": "2.0.3" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Upgrade blocked by Vue 2.6 plugin compatibility
Line 17 moves this example to Vite ^5.4.20 while retaining vite-plugin-vue2@2.0.3
, but that plugin’s peer constraint is vite ^2 || ^3
, so installation will fail and the tooling won’t run.(npmpeer.dev) Compounding that, the package is in maintenance mode and only supports Vue 2.6 or earlier with no Vite 5-ready release, so we either keep this example on Vite 4 or migrate it to Vue 2.7 plus @vitejs/plugin-vue2
before bumping Vite.(npm.io)
🤖 Prompt for AI Agents
In examples/vue/2.6-basic/package.json around lines 17-19, Vite was bumped to
^5.4.20 but the project still depends on vite-plugin-vue2@2.0.3 which only
supports vite ^2 || ^3 and is not Vite 5 compatible; fix by either (A) pinning
Vite to a Vite-4-compatible version (e.g., ^4.x) so the existing
vite-plugin-vue2 remains valid, or (B) migrate the example to Vue 2.7 and
replace vite-plugin-vue2 with a Vite-5-compatible plugin (e.g.,
@vitejs/plugin-vue2), update package.json and any plugin-related config/code,
then run npm install and smoke-test the dev/build to ensure tooling works.
"vite": "^5.4.20", | ||
"vite-plugin-vue2": "2.0.3" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Vite 5 breaks the current Vue 2 build
Line 17 upgrades Vite to ^5.4.20, but the example still depends on vite-plugin-vue2@2.0.3
, whose peer dependency caps Vite at ^3.x; npm install
/pnpm install
will dead-stop with an ERESOLVE failure and the dev server won’t start.(npmpeer.dev) To land Vite 5 you need to swap over to the maintained @vitejs/plugin-vue2
(and update the config imports), because its peer range now covers Vite ^5 alongside Vue 2.7.(github.com)
- "vite": "^5.4.20",
- "vite-plugin-vue2": "2.0.3"
+ "vite": "^5.4.20",
+ "@vitejs/plugin-vue2": "^2.3.3"
📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
"vite": "^5.4.20", | |
"vite-plugin-vue2": "2.0.3" | |
"vite": "^5.4.20", | |
"@vitejs/plugin-vue2": "^2.3.3" |
🤖 Prompt for AI Agents
In examples/vue/2.7-basic/package.json around lines 17-18, the project declares
"vite": "^5.4.20" but still depends on "vite-plugin-vue2": "2.0.3", which has a
peer range limited to Vite ^3 and causes ERESOLVE; replace "vite-plugin-vue2"
with the maintained "@vitejs/plugin-vue2" (use a current compatible version) in
package.json, run install to update lockfile, and then update any Vite
config/imports (e.g., vite.config.js or vite.config.ts) to import and use the
plugin from "@vitejs/plugin-vue2" instead of "vite-plugin-vue2" so the example
works with Vite 5.
42e2d9c
to
8d1bd64
Compare
8d1bd64
to
d00a37c
Compare
d00a37c
to
f89407a
Compare
f89407a
to
b66ddd4
Compare
b66ddd4
to
ed605e7
Compare
ed605e7
to
78144d3
Compare
78144d3
to
ec9eec7
Compare
ec9eec7
to
01758f7
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
♻️ Duplicate comments (1)
examples/vue/2.6-basic/package.json (1)
18-20
: Blocker: vite-plugin-vue2 is incompatible with Vite 5+ here; install/build will breakThis example bumps Vite to ^5.4.20 but keeps vite-plugin-vue2@2.0.3 (for Vue 2.6). That plugin’s peer range targets older Vite, so the toolchain won’t resolve or run. Either revert Vite here or migrate the example to Vue 2.7 + @vitejs/plugin-vue2 before taking Vite ≥5.
Minimal safe fix (Option A: keep Vue 2.6):
"devDependencies": { "typescript": "5.8.3", - "vite": "^5.4.20", + "vite": "^4.5.14", "vite-plugin-vue2": "2.0.3" }Preferred fix (Option B: upgrade path):
- Move to Vue 2.7.x and align vue-template-compiler to the same 2.7.x.
- Drop @vue/composition-api (built into 2.7).
- Replace vite-plugin-vue2 with @vitejs/plugin-vue2 and then bump Vite to the target version (see next comment).
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
examples/vue/2.6-basic/package.json
(1 hunks)examples/vue/2.7-basic/package.json
(1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
- examples/vue/2.7-basic/package.json
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
- GitHub Check: Test
01758f7
to
ac77791
Compare
ac77791
to
7656f1b
Compare
7656f1b
to
c7a415a
Compare
c7a415a
to
361850d
Compare
361850d
to
089cc11
Compare
089cc11
to
f36aca1
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
♻️ Duplicate comments (2)
examples/vue/2.6-basic/package.json (1)
16-20
: Vite 5 + vite-plugin-vue2@2.0.3 is incompatible; install will failThis example is on Vue 2.6.14 and uses vite-plugin-vue2@2.0.3, which doesn’t support Vite 5. Keeping this as-is will ERESOLVE and the dev server won’t start. Options:
- Option A (minimal): keep Vue 2.6 and revert Vite to a Vite 4 line.
- Option B (upgrade path): migrate to Vue 2.7 and switch to the maintained @vitejs/plugin-vue2, then you can move to newer Vite.
Option A diff (revert vite here):
"devDependencies": { "typescript": "5.8.3", - "vite": "^5.4.20", + "vite": "^4.5.14", "vite-plugin-vue2": "2.0.3" }Option B diff (migrate the example to 2.7 + official plugin, enabling newer Vite):
"dependencies": { - "@vue/composition-api": "1.7.2", - "vue": "2.6.14", - "vue-template-compiler": "2.6.14" + "vue": "2.7.16", + "vue-template-compiler": "2.7.16" }, "devDependencies": { "typescript": "5.8.3", - "vite": "^5.4.20", - "vite-plugin-vue2": "2.0.3" + "vite": "^5.4.20", + "@vitejs/plugin-vue2": "^2.x" }Run to confirm peer ranges and engines before choosing a path:
#!/bin/bash set -euo pipefail echo "vite-plugin-vue2@2.0.3 peer deps:"; npm view vite-plugin-vue2@2.0.3 peerDependencies --json echo "Official @vitejs/plugin-vue2 latest peer deps:"; npm view @vitejs/plugin-vue2 peerDependencies --json echo "Vite engines:"; npm view vite@5.4.20 engines --json; npm view vite@7.1.7 engines --json || true echo "Does TypeScript 5.8.3 exist?"; npm view typescript@5.8.3 version || echo "Not found"examples/vue/2.7-basic/package.json (1)
15-19
: Swap to @vitejs/plugin-vue2 for Vue 2.7; vite-plugin-vue2 blocks Vite 5With Vue 2.7.16 you should use @vitejs/plugin-vue2, which supports newer Vite. Keeping vite-plugin-vue2@2.0.3 will break installs and dev. Apply this minimal fix, and update vite.config to import/use the new plugin.
"devDependencies": { "typescript": "5.8.3", - "vite": "^5.4.20", - "vite-plugin-vue2": "2.0.3" + "vite": "^5.4.20", + "@vitejs/plugin-vue2": "^2.x" }If the PR intends Vite 7, bump vite to ^7.1.7 after confirming the plugin’s peer range.
#!/bin/bash set -euo pipefail npm view @vitejs/plugin-vue2 peerDependencies --json npm view vite@7.1.7 engines --json || true
🧹 Nitpick comments (2)
examples/vue/2.6-basic/package.json (1)
16-20
: PR scope mismatch: PR title targets Vite 7.1.7, file bumps only to 5.4.20Please either complete this example’s migration (Vue 2.7 + @vitejs/plugin-vue2) and move to Vite ^7.1.7, or explicitly exclude 2.6-basic from the V7 upgrade in Renovate and keep it on a compatible Vite line.
examples/vue/2.7-basic/package.json (1)
15-19
: Align with PR objective (Vite 7.1.7) or adjust Renovate scopeEither upgrade this example to Vite ^7.1.7 (after switching to @vitejs/plugin-vue2 and updating vite.config), or leave it on a patched line and update PR scope accordingly.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
examples/vue/2.6-basic/package.json
(1 hunks)examples/vue/2.7-basic/package.json
(1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
- GitHub Check: Test
🔇 Additional comments (2)
examples/vue/2.7-basic/package.json (1)
15-17
: TypeScript 5.8.3 Pin Verified Confirmed TypeScript 5.8.3 is available on npm; no changes required.examples/vue/2.6-basic/package.json (1)
16-18
: TypeScript version pin is valid: 5.8.3 is published on npm, so the existing pin will install successfully.
This PR contains the following updates:
^4.5.14
->^5.4.20
Warning
Some dependencies could not be looked up. Check the Dependency Dashboard for more information.
GitHub Vulnerability Alerts
CVE-2025-58752
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:
appType: 'spa'
(default) orappType: 'mpa'
is usedThis 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:
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:
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.
CVE-2025-58751
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:
server.host
config option)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:
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
Release Notes
vitejs/vite (vite)
v5.4.20
Compare Source
Please refer to CHANGELOG.md for details.
v5.4.19
Compare Source
Please refer to CHANGELOG.md for details.
v5.4.18
Compare Source
Please refer to CHANGELOG.md for details.
v5.4.17
Compare Source
Please refer to CHANGELOG.md for details.
v5.4.16
Compare Source
Please refer to CHANGELOG.md for details.
v5.4.15
Compare Source
Please refer to CHANGELOG.md for details.
v5.4.14
Compare Source
Please refer to CHANGELOG.md for details.
v5.4.13
Compare Source
Please refer to CHANGELOG.md for details.
v5.4.12
Compare Source
This version contains a breaking change due to security fixes. See GHSA-vg6x-rcgg-rjx6 for more details.
Please refer to CHANGELOG.md for details.
v5.4.11
Compare Source
Today, we're taking another big step in Vite's story. The Vite team, contributors, and ecosystem partners are excited to announce the release of the next Vite major:
We want to thank the more than 1K contributors to Vite Core and the maintainers and contributors of Vite plugins, integrations, tools, and translations that have helped us craft this new major. We invite you to get involved and help us improve Vite for the whole ecosystem. Learn more at our Contributing Guide.
⚠ BREAKING CHANGES
file://
resolution (#18422)build.cssMinify
to'esbuild'
for SSR (#15637)json.stringify: 'auto'
and make that the default (#18303)fast-glob
totinyglobby
(#18243)Features
module-sync
condition when loading config if enabled (#18650) (cf5028d)isSsrTargetWebWorker
flag toconfigEnvironment
hook (#18620) (3f5fab0)ssr.resolve.mainFields
option (#18646) (a6f5f5b)platform
option (#18611) (0924879)?inline
and?no-inline
queries to control inlining (#15454) (9162172)vite-ignore
attribute to opt-out of processing (#18494) (d951310)file://
resolution (#18422) (6a7e313)console
increateLogger
(#18379) (0c497d9)sec-fetch-dest
header to detect JS in transform (#9981) (e51dc40)json.stringify: 'auto'
and make that the default (#18303) (b80daa7)environment::listen
(#18263) (4d5f51d)this.environment
inoptions
andonLog
hook (#18142) (7722c06)EnvironmentOptions
type (#18080) (35cf59c)Bug Fixes
createRunnableDevEnvironment
returnsRunnableDevEnvironment
, notDevEnvironment
(#18673) (74221c3)getModulesByFile
should return aserverModule
(#18715) (b80d5ec)SIGTERM
(#18741) (cc55e36)InterceptorOptions
type (#18766) (6252c60)__vite_ssr_identity__
with(0, ...)
and inject;
between statements (#18748) (94546be)rollup.external
scripts correctly (#18618) (55461b4)ssrTransform
parse error (#18644) (d9be921)consumer: 'server'
(#18575) (87b2347)server.perEnvironmentStartEndDuringDev
(#18549) (fe30349)optimizeDeps.include
for SSR (#18506) (826c81a)new URL(,import.meta.url)
match (#18194) (5286a90)cssCodeSplit
uses the current environment configuration (#18486) (eefe895)json.stringify
arrays (#18541) (fa50b03)[@import](https://redirect.github.com/import) url(...)
(#17857) (aec5fdd)define
in environment config was not working (#18515) (052799e)cssCodeSplit
inenvironments.xxx.build
is invalid (#18464) (993e71c)CSSOptions.preprocessorOptions
(#18001) (7eeb6f2)build.cssMinify
to'esbuild'
for SSR (#15637) (f1d3bf7)--watch
should not overridebuild.watch
options (#18390) (b2965c8)open
dependency to 10.1.0 (#18349) (5cca4bf)this
in exported function should beundefined
(#18329) (bae6a37)output.format
withworker.format
on worker build error (#18165) (dc82334)injectQuery
double encoding (#18246) (2c5f948)conditions
and more (#18302) (2017a33)defineConfig
(#18299) (94e34cf)this.hot.close
for non-ws HotChannel (#18212) (bad0ccc)data:
(#18241) (ec0efe8)sharedPlugins
(#18214) (34041b9)webCompatible
(#18221) (a44b0a2)HMRConnection.send
on implementation side (#18186) (9470011)config.consumer
instead ofoptions?.ssr
/config.build.ssr
(#18140) (21ec1ce)getRelativeUrlFromDocument
(#18115) (ade1d89)script module
in svelte (#18063) (7d699aa)preload-helper
has no side effects (#18057) (587ad7b)ssrModule
andssrError
(#18031) (cf8ced5)Performance Improvements
Object.keys(import.meta.glob(...))
/Object.values(import.meta.glob(...))
(#18666) (ed99a2c)module.enableCompileCache()
(#18323) (18f1dad)crypto.hash
when available (#18317) (2a14884)Documentation
HotUpdateContext
toHotUpdateOptions
(#18718) (824c347)Reverts
Miscellaneous Chores
/
mapping inresolve.alias
(#18588) (a51c254)ssr
variable (#18594) (23c39fc)fast-glob
totinyglobby
(#18243) (6f74a3a)Configuration
📅 Schedule: Branch creation - "" (UTC), Automerge - At any time (no schedule defined).
🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻ Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about this update again.
This PR was generated by Mend Renovate. View the repository job log.