Repository navigation
fix(security): close the three vite advisories with overrides, and file the build nobody runs - #318
Conversation
…ion bump The three open vite advisories all name docs-platform/package.json, and every one has its lowest patched release on the 6.x line — there is no patched 5.x, so "vite": "^5.0.10" was permanently vulnerable regardless of where it landed inside the major. Raising the declared range to ^6.4.3 does not close them, which is the part worth recording because it looks like it should. [email protected] — latest stable — depends on vite: ^5.4.14 as a regular dependency rather than a peer, so npm satisfies it separately: the install yields [email protected] at top level and vitepress/node_modules/[email protected] beneath it, and the nested copy is the one that builds the docs. Verified by installing exactly that; npm audit still reported `high vite <=6.4.2`. The manifest would have read as fixed while the vulnerable code sat on disk. An overrides block is what reaches the transitive copy. With it, no nested vite directory exists and npm audit reports zero vite findings. vitepress stays on stable; the alternative was [email protected] with vite@^7, which also clears the alerts but makes a published pre-release a dependency of the docs build. uuid: ^11.1.1 is overridden for the same structural reason — a missing buffer-bounds check in uuid v3/v5/v6 reachable via dockerode -> docker-modem, which src/api-server.js uses to run playground containers. [email protected] drops the dependency outright, but that is a major bump of a package with live call sites; the override fixes the vulnerable code without touching them. dockerode and docker-modem were confirmed to load and uuid.v4() to work under the forced version. docs-platform now audits clean at every severity, down from three vite findings plus two uuid/dockerode moderates that no alert had been opened for. What this cannot claim: the docs platform does not build, on main or with these overrides, and nothing in CI runs `vitepress build` to notice — filed as #317. The override does move the failure later, since vite 6 loads the ESM-only vitepress that vite 5 refused, so the build now reaches page compilation rather than dying in config resolution. But later is not passing, and the evidence here is npm audit plus module loading, not a green build.
|
One more finding that sharpens why the No lockfile is committed anywhere in this repository ( Two ranges. The nested That is the whole argument for the override in one sentence: the version bump alone would have produced a clean alert page and a dirty This is the same structural gap the (Reposting: two code spans in the previous comment were eaten by shell command substitution before the comment was sent. Same content, correctly rendered.) |
Closes Dependabot alerts 1, 2 and 3 (all
viteindocs-platform/package.json, one high). Files #317 for what this work uncovered.The bump that doesn't work
Every one of the three advisories has its lowest patched release on the 6.x line —
<= 6.4.2→ 6.4.3 and<= 6.4.1→ 6.4.2. No patched 5.x exists, so"vite": "^5.0.10"was permanently vulnerable no matter where it moved inside the major.Raising the declared range to
^6.4.3on its own does not close them.[email protected]— the latest stable release — depends onvite: ^5.4.14as a regular dependency rather than a peer, so npm is free to satisfy it separately. The install produces:Verified by installing exactly that in a scratch directory:
npm auditstill reportedhigh vite <=6.4.2andmoderate vitepress <=1.6.4. The manifest would have read as fixed while the vulnerable code was on disk and executing.What does work
An
overridesblock, which reaches the transitive copy:With it there is no nested
vitedirectory at all, andnpm auditreports zero vulnerabilities at every severity — down from the three vite findings plus two moderateuuid/dockerodefindings that no alert had been opened for.This keeps
vitepresson stable. The alternative was[email protected]+vite@^7.3.5, which also clears everything but makes a published pre-release a dependency of the docs build. An override is the smaller commitment for the same audit result.uuidis overridden for the same structural reason: a missing buffer-bounds check inuuidv3/v5/v6, reachable throughdockerode→docker-modem, whichsrc/api-server.jsuses to run playground containers.[email protected]drops the dependency outright, but that is a major bump of a package with live call sites; the override fixes the vulnerable code without touching them. Bothdockerodeanddocker-modemwere confirmed to load, anduuid.v4()to work, under the forced version.What this PR cannot claim
The docs platform does not build — not on
main, not with these overrides — and nothing in CI or the Makefile runsvitepress buildto notice. Filed as #317, which documents four independent stacked failures (no"type": "module", a CommonJSconfig.jsthat conflicts with fixing it, amarkdown-it-containerdynamic require, and three of five theme components that do not exist in the repository) plus a missingclient/directory thatnpm run buildinvokes.The override does move the failure later: vite 6 loads the ESM-only
vitepressthat vite 5 refused with "ESM file cannot be loaded byrequire", so the build now reaches page compilation instead of dying in config resolution. But later is not passing. The evidence for this change isnpm auditand module loading, not a green build — stated plainly here and in the CHANGELOG rather than implied away.Gates
go build ./...·go vet ./...·gofmt -l .·go test -count=1 ./internal/config/— all clean. No Go code changes.