Skip to content

build: Upgrade vite to v8 to resolve esbuild advisory #61

@mikanmarusan

Description

@mikanmarusan

Goal

Resolve the 3 high-severity npm audit findings in frontend/ that all stem from a single transitive dependency on a vulnerable esbuild, so that npm audit --audit-level=high --prefix frontend (matching the CI security check) reports 0 vulnerabilities.

Your Task

  • Upgrade vite (currently ^6.2.0, resolving to 6.4.3) to v8 and bump @vitejs/plugin-react to a compatible major in frontend/package.json.
  • Run npm install --prefix frontend and confirm esbuild resolves to >= 0.28.1.
  • Address any vite 6 → 8 breaking changes (config in frontend/vite.config.ts, plugin API, build target/output) needed to make npm run --prefix frontend build succeed.
  • Verify the dev server, unit tests (Vitest), and Playwright E2E still work.

Context

The advisory GHSA-gv7w-rqvm-qjhr (esbuild dev-server / Deno module RCE via NPM_CONFIG_REGISTRY) affects esbuild 0.17.0 – 0.28.0. The chain is esbuildvite@6.4.3@vitejs/plugin-react.

The /x-fixing-vulnerabilities skill attempted a non-breaking fix and could not resolve it:

  • npm audit fix (non-force) does nothing — the only patched esbuild is 0.28.1.
  • vite@6.4.3 pins esbuild: ^0.25.0 (i.e. < 0.26), so an overrides: { "esbuild": "^0.28.1" } entry was tried. Audit went clean and all unit tests + lint passed, but npm run --prefix frontend build failed with 12 errors (Transforming destructuring to the configured target environment ... is not supported yet). esbuild 0.28.x is genuinely incompatible with vite 6's build pipeline, so the override was reverted.

There is no esbuild version that is both patched and compatible with vite 6. The only resolution is the major vite upgrade — equivalent to npm audit fix --force, which the skill deliberately avoids because it needs human review.

Warning

  • This is a major version bump (vite 6 → 8) and may require config and plugin changes; it is intentionally out of scope for the automated vulnerability-fix skill.
  • The vulnerability is dev-only: the frontend ships pre-built static assets to S3/CloudFront, so esbuild never runs in production. Practical exposure is local dev / CI, not the deployed app. CI's --audit-level=high will still flag it until fixed.
  • Do the work on a dedicated branch and run the full frontend verification suite before merging.

Acceptance Criteria

  • npm audit --audit-level=high --prefix frontend reports found 0 vulnerabilities.
  • npm ls esbuild --prefix frontend shows esbuild@0.28.1 or later.
  • npm run --prefix frontend build exits 0 and produces frontend/dist/.
  • npm run --prefix frontend test -- --run passes all tests.
  • npm run --prefix frontend lint exits 0.
  • npx --prefix frontend playwright test (frontend E2E) passes.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions