Repository navigation
fix(deps): our own override holds vite at the version a high advisory names - #1071
Conversation
…names `overrides.vite` read `'7.3.6'`, the exact version the advisory lists as vulnerable, so the pin itself was what held the exposure open rather than an unmaintained parent. Its comment said vite was held at 7.x to satisfy `@vitejs/[email protected]`'s peer, "which caps at ^7", and read as if nothing inside that cap could clear the flag. That peer is `^4.2.0 || ^5.0.0 || ^6.0.0 || ^7.0.0-beta.0`, and 7.3.7 is published, so the cap was never the blocker — vite 8.3.5 is latest and is what the cap actually excludes. 7.3.7 keeps `esbuild: ^0.27.0 || ^0.28.0`, read off the published manifest, so the comment's second clause and the flattening `esbuild: '0.28.1'` entry below it both still hold. The lockfile moves nothing but vite. `happy-dom`'s two advisories stay flagged, and the header block now records why rather than leaving the next audit run to re-derive it. happy-dom is installed only because `@lexical/[email protected]` declares it, and that package touches it from exactly one place: the `./dom` subpath export, whose `withDOM` constructs a `happy-dom` `Window`. Nothing imports that subpath. `@payloadcms/richtext-lexical` imports the main entry, which pulls `lexical` alone, and `@lexical/html` names `@lexical/headless/dom` only inside a dev-build error string. Both advisories require HTML parsed through happy-dom, so neither has a path here. Clearing the flag would mean overriding past the declared `^20.9.0` to 21.0.4 — 20.14.6 is the newest 20.x ever published, so the 20.14.7 the second advisory wants does not exist — and #1066 rules out a major in this PR. Refs #1066 Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Mg9rjWUt2VVH88iW2YXLpS
…y claim The block said clearing the flag means 21.0.4 "because … GHSA-c8p4-j97h-3vg8 wants 20.14.7", which attributes the target to the wrong advisory. That bar is `>=20.14.7`, so every 21.x satisfies it; 21.0.4 is demanded by GHSA-834v-8h66-3h79 alone, whose range runs to 21.0.3. A maintainer trusting "do not re-derive this" and picking `^21.0.0` — or `^20.14.7`, the number the old wording presented as the bar — would have left the host-code-execution advisory open. It also claimed happy-dom is installed "only because @lexical/headless declares it". vitest declares it as an optional peer and the lockfile links a copy into vitest's own node_modules, so a spec changing its `@vitest-environment` to happy-dom parses HTML through it — the precondition both advisories need. Eight specs carry that pragma today and all name jsdom. The claim is about what the app ships, and now says so. Adds the stronger evidence for that claim: the server build carries `createHeadlessEditor`'s own error string and no happy-dom marker anywhere, so the bundler followed the graph through @lexical/headless and never reached it. Refs #1066 Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Mg9rjWUt2VVH88iW2YXLpS
|
🚅 Deployed to the SahajCloud-pr-1071 environment in sahajcloud
1 service not affected by this PR
|
sydevs-bot
left a comment
There was a problem hiding this comment.
1 question for the reviewer, one per thread.
🤖 Written by the sydevs autonomous loop — see what this is
Generated by Claude Code
sydevs-bot
left a comment
There was a problem hiding this comment.
🧐 Adversarial review
The functional change is one character, and it is the one #1066 asked for. Nothing rides along, and the diff adds no new file, function, type or dependency.
I re-derived the version facts from the registry rather than trusting the body. They hold: 7.3.7 is the newest 7.x, latest is 8.3.5, @vitejs/[email protected]'s peer caps at 7.x, and 7.3.7's dependencies.esbuild and engines match 7.3.6's exactly. So the pin is right and the esbuild entry below it stays true.
For happy-dom, 20.14.6 really is the newest 20.x and 21.0.4 the newest overall, so "no in-range bump exists" holds and each advisory is attributed to the right bar. The carry-or-override decision is already an open question thread, so it is not a finding here.
Both findings are in the comment prose.
Findings
- should-fix — the
vitecomment narrates the diff instead of the current state (pnpm-workspace.yaml:48). - consider — the happy-dom ledger carries proof that will date (
pnpm-workspace.yaml:38).
What was checked
- Diff: both files whole. The lockfile moves only
vite7.3.6 → 7.3.7 and the peer strings naming it. - Registry, independently: vite's 7.3.x list and
latest, plugin-react's peer range, vite 7.3.7 against 7.3.6 fordependencies.esbuildandengines, and happy-dom's full 20.x and 21.x lists. - Consumers:
vitest.config.mts:4-6— plugin-react and vite-tsconfig-paths are the only vite consumers, as the body says. - Claims:
git grep @vitest-environmentfinds 8 spec files, all jsdom. No7.3.6survives outside the lockfile. - Preview: the health endpoint answers 200
status: okon the new lockfile. The Events admin route answers 200. - Not settled: a routine clone has no
node_modules, so the@lexical/headlesssubpath read and the.nextgrep were not re-run here.
🤖 Written by the sydevs autonomous loop — see what this is
Generated by Claude Code
docs/rules/code-comments.md forbids narrating a change. The clause saying the pin no longer holds GHSA-587h-7wmj-h5pm open, and that a lower one did, reads as diff history to anyone who opens the file fresh. The live constraint — plugin-react's peer cap, and 7.3.7 as the newest version inside it that clears the advisory — is what a later reader needs, and it stays. #1066's criterion 3 asked for the waiting-on-a-blocker framing. The repo rule wins; the blocker it meant is the peer cap, still named above. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Mg9rjVwk2sfcU4s75b536Y
Two of the entry's claims would date. The spec count goes stale on the ninth `@vitest-environment` pragma, so the condition is kept without the number. And grepping `.next` for the string `happy-dom` proves nothing: the bundler erases the specifier, so a bundled copy would not match. The import-graph argument above it is what carries the reachability, and the call paths live in #1071 where #1066's criterion 2 asked for them. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Mg9rjVwk2sfcU4s75b536Y
|
Both adversarial-review findings are built, one commit each. Lean gate green on the merged base. Adopted
Base — Open — the carry-or-override question waits on you. 🤖 Written by the sydevs autonomous loop — see what this is Generated by Claude Code |
The reviewer chose B on the #1101 question thread: treat @lexical/[email protected] declaring `happy-dom: ^21.0.4` as upstream's own statement that 21 fits the symbols it uses, rather than waiting for a payload release to carry lexical 0.53. So `happy-dom: '^21.0.4'` lands as an override. It resolves 20.14.6 to 21.0.4 and clears both highs: `pnpm audit --audit-level=high` goes from 12 vulnerabilities / 2 high to 10 / 0 high. It is past @lexical/[email protected]'s declared `^20.9.0`, so it carries the ⚠ marker and sits beside nodemailer, the other past-major entry. The ledger header said an unreachable advisory is carried rather than overridden; that sentence is now false and is replaced. The happy-dom paragraphs keep the reachability finding, the #1071 breadcrumb and the `Do not re-derive` directive, and now name the one release that drops the line: richtext-lexical carrying lexical 0.53. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Mg9rjYi8ZFh4DUbiYQ2NT3
Summary
overrides.vite7.3.6 → 7.3.7 clears GHSA-587h-7wmj-h5pm; the lockfile moves nothing else.happy-domhighs stay flagged — unreachable in the shipped build, evidence kept in the YAML.origin/mainis merged in at225492f(the routine batch, chore(deps): routine minor and patch updates #1064). Clean merge, no conflict;pnpm installfrom the merged lockfile moves nothing and the audit still reports the same two highs.Change outline
The change is one dependency contract: what
pnpm installis allowed to resolve.Contract — the overrides block
The peer cap the old comment blamed is real but was never the blocker.
@vitejs/[email protected]wants^4.2.0 || ^5.0.0 || ^6.0.0 || ^7.0.0-beta.0, so vite 8(
latest, 8.3.5) does break it — 7.3.7 does not.Flow — what actually runs vite
So the 234-file unit run is the real exercise of the bump, not the build. The ticket assumed the
opposite; both were run.
Preview
happy-domhalf is aboutData: not seeded —
previewUrl.seedis unset in.claude/workflow.json, so the Events list may beempty. The health endpoint needs no data. Sign in with
PREVIEW_ADMIN_EMAIL.Test results
.claude/skills/pr-prep/check.sh— lint, Prettier,tsc(src and tests), 234 unit files / 2990 tests. Re-run at0617058, on the merged base, in 132 s.pnpm build(ate64ffe4, before the base merge; CI runs it on the merged head)pnpm audit --audit-level=highafter the merge: 12 vulnerabilities, 2 high, bothhappy-dom. Unchanged from the "after" block below.pnpm audit --audit-level=high— beforepnpm audit --audit-level=high— afterThe one
viteadvisory is gone, and three moderates and one low went with it.pnpm peers checkreports one unmet peer,
webpack 5.107.2against[email protected]'s^5.112.0. It predatesthis branch: the lockfile diff moves no package but
vite, so nothing here could have introducedit.
Manual verification
pnpm buildpassing locally is the same exercise, butRailway installs from the lockfile rather than reusing a warm store.
Notes for reviewer
The
happy-domreachability evidence, which acceptance criterion 2 asks for by entry point andcall path rather than by severity:
@lexical/[email protected]declareshappy-dom: ^20.9.0as a hard dependency, but its twoentry points are not equal.
.exportscreateHeadlessEditor, whose source(
src/index.ts) importslexicaland nothing else.happy-domis reached only from./dom,whose
withDOMconstructs ahappy-domWindow(src/dom.ts:9).@lexical/headless/dom.@payloadcms/[email protected]imports the mainentry in every place it names the package —
features/converters/htmlToLexical,markdownToLexical,lexicalToMarkdown,utilities/upgradeLexicalDataand thelexical-proxyre-export among them. The single tree-wide hit for the./domsubpath is@lexical/html'sLexicalHtml.dev.*, where it appears inside aformatDevErrorMessagestringtelling the caller to use it; the
.prodand default builds contain no reference at all.0617058withnode_modulesinstalled:inside
@lexical/headless,happy-domappears only in the fourLexicalHeadlessDom.*builds —the
./domentry — and@payloadcms/richtext-lexical'sdistnames@lexical/headlessbare inall twelve places, never the subpath.
happy-dom— SSRF on<iframe>/<link rel=stylesheet>,and host code execution via an import alias. With no
Windowever constructed, neither has apath in what this repo ships.
One earlier line of evidence is withdrawn. A previous draft also grepped
.nextfor the stringhappy-dom, found nothing, and read that as the build agreeing. It proves nothing either way: abundler rewrites the specifier away, so a bundled copy of
happy-domwould not match the stringeither. Nothing above rests on it.
Why they are not cleared anyway. No in-range bump exists:
20.14.6is the newest 20.x everpublished, so even
GHSA-c8p4-j97h-3vg8's>=20.14.7is unreachable inside^20.9.0. The onlyfix is an override to
21.0.4, which is a major past the declared range, and criterion 4 rules oneout of this PR. Whether a follow-up should take it regardless is a question thread on the diff.
No test was added. The repo has no dependency-pin or lockfile spec, and adding the first one
would be a permanent layer guarding a one-line pin that
pnpm auditalready measures. The auditoutput above is the evidence instead. Say the word if you would rather have the guard.
Review findings acted on, both from the
/code-review highpass (nopr-review-toolkitin aroutine), in
e64ffe4:21.0.4onGHSA-c8p4-j97h-3vg8, whose bar is>=20.14.7and which any21.x satisfies.
21.0.4isGHSA-834v-8h66-3h79's alone. Under a "do not re-derive this" notethat misattribution could have sent a later maintainer to
^21.0.0with thehost-code-execution advisory still open.
happy-domis installed "only because@lexical/headlessdeclares it".vitestdeclares it as an optional peer and the lockfile links a copy intovitest's ownnode_modules, so a spec changing its@vitest-environmenttohappy-domwould parse HTMLthrough it. Eight specs carry that pragma and all name
jsdom. The claim is about what the appships, and now says so.
Both adversarial-review findings are also built, each in its own commit:
ccfacf3— thevitecomment narrated the diff. "This pin no longer holds that advisory open — apin one patch lower did" reads as history to anyone opening the file fresh, which
docs/rules/code-comments.mdforbids. It now states the live constraint only. fix(deps): our own override holds vite at the version a high advisory names #1066's criterion 3asked for the removed blocker to be stated; the blocker it meant is the peer cap, still named, so
the criterion's substance holds and the criterion itself is left as written.
0617058— thehappy-domledger carried two claims that would date: the spec count, stale onthe ninth
@vitest-environmentpragma, and the.nextgrep withdrawn above. The entry now keepsthe import-graph argument, the version bars and
Do not re-derive, and points here for the callpaths — the shape the
bracesentry above it uses.Nothing was dismissed.
Detail
esbuildwas checked, not assumed. The ticket asked for it.[email protected]'s published manifestdeclares
esbuild: "^0.27.0 || ^0.28.0", byte-identical to 7.3.6's, so the comment's second clauseand the
esbuild: '0.28.1'entry that flattens every copy both stay true.engines(
^20.19.0 || >=22.12.0),dependenciesandpeerDependenciesare unchanged across the patch aswell, which is why the lockfile edit is a pure textual substitution of the version.
Why an exact pin, still.
'7.3.7'keeps the existing style and holds the resolution still.'^7.3.7'would float to a future 7.4.x that does not exist yet, for no gain — 7.3.7 is the last7.x published, and the peer cap already bars 8.
Rejected: adding
happy-dom: '^21.0.4'besidenodemailer. It would clear both flags today,and
nodemaileris the precedent for taking a major deliberately. Rejected for this PR becausecriterion 4 forbids it and the reachability evidence means no path needed the fix. Recorded in the
header block so the next
audit-depsrun does not re-derive the analysis.Scope not taken. #1065 is the other defect in the same
overrides:block —left alone on purpose, because it must not ship on the
claude/fix-deps-prefix.Closes #1066
🤖 Generated with Claude Code
https://claude.ai/code/session_01Mg9rjWUt2VVH88iW2YXLpS