Skip to content

fix(deps): upgrade vite to 5.4.21 to fix dev server arbitrary file read - #3291

Open
leizhiyuan wants to merge 1 commit into
alibaba:masterfrom
leizhiyuan:fix/vite-dev-server-cve
Open

leizhiyuan wants to merge 1 commit into
alibaba:masterfrom
leizhiyuan:fix/vite-dev-server-cve

Conversation

@leizhiyuan

@leizhiyuan leizhiyuan commented Nov 9, 2026 •

Copy link
Copy Markdown
Contributor

Fixes #3290.

What

Every vite copy in the repository is moved to 5.4.21, which fixes the dev-server server.fs.deny bypasses CVE-2025-30208, CVE-2025-31125, CVE-2025-31486 (fixed in 4.5.12 / 5.4.17) as well as CVE-2025-32395, CVE-2025-46565, CVE-2025-58751, CVE-2025-58752 and CVE-2025-62522 (fixed in 4.5.13 / 4.5.14 / 5.4.20 / 5.4.21). The 3.x line has no patched release, so 3.0.9 cannot stay.

Component Before After
web-ui/arthasWebConsole vite 2.9.15, @vitejs/plugin-vue 2.3.4 vite 5.4.21, @vitejs/plugin-vue 5.2.4
site (via vuepress @vuepress/bundler-vite) vite 3.0.9 vite 5.4.21 (yarn resolutions)
labs/arthas-jfr-frontend vite 5.4.19 vite 5.4.21
frontend build node (web-ui/pom.xml, site/pom.xml) v16 v20.19.0

Changes worth a look:

  • web-ui/arthasWebConsole/vite.config.ts: vue({ reactivityTransform: ... }) was a no-op with a bogus value and @vitejs/plugin-vue 5 no longer has that option; the option is dropped and the project does not use ref sugar ($ref/$computed).
  • site/package.json: vuepress 2.0.0-beta.51 pins vite ~3.0.9. No vuepress release depends on a patched vite (2.0.0-beta.67 is still on ~4.4.9), so resolutions: { "vite": "^5.4.21" } is used until vuepress is upgraded to 2.0.0-rc.x. This is documented in site/README.md.
  • site/package-lock.json is deleted: the Maven build installs with yarn (yarn.lock, reproducible via yarn install --frozen-lockfile), nothing in CI or the poms uses npm for site, and the npm lockfile is stale (last regenerated 2022-09, lockfileVersion 2) and already broken — npm ci fails on Missing: @esbuild/linux-loong64@0.15.5 from lock file. Keeping it only leaves a second source of truth that still pins vite 3.0.9 for dependency scanners. It can be restored from git history (git checkout 6d97217ed -- site/package-lock.json) if needed.
  • site/pom.xml / web-ui/pom.xml: node v16 → v20.19.0, required because vite 5 needs node >= 18.
  • labs/arthas-jfr-frontend/package-lock.json: besides the vite bump, npm re-synced the lockfile with the devDependencies it was missing (@vitejs/plugin-react and its babel deps).

Verification

  • mvn -pl web-ui,site -am generate-resources → both frontends build (node v20.19.0, vite 5.4.21, 156 docs pages rendered).
  • yarn install --frozen-lockfile passes in both yarn projects.
  • Dev-server PoC, before and after:
Request vite 2.9.15 / 3.0.9 after (5.4.21)
/@fs/etc/passwd?raw?? 200 + file content 403 outside of Vite serving allow list
/@fs/etc/passwd?import&raw?? 200 + file content 403
/@fs/etc/passwd?inline&raw?? 200 + file content 403
  • vuepress dev docs and vite --mode ui both still serve the pages (HTTP 200) on 5.4.21.

Follow-ups (not in this PR)

  • Migrate the docs site to vuepress 2.0.0-rc.x (vite 8 / node >= 22.18) and drop the resolutions override.
  • web-ui loads its TS config through vite's CJS Node API, which is deprecated; renaming the config to vite.config.mts would silence it, but that is unrelated to the CVE.

@CLAassistant

CLAassistant commented Nov 9, 2026 •

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

The vite dev server serves files outside the project root through
`?raw??`, `?import&raw??` and `?inline&raw??` queries when exposed to the
network: CVE-2025-30208, CVE-2025-31125, CVE-2025-31486, plus the later
fixes on the same code path (CVE-2025-32395, CVE-2025-46565,
CVE-2025-58751, CVE-2025-58752, CVE-2025-62522). The patched 3.x line has
no release, so anything below 4.5.12 is affected.

- web-ui: vite 2.9.15 -> 5.4.21, @vitejs/plugin-vue 2.3.4 -> 5.2.4 and drop
  the removed `reactivityTransform` option. Bump the build node to v20.19.0
  because vite 5 requires node >= 18.
- site: vuepress 2.0.0-beta.51 pins vite ~3.0.9 and vuepress has no release
  that depends on a patched vite, so force 5.4.21 through yarn
  `resolutions`, and bump the build node to v20.19.0. Remove the stale
  site/package-lock.json: the Maven build uses yarn, and the npm lockfile
  can no longer be regenerated (peer conflicts) while still pinning the
  vulnerable vite 3.0.9.
- labs/arthas-jfr-frontend: vite 5.4.19 -> 5.4.21, as 5.4.19 is still
  affected by CVE-2025-58751/58752 and CVE-2025-62522. The lockfile also
  gains the devDependencies it was missing (@vitejs/plugin-react).

Verified with `mvn -pl web-ui,site -am generate-resources` (both frontends
build on node v20.19.0) and by running both dev servers: requests such as
`/@fs/etc/passwd?raw??` now return 403 instead of the file content, which
is what vite 2.9.15 and 3.0.9 returned before the upgrade.
@leizhiyuan
leizhiyuan force-pushed the fix/vite-dev-server-cve branch from b75d726 to 072ba99 Compare November 9, 2026 07:51

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Security] vite dev server arbitrary file read (CVE-2025-30208 / CVE-2025-31125 / CVE-2025-31486) in web-ui and docs site

2 participants