Skip to content

fix(devdeps): update dependency vite to v6.4.1 [security]#424

Merged
ryanbas21 merged 1 commit into
mainfrom
renovate/npm-vite-vulnerability
Oct 22, 2025
Merged

fix(devdeps): update dependency vite to v6.4.1 [security]#424
ryanbas21 merged 1 commit into
mainfrom
renovate/npm-vite-vulnerability

Conversation

@renovate
Copy link
Copy Markdown
Contributor

@renovate renovate Bot commented Sep 29, 2025

This PR contains the following updates:

Package Change Age Confidence
vite (source) 6.3.4 -> 6.4.1 age confidence
vite (source) 6.3.6 -> 6.4.1 age confidence

GitHub Vulnerability Alerts

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

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-62522

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.host config 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
image

Release Notes

vitejs/vite (vite)

v6.4.1

Compare Source

Please refer to CHANGELOG.md for details.

v6.4.0

Compare Source

Please refer to CHANGELOG.md for details.

v6.3.7

Compare Source

Please refer to CHANGELOG.md for details.

v6.3.6

Compare Source

Please refer to CHANGELOG.md for details.

v6.3.5

Compare Source

Vite 7 is out!

Today, we're excited to announce the release of the next Vite major:

⚠ BREAKING CHANGES
  • ssr: don't access Object variable in ssr transformed code (#​19996)
  • remove experimental.skipSsrTransform option (#​20038)
  • remove HotBroadcaster (#​19988)
  • css: always use sass compiler API (#​19978)
  • bump build.target and name it baseline-widely-available (#​20007)
  • bump required node version to 20.19+, 22.12+ and remove cjs build (#​20032)
  • css: remove sass legacy API support (#​19977)
  • remove deprecated HotBroadcaster related types (#​19987)
  • remove deprecated no-op type only properties (#​19985)
  • remove node 18 support (#​19972)
  • remove deprecated hook-level enforce/transform from transformIndexHtml hook (#​19349)
  • remove deprecated splitVendorChunkPlugin (#​19255)
Features
Bug Fixes
Performance Improvements
Documentation
Miscellaneous Chores
Code Refactoring
Tests
Continuous Integration
Beta Changelogs
7.0.0-beta.2 (2025-06-17)

See 7.0.0-beta.2 changelog

7.0.0-beta.1 (2025-06-10)

See 7.0.0-beta.1 changelog

7.0.0-beta.0 (2025-06-02)

See 7.0.0-beta.0 changelog


Configuration

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

🚦 Automerge: Enabled.

Rebasing: Whenever PR is behind base branch, or you tick the rebase/retry checkbox.

🔕 Ignore: Close this PR and you won't be reminded about these updates again.


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

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

@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented Sep 29, 2025

⚠️ No Changeset found

Latest commit: ba3c30e

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

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Sep 29, 2025

Important

Review skipped

Bot user detected.

To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.


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

@nx-cloud
Copy link
Copy Markdown
Contributor

nx-cloud Bot commented Sep 29, 2025

View your CI Pipeline Execution ↗ for commit ba3c30e

Command Status Duration Result
nx run-many -t build ✅ Succeeded <1s View ↗
nx affected -t build typecheck lint test e2e-ci ✅ Succeeded 1m 47s View ↗
nx-cloud record -- nx format:check ✅ Succeeded 1s View ↗

☁️ Nx Cloud last updated this comment at 2025-10-22 14:14:14 UTC

nx-cloud[bot]

This comment was marked as outdated.

@renovate renovate Bot force-pushed the renovate/npm-vite-vulnerability branch from 553069a to 24b6737 Compare September 30, 2025 15:16
nx-cloud[bot]

This comment was marked as outdated.

@renovate renovate Bot force-pushed the renovate/npm-vite-vulnerability branch from 24b6737 to 55b730a Compare September 30, 2025 20:17
nx-cloud[bot]

This comment was marked as outdated.

@renovate renovate Bot force-pushed the renovate/npm-vite-vulnerability branch from 55b730a to 7daf7cb Compare October 2, 2025 19:05
nx-cloud[bot]

This comment was marked as outdated.

@renovate renovate Bot force-pushed the renovate/npm-vite-vulnerability branch from 7daf7cb to e1f0996 Compare October 20, 2025 15:30
nx-cloud[bot]

This comment was marked as outdated.

@renovate renovate Bot force-pushed the renovate/npm-vite-vulnerability branch from e1f0996 to f35d3b4 Compare October 20, 2025 15:47
nx-cloud[bot]

This comment was marked as outdated.

@renovate renovate Bot force-pushed the renovate/npm-vite-vulnerability branch from f35d3b4 to 3b9da9d Compare October 21, 2025 01:49
@renovate renovate Bot changed the title fix(devdeps): update dependency vite to v6.3.6 [security] fix(devdeps): update dependency vite to v6.4.1 [security] Oct 21, 2025
nx-cloud[bot]

This comment was marked as outdated.

@renovate renovate Bot force-pushed the renovate/npm-vite-vulnerability branch from 3b9da9d to fccbcdd Compare October 21, 2025 22:29
@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Oct 21, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 18.75%. Comparing base (073a686) to head (ba3c30e).

❌ Your project status has failed because the head coverage (18.75%) is below the target coverage (40.00%). You can increase the head coverage or adjust the target coverage.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #424   +/-   ##
=======================================
  Coverage   18.75%   18.75%           
=======================================
  Files         138      138           
  Lines       27368    27368           
  Branches      951      951           
=======================================
  Hits         5132     5132           
  Misses      22236    22236           
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new Bot commented Oct 21, 2025

Open in StackBlitz

@forgerock/davinci-client

pnpm add https://pkg.pr.new/ForgeRock/ping-javascript-sdk/@forgerock/davinci-client@424

@forgerock/oidc-client

pnpm add https://pkg.pr.new/ForgeRock/ping-javascript-sdk/@forgerock/oidc-client@424

@forgerock/protect

pnpm add https://pkg.pr.new/ForgeRock/ping-javascript-sdk/@forgerock/protect@424

@forgerock/sdk-types

pnpm add https://pkg.pr.new/ForgeRock/ping-javascript-sdk/@forgerock/sdk-types@424

@forgerock/sdk-utilities

pnpm add https://pkg.pr.new/ForgeRock/ping-javascript-sdk/@forgerock/sdk-utilities@424

@forgerock/iframe-manager

pnpm add https://pkg.pr.new/ForgeRock/ping-javascript-sdk/@forgerock/iframe-manager@424

@forgerock/sdk-logger

pnpm add https://pkg.pr.new/ForgeRock/ping-javascript-sdk/@forgerock/sdk-logger@424

@forgerock/sdk-oidc

pnpm add https://pkg.pr.new/ForgeRock/ping-javascript-sdk/@forgerock/sdk-oidc@424

@forgerock/sdk-request-middleware

pnpm add https://pkg.pr.new/ForgeRock/ping-javascript-sdk/@forgerock/sdk-request-middleware@424

@forgerock/storage

pnpm add https://pkg.pr.new/ForgeRock/ping-javascript-sdk/@forgerock/storage@424

commit: ba3c30e

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Oct 21, 2025

Deployed d7f66d7 to https://ForgeRock.github.io/ping-javascript-sdk/pr-424/d7f66d7f386edff30bbeb6031beb4a95911f4c65 branch gh-pages in ForgeRock/ping-javascript-sdk

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Oct 21, 2025

📦 Bundle Size Analysis

📦 Bundle Size Analysis

🚨 Significant Changes

🔻 @forgerock/journey-client - 0.0 KB (-82.0 KB, -100.0%)

📊 Minor Changes

📈 @forgerock/journey-client - 82.0 KB (+0.0 KB)

➖ No Changes

@forgerock/device-client - 9.2 KB
@forgerock/oidc-client - 23.0 KB
@forgerock/protect - 150.1 KB
@forgerock/sdk-utilities - 7.5 KB
@forgerock/sdk-types - 8.0 KB
@forgerock/storage - 1.4 KB
@forgerock/sdk-logger - 1.6 KB
@forgerock/iframe-manager - 2.4 KB
@forgerock/sdk-request-middleware - 4.4 KB
@forgerock/sdk-oidc - 2.5 KB
@forgerock/davinci-client - 34.5 KB


13 packages analyzed • Baseline from latest main build

Legend

🆕 New package
🔺 Size increased
🔻 Size decreased
➖ No change

ℹ️ How bundle sizes are calculated
  • Current Size: Total gzipped size of all files in the package's dist directory
  • Baseline: Comparison against the latest build from the main branch
  • Files included: All build outputs except source maps and TypeScript build cache
  • Exclusions: .map, .tsbuildinfo, and .d.ts.map files

🔄 Updated automatically on each push to this PR

@renovate renovate Bot force-pushed the renovate/npm-vite-vulnerability branch 2 times, most recently from 6c1ae3e to bcfe2d0 Compare October 22, 2025 13:27
Copy link
Copy Markdown
Contributor

@nx-cloud nx-cloud Bot left a comment

Choose a reason for hiding this comment

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

Nx Cloud has identified a possible root cause for your failed CI:

The PR introduces a security update for Vite (6.3.6 → 6.4.1) and adds immer 10.1.3 to the pnpm catalog. The lint failure occurs in @forgerock/davinci-client:nxLint with the error: "The 'immer' package is not used by '@forgerock/davinci-client' project" at packages/davinci-client/package.json:32:5.

Investigation findings:

  1. The davinci-client package.json line 32 contains: "immer": "catalog:"
  2. Source code analysis shows only one reference to immer: a side-effect import in src/types.ts:6 (import 'immer';) with a comment indicating it's "needed only for getting types in workspace"
  3. Dependency tree analysis (via pnpm list) confirms that immer 10.1.3 is already available as a transitive dependency through @reduxjs/toolkit 2.8.2
  4. The @nx/dependency-checks ESLint rule flags this because there are no direct runtime imports of the immer package beyond the side-effect import

Classification: code_change

The Nx dependency-checks rule is correctly identifying that immer should not be listed as a direct dependency since it's not directly imported/used in the package's code (except for the type side-effect). The package already receives immer through its @reduxjs/toolkit dependency.

The fix involves removing line 32 from packages/davinci-client/package.json ("immer": "catalog:"). The side-effect import in types.ts will continue to function because immer remains available in node_modules through the @reduxjs/toolkit transitive dependency chain. This aligns with best practices: only list packages as direct dependencies when they are directly imported in the source code.

The pnpm-lock.yaml will need to be regenerated after removing the direct dependency, but the immer package will still be present due to the @reduxjs/toolkit dependency, ensuring no functional changes.

A code change would likely not resolve this issue, so no action was taken.

Nx CloudView in Nx Cloud ↗


🎓 To learn more about Self Healing CI, please visit nx.dev

@renovate renovate Bot force-pushed the renovate/npm-vite-vulnerability branch from bcfe2d0 to ba3c30e Compare October 22, 2025 14:10
@ryanbas21 ryanbas21 merged commit 259746b into main Oct 22, 2025
6 checks passed
@ryanbas21 ryanbas21 deleted the renovate/npm-vite-vulnerability branch October 22, 2025 14:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Development

Successfully merging this pull request may close these issues.

2 participants