Skip to content

chore: patch the vitest, postcss, sharp and Next.js advisories - #10

Merged
renrenmimi merged 1 commit into
mainfrom
chore/patch-dependency-vulnerabilities
Sep 1, 2026
Merged

chore: patch the vitest, postcss, sharp and Next.js advisories#10
renrenmimi merged 1 commit into
mainfrom
chore/patch-dependency-vulnerabilities

Conversation

@renrenmimi

Copy link
Copy Markdown
Owner

What

npm audit reported 8 advisories on main, one of them critical:

Severity Package Advisory
critical vitest 2.1.9 with the Vitest UI server listening, an arbitrary file can be read and executed
high vite server.fs.deny bypass on Windows alternate paths
high postcss 8.4.31 path traversal + arbitrary file read via sourceMappingURL
high sharp 0.34.5 inherited libvips CVEs
moderate esbuild, vite, postcss dev-server request forgery, .map path traversal

How

  • vitest 2.1.9 → 4.x, with the @vitejs/plugin-react and jsdom versions that release expects. This is where AlgoAlgo and TSer already are, so the series stays consistent. It clears the critical plus the vite/esbuild chain.
  • postcss and sharp via overrides. Every Next.js 15.x pins them inside the vulnerable range, so npm audit fix --force wanted next@16.3.4. Overrides lift just those two; Next.js moves to the patched 15.5.25.
  • Lockfile regenerated — npm could not resolve the new peer graph incrementally (ERESOLVE on the stale @vitejs/plugin-react@4 / vite@8 pair).
  • vitest.config.tsvitest.config.mts so Vite's native config loader reads it as the ESM it already is. On the old name, Vitest 4 printed a config-loader warning on every run.

Verification

  • npm audit0 vulnerabilities (was 1 critical, 4 high, 3 moderate)
  • npm run typecheck — clean
  • npm test — 54/54 passing, warning gone
  • npm run test:e2e — 4/4 Playwright specs passing
  • npm run build — passing

No application source changed; this is dependency and test-config only.

🤖 Generated with Claude Code

npm audit reported eight advisories on main, one of them critical: with
the Vitest UI server listening, an arbitrary file could be read and
executed. Vitest 2.1.9 also dragged in vulnerable copies of vite and
esbuild, and Next.js pinned postcss and sharp inside their vulnerable
ranges.

Vitest moves to 4.x, which is where the other courses in this series
already are, together with the plugin and jsdom versions that release
expects. postcss and sharp are lifted by overrides rather than by taking
the Next.js 16 major that `npm audit fix --force` proposed, and Next.js
moves to the patched 15.5.25.

The lockfile is regenerated because npm could not resolve the new peer
graph incrementally.

vitest.config.ts becomes vitest.config.mts so Vite's native config
loader reads it as the ESM it already is; on the old name Vitest 4
warned about it on every run.

npm audit now reports zero vulnerabilities. Typecheck, all 54 unit tests
and all 4 Playwright specs pass unchanged.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Copilot AI lite review requested due to automatic review settings September 1, 2026 02:33
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, you can upgrade your account or add credits to your account and enable them for code reviews in your settings.

@vercel

vercel Bot commented Sep 1, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
data-data Ready Ready Preview Sep 1, 2026 2:35am UTC

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟢 Approval recommended

The changes are limited to dependency/tooling updates with configuration aligned to the new versions and CI Node 22, and the PR reports full typecheck/test/build verification.

Pull request overview

Updates the project’s JavaScript tooling dependencies to address npm audit security advisories, and adjusts Vitest configuration so the upgraded toolchain loads the test config as native ESM.

Changes:

  • Upgraded Next.js and the Vitest/Vite toolchain (Vitest 4, @vitejs/plugin-react, jsdom) to patched versions.
  • Added npm overrides to force patched postcss and sharp versions without jumping to Next.js 16.
  • Regenerated package-lock.json to reflect the updated dependency graph.
File summaries
File Description
vitest.config.mts Adds an ESM-native Vitest config with React plugin + @ alias and unit-test scoping.
package.json Bumps Next.js / Vitest toolchain versions and introduces overrides for postcss and sharp.
package-lock.json Lockfile regeneration reflecting the new dependency tree and overridden versions.
Review details
  • Files reviewed: 1/3 changed files
  • Comments generated: 0
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@renrenmimi
renrenmimi merged commit da105d7 into main Sep 1, 2026
4 checks passed
@renrenmimi
renrenmimi deleted the chore/patch-dependency-vulnerabilities branch September 1, 2026 03:06
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