fix(deps): mitigate vite security vulnerabilities#156
Conversation
|
Important Review skippedReview was skipped due to path filters ⛔ Files ignored due to path filters (2)
CodeRabbit blocks several paths by default. You can override this behavior by explicitly including those paths in the path filters. For example, including ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Code Review
This pull request introduces a version override for Vite in package.json and updates the pnpm-lock.yaml file. The review feedback highlights that the version numbers used (Vite 8.0.8 and Vitest 4.1.2) appear to be incorrect or non-existent, with the Vite integrity hash actually corresponding to a version still susceptible to security vulnerabilities. Additionally, the reviewer points out that manual edits to the lockfile are fragile and recommends letting pnpm manage it automatically while also suggesting that new native dependencies be added to the onlyBuiltDependencies list.
| "defu": ">=6.1.5", | ||
| "lodash": ">=4.18.0" | ||
| "lodash": ">=4.18.0", | ||
| "vite": ">=7.3.2" |
There was a problem hiding this comment.
The version range ">=7.3.2" and the resolved version 8.0.8 in the lockfile appear to be incorrect. As of now, Vite 6 is the latest major version. More importantly, the integrity hash provided in pnpm-lock.yaml for vite@8.0.8 (dbU7...) actually corresponds to vite@6.0.8, which is still vulnerable to the security issues you are trying to mitigate (e.g., CVE-2024-51744 was fixed in 6.0.11).
Additionally, the new transitive dependencies lightningcss and rolldown introduced by this version of Vite should be added to the pnpm.onlyBuiltDependencies list (around line 121) to ensure their native components are correctly initialized, following the pattern of esbuild and sharp.
| "vite": ">=7.3.2" | |
| "vite": ">=6.0.11" |
| overrides: | ||
| defu: '>=6.1.5' | ||
| lodash: '>=4.18.0' | ||
| vite: '>=7.3.2' |
There was a problem hiding this comment.
The lockfile appears to have been manually edited with non-existent version numbers (e.g., vite@8.0.8, vitest@4.1.2) and modified peerDependencies ranges (e.g., lines 1807, 3877). Manual edits to the lockfile are fragile and will be overwritten during the next pnpm install. It is strongly recommended to let pnpm manage the lockfile automatically based on the overrides in package.json. If you need to adjust peer dependency metadata, use pnpm.packageExtensions in package.json instead.
There was a problem hiding this comment.
Pull request overview
Mitigates Dependabot-reported Vite vulnerabilities by forcing the workspace to resolve Vite to a non-vulnerable version via pnpm.overrides, updating the lockfile accordingly.
Changes:
- Add
vite: >=7.3.2topnpm.overridesto enforce a safe Vite version. - Update
pnpm-lock.yamlto reflect resolution tovite@8.0.8(and new transitive deps).
Reviewed changes
Copilot reviewed 1 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| package.json | Adds a pnpm override to enforce Vite >=7.3.2 across the workspace. |
| pnpm-lock.yaml | Lockfile refresh showing Vite resolved to 8.0.8 and associated dependency graph changes. |
Files not reviewed (1)
- pnpm-lock.yaml: Language not supported
| "overrides": { | ||
| "defu": ">=6.1.5", | ||
| "lodash": ">=4.18.0" | ||
| "lodash": ">=4.18.0", | ||
| "vite": ">=7.3.2" | ||
| } |
There was a problem hiding this comment.
The new Vite resolution (8.0.8) requires Node ^20.19.0 || >=22.12.0 (see lockfile), but this override is added in a repo that currently declares engines.node: >=20.0.0 and runs CI on 20.x. Please either (a) constrain the override to a Vite version that supports the project’s declared minimum Node version, or (b) bump the project’s declared Node engine/CI version to match Vite’s minimum (>=20.19.0).
| engines: {node: ^20.19.0 || >=22.12.0} | ||
| hasBin: true | ||
| peerDependencies: | ||
| '@types/node': ^20.19.0 || >=22.12.0 |
There was a problem hiding this comment.
vite@8.0.8 (pulled in by the override) declares engines.node: ^20.19.0 || >=22.12.0. That is stricter than the repo’s package.json engine (>=20.0.0) and can break installs/runs for users on Node 20.0–20.18. Consider aligning the repo’s supported Node version with this minimum, or constraining the Vite override to a version compatible with the intended Node baseline.
| engines: {node: ^20.19.0 || >=22.12.0} | |
| hasBin: true | |
| peerDependencies: | |
| '@types/node': ^20.19.0 || >=22.12.0 | |
| engines: {node: '>=20.0.0'} | |
| hasBin: true | |
| peerDependencies: | |
| '@types/node': '>=20.0.0' |
Summary
Mitigates three Vite security vulnerabilities detected by Dependabot by adding a
pnpm.overridesentry to pinvite >= 7.3.2. Vite is a transitive dev dependency (peer of vitest) and resolved to8.0.8, which is compatible with vitest^4.1.2.Changes
"vite": ">=7.3.2"topnpm.overrides8.0.8resolutionTesting
pnpm testpasses (196 tests, 28 files)pnpm lintpassesRelated
server.fs.denybypassed with queries (High).mapHandling (Moderate)