Skip to content

fix(security): upgrade vite to 5.4.21 with rollup and static-copy fixes#287

Closed
bierlingm wants to merge 3 commits intomain-0.6from
fix/dependabot-vite
Closed

fix(security): upgrade vite to 5.4.21 with rollup and static-copy fixes#287
bierlingm wants to merge 3 commits intomain-0.6from
fix/dependabot-vite

Conversation

@bierlingm
Copy link
Copy Markdown
Collaborator

@bierlingm bierlingm commented Mar 19, 2026

Summary

This PR is the primary security fix — it upgrades vite and companion plugins, AND includes a regenerated lockfile from a clean install that resolves most transitive vulnerabilities.

Direct dependency changes (ui/package.json)

  • vite ^4.3.5 → ^5.4.21
  • @vitejs/plugin-vue ^4.2.3 → ^5.2.4
  • vite-plugin-static-copy ^0.13.1 → ^2.3.2
  • vite-plugin-checker ^0.8.0 → ^0.11.0

Override added (package.json)

  • rollup → ^4.59.0

Lockfile regeneration bonus fixes

The clean install (rm -rf node_modules package-lock.json && npm install) also resolved:

  • lodash 4.17.21 → 4.17.23 (prototype pollution fix)
  • lodash-es 4.17.22 → 4.17.23
  • undici updated via wrangler 4.75.0 (6 vulnerabilities)
  • minimatch patched within semver ranges (3.1.5, 5.1.9, 9.0.9)
  • svelte + lit-svelte-stores removed entirely from dependency tree
  • vue-template-compiler removed from tree

Dependabot Alerts Resolved

Directly by package upgrades (11):

By lockfile regeneration (24):

Total: 35 of 38 alerts resolved

Not fixed (blocked on upstream)

Test plan

  • npm install completes without errors
  • npm audit shows only 8 remaining (all blocked on upstream)
  • npm run build --workspace ui succeeds
  • Vite dev server starts correctly
  • CI passes

🤖 Generated with Claude Code

…static-copy to 2.3.2

Major version bump for vite (4→5) and companion plugins to resolve
multiple security vulnerabilities:

- vite: server.fs.deny bypass, middleware file serving issues, HTML file
  access bypass
- rollup: Arbitrary File Write via Path Traversal
- vite-plugin-static-copy: Files not in src accessible via crafted request

Also updates @vitejs/plugin-vue from ^4.2.3 to ^5.2.4 for vite 5
compatibility, and adds rollup override to ensure all transitive copies
are patched.

Resolves Dependabot alerts:
- #141, #140, #139, #128, #89, #88 (vite)
- #147, #115, #114 (rollup)
- #138, #86 (vite-plugin-static-copy)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Moritz Bierling and others added 2 commits March 19, 2026 16:49
vite-plugin-checker 0.8 had a peer dep mismatch with vue-tsc (~2.1.6 vs
installed 2.2.12). Version 0.11 fixes this and properly declares
vite >= 5.4.20 compatibility.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Regenerated package-lock.json via clean install (rm -rf node_modules
package-lock.json && npm install). This resolves many transitive
dependencies to their latest patched versions:

- lodash/lodash-es → 4.17.23 (fixes prototype pollution)
- minimatch → patched within semver ranges
- svelte/lit-svelte-stores removed from tree entirely
- undici resolved via wrangler 4.75.0
- nanoid (postcss) → 3.3.11

Remaining unfixable vulns (blocked on upstream):
- electron (hc-spin pins ^29, fix needs ^35)
- esbuild (vite 5 pins ^0.21, fix needs ^0.25)
- nanoid 5.0.4 (hc-spin pins exact version)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@zippy
Copy link
Copy Markdown
Collaborator

zippy commented Mar 23, 2026

Relevance Analysis
Short answer: Marginal value for your runtime use case.

The vulnerabilities this PR fixes fall into categories:

Vite/Rollup/vite-plugin-static-copy (11 alerts) — These are dev server and build tool vulnerabilities (path traversal in dev server, file serving bypasses). They affect the vite dev server and build pipeline, not the built output. In production (local Holochain runtime or HWC), the vite dev server isn't running. These only matter if you expose the dev server on a network during development.

Lockfile transitive fixes (24 alerts):

lodash prototype pollution (4.17.21→4.17.23) — You do depend on lodash at runtime. However, this is a theoretical prototype pollution vector that requires an attacker to control arguments to specific lodash functions. In a Holochain app where input comes from the DHT/zome calls, exploitation is extremely unlikely.
undici — Transitive via wrangler, which is a Cloudflare Workers tool. Not relevant to your Holochain runtime at all.
minimatch — Dev/build tooling only.
svelte/lit-svelte-stores removed — Cleanup of unused transitive deps.
Remaining unfixed — electron (hc-spin, dev only) and esbuild (vite transitive, build only).

Verdict
No runtime security impact — None of these vulnerabilities affect the built UI bundle running inside Holochain or HWC. The vite/rollup/static-copy issues are dev-server-only, and the lodash fix is for a vector that doesn't apply to your input model.
Dev environment hygiene — If you or others run npm run start (vite dev server) on a shared network, the vite path traversal fixes would matter. On localhost-only dev, even that risk is minimal.
Lockfile churn — The regenerated lockfile would conflict with any dependency changes on your lick-fixes branch, creating merge pain.
Recommendation: Skip this PR unless you're specifically trying to clean up Dependabot alerts. The fixes don't protect your users in any runtime scenario. If you do want a clean audit report later, it's easier to do a fresh lockfile regen after your feature work stabilizes.

Closing for now, may update later.

@zippy zippy closed this Mar 23, 2026
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.

2 participants