Skip to content

fix(security): close the three vite advisories with overrides, and file the build nobody runs - #318

Merged
scttfrdmn merged 3 commits into
mainfrom
security/vite-6
Aug 3, 2026
Merged

scttfrdmn merged 3 commits into
mainfrom
security/vite-6

Conversation

@scttfrdmn

Copy link
Copy Markdown
Owner

Closes Dependabot alerts 1, 2 and 3 (all vite in docs-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.3 on its own does not close them. [email protected] — the latest stable release — depends on vite: ^5.4.14 as a regular dependency rather than a peer, so npm is free to satisfy it separately. The install produces:

node_modules/[email protected]
node_modules/vitepress/node_modules/[email protected]   <-- the one that builds the docs

Verified by installing exactly that in a scratch directory: npm audit still reported high vite <=6.4.2 and moderate vitepress <=1.6.4. The manifest would have read as fixed while the vulnerable code was on disk and executing.

What does work

An overrides block, which reaches the transitive copy:

"overrides": {
  "vite": "^6.4.3",
  "uuid": "^11.1.1"
}

With it there is no nested vite directory at all, and npm audit reports zero vulnerabilities at every severity — down from the three vite findings plus two moderate uuid/dockerode findings that no alert had been opened for.

This keeps vitepress on 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.

uuid is overridden for the same structural reason: a missing buffer-bounds check in uuid v3/v5/v6, reachable through 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. Both dockerode and docker-modem were confirmed to load, and uuid.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 runs vitepress build to notice. Filed as #317, which documents four independent stacked failures (no "type": "module", a CommonJS config.js that conflicts with fixing it, a markdown-it-container dynamic require, and three of five theme components that do not exist in the repository) plus a missing client/ directory that npm run build invokes.

The override does move the failure later: vite 6 loads the ESM-only vitepress that vite 5 refused with "ESM file cannot be loaded by require", so the build now reaches page compilation instead of dying in config resolution. But later is not passing. The evidence for this change is npm audit and 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.

…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.
@scttfrdmn

Copy link
Copy Markdown
Owner Author

One more finding that sharpens why the overrides block matters, and it is uncomfortable: closing these alerts is not evidence that the vulnerable code is gone.

No lockfile is committed anywhere in this repository (git ls-files | grep -E 'package-lock|yarn.lock|pnpm-lock' → nothing). So GitHub's dependency graph for docs-platform contains exactly what the manifest declares:

$ gh api repos/scttfrdmn/objectfs/dependency-graph/sbom \
    --jq '[.sbom.packages[]|select(.name|test("vite|vitepress"))]'
[{"name":"vite","versionInfo":"^5.0.10"},{"name":"vitepress","versionInfo":"^1.0.0"}]

Two ranges. The nested vitepress/node_modules/[email protected] does not appear — GitHub has no visibility into it, because without a lockfile there is no resolved tree to read. Which means alerts 1–3 were opened against the declared ^5.0.10 range, and they would have closed the moment that range read ^6.4.3, whether or not a vulnerable vite was still being installed and executed.

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 node_modules. The alerts closing is a statement about the manifest, not about the disk. The evidence that the fix is real is npm audit on an actual install — which reads the tree GitHub cannot see, reported high vite <=6.4.2 under the bump-only variant, and reports zero findings with the override.

This is the same structural gap the .github/dependabot.yml comment already records from the other direction: for a security update Dependabot needs a lockfile, and without one it refused these very alerts with "can't update vulnerable dependencies for projects without a lockfile or pinned version requirement as the currently installed version of vite isn't known." Committing a lockfile (#214) is what would make both halves honest — Dependabot could act on the alerts, and the dependency graph would show what is actually installed. Worth bumping in priority; it is the reason this PR needed a local npm audit to be believable at all.

(Reposting: two code spans in the previous comment were eaten by shell command substitution before the comment was sent. Same content, correctly rendered.)

@scttfrdmn
scttfrdmn merged commit 7cd00e2 into main Aug 3, 2026
24 checks passed
@scttfrdmn
scttfrdmn deleted the security/vite-6 branch September 20, 2026 05:25
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.

1 participant