Skip to content

Conversation

renovate[bot]
Copy link
Contributor

@renovate renovate bot commented Sep 10, 2025

Coming soon: The Renovate bot (GitHub App) will be renamed to Mend. PRs from Renovate will soon appear from 'Mend'. Learn more here.

This PR contains the following updates:

Package Change Age Confidence
vite (source) ^4.5.3 -> ^4.5.14 age confidence

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:

  • explicitly exposes the Vite dev server to the network (using --host or server.host config option)
  • appType: 'spa' (default) or appType: '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.

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:

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


Release Notes

vitejs/vite (vite)

v4.5.14

Compare Source

Please refer to CHANGELOG.md for details.

v4.5.13

Compare Source

Please refer to CHANGELOG.md for details.

v4.5.12

Compare Source

Please refer to CHANGELOG.md for details.

v4.5.11

Compare Source

Please refer to CHANGELOG.md for details.

v4.5.10

Compare Source

Please refer to CHANGELOG.md for details.

v4.5.9

Compare Source

Please refer to CHANGELOG.md for details.

v4.5.8

Compare Source

Please refer to CHANGELOG.md for details.

v4.5.7

Compare Source

Please refer to CHANGELOG.md for details.

v4.5.6

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.

v4.5.5

Compare Source

Please refer to CHANGELOG.md for details.


Configuration

📅 Schedule: Branch creation - "" (UTC), Automerge - At any time (no schedule defined).

🚦 Automerge: Enabled.

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.


  • If you want to rebase/retry this PR, check this box

This PR was generated by Mend Renovate. View the repository job log.

Summary by CodeRabbit

  • Chores
    • Updated Vite build tooling in Vue 2.x example projects to a newer patch release for improved stability and compatibility.
    • No user-facing changes; behavior, configuration, and public APIs remain unchanged.

@renovate renovate bot added the dependencies Pull requests that update a dependency file label Sep 10, 2025
Copy link
Contributor

coderabbitai bot commented Sep 10, 2025

Walkthrough

Updated devDependency vite from ^4.5.3 to ^4.5.14 in two Vue example package.json files (examples/vue/2.6-basic and examples/vue/2.7-basic). No other fields, control flow, or exported/public declarations were modified.

Changes

Cohort / File(s) Summary
Vue example packages
examples/vue/2.6-basic/package.json, examples/vue/2.7-basic/package.json
Bumped devDependency vite from ^4.5.3 to ^4.5.14; no other changes.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

I nibble at versions late at night,
A little hop, a tiny flight,
Two examples wake, their dev servers hum,
I twitch my whiskers — updates come. 🐇✨

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Description Check ⚠️ Warning The pull request description does not follow the repository’s required template headings and sections, as it lacks the “## 🎯 Changes”, “## ✅ Checklist”, and “## 🚀 Release Impact” sections and does not include the specific summary and checklist items mandated by the template. Please restructure the description to include the “## 🎯 Changes” section summarizing the updates, the “## ✅ Checklist” with the contributing and testing steps, and the “## 🚀 Release Impact” section indicating any release-related artifacts or documentation.
✅ Passed checks (2 passed)
Check name Status Explanation
Title Check ✅ Passed The title clearly and concisely describes the primary change of updating the Vite dependency to version ^4.5.14 with a security focus, matching the changes in both example projects without extraneous details.
Docstring Coverage ✅ Passed No functions found in the changes. Docstring coverage check skipped.
✨ Finishing touches
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch renovate/npm-vite-vulnerability

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 1c2b523 and cddcf39.

📒 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.6-basic/package.json

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

nx-cloud bot commented Sep 10, 2025

View your CI Pipeline Execution ↗ for commit cddcf39

Command Status Duration Result
nx affected --targets=test:sherif,test:knip,tes... ✅ Succeeded 27s View ↗
nx run-many --target=build --exclude=examples/*... ✅ Succeeded 1s View ↗

☁️ Nx Cloud last updated this comment at 2025-09-27 02:54:49 UTC

Copy link
Contributor

@coderabbitai coderabbitai bot left a 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

🧹 Nitpick comments (1)
examples/vue/2.6-basic/package.json (1)

16-20: Upgrade to ^5.4.20 acknowledged; align environment constraints.

  • Good with the bump.
  • This example already has "type": "module"; suggest mirroring Node constraint for Vite 5.

Apply engines (optional):

 {
   "name": "@tanstack/query-example-vue-2.6-basic",
   "private": true,
   "type": "module",
+  "engines": {
+    "node": ">=18.0.0"
+  },
   "scripts": {
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between ccedf33 and 9d5bace.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 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). (2)
  • GitHub Check: Preview
  • GitHub Check: Test
🔇 Additional comments (1)
examples/vue/2.7-basic/package.json (1)

15-19: Vite bump to ^5.4.20 looks fine for Vue 2 examples.

No breaking changes here; good to keep examples current.

@renovate renovate bot force-pushed the renovate/npm-vite-vulnerability branch 2 times, most recently from faeb6b4 to 2776998 Compare September 10, 2025 17:14
Copy link
Contributor

@coderabbitai coderabbitai bot left a 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

📥 Commits

Reviewing files that changed from the base of the PR and between faeb6b4 and 2776998.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 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

Comment on lines 15 to 19
"devDependencies": {
"typescript": "5.8.3",
"vite": "^4.5.3",
"vite": "^5.4.20",
"vite-plugin-vue2": "2.0.3"
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Switch from deprecated vite-plugin-vue2 to @vitejs/plugin-vue2; ensure compatibility with Vite ≥5 (optionally bump to 6.3.6) and Node ≥18.

  • vite-plugin-vue2@2.0.3 is archived/EOL and targets Vue ≤2.6; it doesn’t declare support for Vite 5. Use the official @vitejs/plugin-vue2 for Vue 2.7, which added Vite 6 support in v2.3.3. Also, Vite 5 requires Node 18+. (github.com, gitlab.com)

Apply this minimal replacement within devDependencies:

 "devDependencies": {
   "typescript": "5.8.3",
-  "vite": "^5.4.20",
-  "vite-plugin-vue2": "2.0.3"
+  "vite": "^5.4.20",
+  "@vitejs/plugin-vue2": "^2.3.3"
 }

Optionally align to the security-fixed Vite 6 line (plugin supports it):

-  "vite": "^5.4.20",
+  "vite": "^6.3.6",

Add a Node engines constraint (outside this hunk) to avoid local-env drift:

"engines": { "node": ">=18.0.0" }
🤖 Prompt for AI Agents
In examples/vue/2.7-basic/package.json around lines 15-19, replace the
deprecated "vite-plugin-vue2": "2.0.3" with the official "@vitejs/plugin-vue2"
(use a release >=2.3.3 to ensure Vite 6 compatibility); optionally bump "vite"
to a secure 6.x line (e.g., ^6.3.6) to align with the plugin, and update
devDependencies accordingly; also add an "engines": {"node": ">=18.0.0"} field
elsewhere in package.json to require Node 18+.

@renovate renovate bot force-pushed the renovate/npm-vite-vulnerability branch 15 times, most recently from b556814 to a3a49fd Compare September 18, 2025 21:59
@renovate renovate bot force-pushed the renovate/npm-vite-vulnerability branch 8 times, most recently from 04283cc to 80a0c22 Compare September 21, 2025 13:31
@renovate renovate bot changed the title chore(deps): update dependency vite to ^4.5.14 [security] chore(deps): update dependency vite to v5 [security] Sep 25, 2025
Copy link
Contributor

@coderabbitai coderabbitai bot left a 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

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between dd9c839 and 8151c7a.

📒 Files selected for processing (2)
  • examples/vue/2.6-basic/package.json (1 hunks)
  • examples/vue/2.7-basic/package.json (1 hunks)
🔇 Additional comments (2)
examples/vue/2.7-basic/package.json (1)

15-19: Switch from archived vite-plugin-vue2 to @vitejs/plugin-vue2 for Vue 2.7 + Vite 5.

vite-plugin-vue2@2.0.3 is archived and not maintained. For Vue 2.7 with Vite 5, use the official @vitejs/plugin-vue2.

Apply this diff:

   "devDependencies": {
     "typescript": "5.8.3",
-    "vite": "^5.4.20",
-    "vite-plugin-vue2": "2.0.3"
+    "vite": "^5.4.20",
+    "@vitejs/plugin-vue2": "^2.3.3"
   }

Optionally add Node engine constraint (top-level) since Vite 5 requires Node >=18:

"engines": { "node": ">=18.0.0" }
examples/vue/2.6-basic/package.json (1)

18-18: Vite 5 is incompatible with Vue 2.6 + vite-plugin-vue2@2.0.3 — pin to Vite 4.5.14.

vite-plugin-vue2@2.0.3 doesn’t support Vite 5; this example will break. Pinning to 4.5.14 both preserves compatibility and picks up the security fix.

Apply this diff:

-    "vite": "^5.4.20",
+    "vite": "^4.5.14",

Alternative (if you choose to modernize): bump to Vue 2.7 and swap to @vitejs/plugin-vue2, then Vite ^5 (or ^6) is fine.

"devDependencies": {
"typescript": "5.8.3",
"vite": "^4.5.3",
"vite": "^5.4.20",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical

🧩 Analysis chain

PR intent mismatch: Title targets Vite ^4.5.14 (security), but this sets ^5.4.20. Confirm scope.

If upgrading beyond 4.5.x is intentional, please confirm it addresses the referenced CVEs for Vite 5 as well.


🌐 Web query:

Does Vite 5.4.20 include the fixes for CVE-2025-58751 and CVE-2025-58752 that were patched in Vite 4.5.14?

💡 Result:

Yes. The GitHub advisories and CVE entries show both CVE-2025-58751 and CVE-2025-58752 are fixed in Vite 5.4.20. [1][2][3]

Sources:


Align PR title with Vite upgrade
Vite 5.4.20 already fixes CVE-2025-58751 and CVE-2025-58752, but the PR title still references ^4.5.14. Update the title/description to reflect the upgrade to v5.4.20.

🤖 Prompt for AI Agents
In examples/vue/2.7-basic/package.json around line 17, the PR metadata still
references Vite ^4.5.14 while the dependency has been upgraded to "vite":
"^5.4.20"; update the PR title and description to mention the Vite upgrade to
v5.4.20 and that this release addresses CVE-2025-58751 and CVE-2025-58752 so the
PR text accurately reflects the new version and fixed vulnerabilities.

@renovate renovate bot force-pushed the renovate/npm-vite-vulnerability branch from 8151c7a to 68be769 Compare September 26, 2025 07:34
@renovate renovate bot changed the title chore(deps): update dependency vite to v5 [security] chore(deps): update dependency vite to ^4.5.14 [security] Sep 26, 2025
@renovate renovate bot force-pushed the renovate/npm-vite-vulnerability branch from 68be769 to 648f933 Compare September 26, 2025 08:33
Copy link

changeset-bot bot commented Sep 26, 2025

⚠️ No Changeset found

Latest commit: cddcf39

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@renovate renovate bot changed the title chore(deps): update dependency vite to ^4.5.14 [security] chore(deps): update dependency vite to v5 [security] Sep 26, 2025
@renovate renovate bot force-pushed the renovate/npm-vite-vulnerability branch from 648f933 to 35cfa6f Compare September 26, 2025 09:58
@renovate renovate bot changed the title chore(deps): update dependency vite to v5 [security] chore(deps): update dependency vite to ^4.5.14 [security] Sep 26, 2025
@renovate renovate bot force-pushed the renovate/npm-vite-vulnerability branch from 35cfa6f to c6a2315 Compare September 26, 2025 10:17
@renovate renovate bot changed the title chore(deps): update dependency vite to ^4.5.14 [security] chore(deps): update dependency vite to v5 [security] Sep 26, 2025
@renovate renovate bot force-pushed the renovate/npm-vite-vulnerability branch from c6a2315 to 1a3e15d Compare September 26, 2025 12:04
@renovate renovate bot changed the title chore(deps): update dependency vite to v5 [security] chore(deps): update dependency vite to ^4.5.14 [security] Sep 26, 2025
@renovate renovate bot force-pushed the renovate/npm-vite-vulnerability branch 3 times, most recently from 5b3fba6 to 9994638 Compare September 26, 2025 13:14
@renovate renovate bot changed the title chore(deps): update dependency vite to ^4.5.14 [security] chore(deps): update dependency vite to v5 [security] Sep 26, 2025
@renovate renovate bot force-pushed the renovate/npm-vite-vulnerability branch from 9994638 to 1c853e8 Compare September 27, 2025 02:33
@renovate renovate bot changed the title chore(deps): update dependency vite to v5 [security] chore(deps): update dependency vite to ^4.5.14 [security] Sep 27, 2025
@renovate renovate bot force-pushed the renovate/npm-vite-vulnerability branch from 1c853e8 to 1c2b523 Compare September 27, 2025 02:38
@renovate renovate bot changed the title chore(deps): update dependency vite to ^4.5.14 [security] chore(deps): update dependency vite to v5 [security] Sep 27, 2025
Copy link
Contributor

@coderabbitai coderabbitai bot left a 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

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 1c853e8 and 1c2b523.

📒 Files selected for processing (2)
  • examples/vue/2.6-basic/package.json (1 hunks)
  • examples/vue/2.7-basic/package.json (1 hunks)
🔇 Additional comments (1)
examples/vue/2.6-basic/package.json (1)

17-19: Restore Vite 4 for the Vue 2.6 example

vite-plugin-vue2@2.0.3 only peers against Vite ^2 || ^3 and breaks on Vite 5 (install warnings escalate to runtime failures because the dev server no longer wires the legacy Vue 2 compiler hooks). Please keep this example on the patched 4.x line (^4.5.14) rather than jumping to 5.x.

   "devDependencies": {
     "typescript": "5.8.3",
-    "vite": "^5.4.20",
+    "vite": "^4.5.14",
     "vite-plugin-vue2": "2.0.3"
   }

@renovate renovate bot force-pushed the renovate/npm-vite-vulnerability branch from 1c2b523 to cddcf39 Compare September 27, 2025 02:53
@renovate renovate bot changed the title chore(deps): update dependency vite to v5 [security] chore(deps): update dependency vite to ^4.5.14 [security] Sep 27, 2025
@lachlancollins lachlancollins merged commit b01be85 into main Sep 27, 2025
7 checks passed
@lachlancollins lachlancollins deleted the renovate/npm-vite-vulnerability branch September 27, 2025 02:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies Pull requests that update a dependency file
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant