Skip to content

fix(deps): our own override holds vite at the version a high advisory names - #1071

Merged
sydevs-bot merged 5 commits into
mainfrom
claude/fix-deps-1066-vite-override
Nov 2, 2026
Merged

sydevs-bot merged 5 commits into
mainfrom
claude/fix-deps-1066-vite-override

Conversation

@sydevs-bot

@sydevs-bot sydevs-bot commented Nov 2, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • overrides.vite 7.3.6 → 7.3.7 clears GHSA-587h-7wmj-h5pm; the lockfile moves nothing else.
  • Both happy-dom highs stay flagged — unreachable in the shipped build, evidence kept in the YAML.
  • origin/main is merged in at 225492f (the routine batch, chore(deps): routine minor and patch updates #1064). Clean merge, no conflict; pnpm install from the merged lockfile moves nothing and the audit still reports the same two highs.

Change outline

The change is one dependency contract: what pnpm install is allowed to resolve.

Contract — the overrides block

 pnpm-workspace.yaml
   # header: the ledger of advisories deliberately left unpinned
   #   braces   — no patched version exists
+  #   happy-dom — no path reaches it; 21.0.4 would be a major
 overrides:
-  vite: '7.3.6'      # the exact version GHSA-587h-7wmj-h5pm names vulnerable
+  vite: '7.3.7'      # highest 7.x, and the first to clear it
   esbuild: '0.28.1'  # unchanged: 7.3.7 still asks for ^0.27 || ^0.28

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

 pnpm build                → next build          # no vite anywhere (next.config.mjs: none)
 pnpm test:unit            → vitest 4.1.12
-                            └ vite 7.3.6        # @vitejs/plugin-react, vite-tsconfig-paths
+                            └ vite 7.3.7        #   vitest.config.mts:4-6, the only consumers

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

Data: not seeded — previewUrl.seed is unset in .claude/workflow.json, so the Events list may be
empty. The health endpoint needs no data. Sign in with PREVIEW_ADMIN_EMAIL.

Test results

  • Lean gate: ✓ .claude/skills/pr-prep/check.sh — lint, Prettier, tsc (src and tests), 234 unit files / 2990 tests. Re-run at 0617058, on the merged base, in 132 s.
  • Targeted specs: none added — see Notes for reviewer
  • Build: ✓ pnpm build (at e64ffe4, before the base merge; CI runs it on the merged head)
  • pnpm audit --audit-level=high after the merge: 12 vulnerabilities, 2 high, both happy-dom. Unchanged from the "after" block below.
pnpm audit --audit-level=high — before
high  launch-editor: `fs.existsSync()` existence check can be bypassed on Windows
  Package             vite
  Vulnerable versions >=7.0.0 <=7.3.6
  Patched versions    >=7.3.7
  Paths               .>@vitejs/plugin-react>vite
                      .>@vitest/coverage-v8>vitest>@vitest/mocker>vite
                      .>@vitest/coverage-v8>vitest>vite
                      ... Found 6 paths, run `pnpm why vite` for more information
  More info           https://github.com/advisories/GHSA-587h-7wmj-h5pm

high  Happy DOM: Incomplete fix for CVE-2026-33943: unsanitized import alias leads to host code execution
  Package             happy-dom
  Vulnerable versions >=17.0.0 <=21.0.3
  Patched versions    >=21.0.4
  Paths               .>@payloadcms/richtext-lexical>@lexical/headless>happy-dom
                      .>@vitest/coverage-v8>vitest>happy-dom
                      .>vitest>happy-dom
  More info           https://github.com/advisories/GHSA-834v-8h66-3h79

high  Happy DOM: SSRF via iframe and link stylesheet when parsing untrusted HTML
  Package             happy-dom
  Vulnerable versions <=20.14.6
  Patched versions    >=20.14.7
  Paths               (same three)
  More info           https://github.com/advisories/GHSA-c8p4-j97h-3vg8

17 vulnerabilities found
Severity: 4 low | 10 moderate | 3 high
pnpm audit --audit-level=high — after
high  Happy DOM: Incomplete fix for CVE-2026-33943: unsanitized import alias leads to host code execution
  Package             happy-dom
  Vulnerable versions >=17.0.0 <=21.0.3
  Patched versions    >=21.0.4
  Paths               .>@payloadcms/richtext-lexical>@lexical/headless>happy-dom
                      .>@vitest/coverage-v8>vitest>happy-dom
                      .>vitest>happy-dom
  More info           https://github.com/advisories/GHSA-834v-8h66-3h79

high  Happy DOM: SSRF via iframe and link stylesheet when parsing untrusted HTML
  Package             happy-dom
  Vulnerable versions <=20.14.6
  Patched versions    >=20.14.7
  Paths               (same three)
  More info           https://github.com/advisories/GHSA-c8p4-j97h-3vg8

12 vulnerabilities found
Severity: 3 low | 7 moderate | 2 high

The one vite advisory is gone, and three moderates and one low went with it. pnpm peers check
reports one unmet peer, webpack 5.107.2 against [email protected]'s ^5.112.0. It predates
this branch: the lockfile diff moves no package but vite, so nothing here could have introduced
it.

Manual verification

  1. Confirm the preview deploy goes green — pnpm build passing locally is the same exercise, but
    Railway installs from the lockfile rather than reusing a warm store.

Notes for reviewer

The happy-dom reachability evidence, which acceptance criterion 2 asks for by entry point and
call path rather than by severity:

  • @lexical/[email protected] declares happy-dom: ^20.9.0 as a hard dependency, but its two
    entry points are not equal. . exports createHeadlessEditor, whose source
    (src/index.ts) imports lexical and nothing else. happy-dom is reached only from ./dom,
    whose withDOM constructs a happy-dom Window (src/dom.ts:9).
  • Nothing imports @lexical/headless/dom. @payloadcms/[email protected] imports the main
    entry in every place it names the package — features/converters/htmlToLexical,
    markdownToLexical, lexicalToMarkdown, utilities/upgradeLexicalData and the
    lexical-proxy re-export among them. The single tree-wide hit for the ./dom subpath is
    @lexical/html's LexicalHtml.dev.*, where it appears inside a formatDevErrorMessage string
    telling the caller to use it; the .prod and default builds contain no reference at all.
  • The import graph is the whole proof, re-checked at 0617058 with node_modules installed:
    inside @lexical/headless, happy-dom appears only in the four LexicalHeadlessDom.* builds —
    the ./dom entry — and @payloadcms/richtext-lexical's dist names @lexical/headless bare in
    all twelve places, never the subpath.
  • Both advisories need HTML parsed through happy-dom — SSRF on <iframe>/<link rel=stylesheet>,
    and host code execution via an import alias. With no Window ever constructed, neither has a
    path in what this repo ships.

One earlier line of evidence is withdrawn. A previous draft also grepped .next for the string
happy-dom, found nothing, and read that as the build agreeing. It proves nothing either way: a
bundler rewrites the specifier away, so a bundled copy of happy-dom would not match the string
either. Nothing above rests on it.

Why they are not cleared anyway. No in-range bump exists: 20.14.6 is the newest 20.x ever
published, so even GHSA-c8p4-j97h-3vg8's >=20.14.7 is unreachable inside ^20.9.0. The only
fix is an override to 21.0.4, which is a major past the declared range, and criterion 4 rules one
out 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 audit already measures. The audit
output above is the evidence instead. Say the word if you would rather have the guard.

Review findings acted on, both from the /code-review high pass (no pr-review-toolkit in a
routine), in e64ffe4:

  • The first draft blamed 21.0.4 on GHSA-c8p4-j97h-3vg8, whose bar is >=20.14.7 and which any
    21.x satisfies. 21.0.4 is GHSA-834v-8h66-3h79's alone. Under a "do not re-derive this" note
    that misattribution could have sent a later maintainer to ^21.0.0 with the
    host-code-execution advisory still open.
  • The same draft said 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 would parse HTML
    through it. Eight specs carry that pragma and all name jsdom. The claim is about what the app
    ships, and now says so.

Both adversarial-review findings are also built, each in its own commit:

  • ccfacf3 — the vite comment narrated the diff. "This pin no longer holds that advisory open — a
    pin one patch lower did" reads as history to anyone opening the file fresh, which
    docs/rules/code-comments.md forbids. It now states the live constraint only. fix(deps): our own override holds vite at the version a high advisory names #1066's criterion 3
    asked 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 — the happy-dom ledger carried two claims that would date: the spec count, stale on
    the ninth @vitest-environment pragma, and the .next grep withdrawn above. The entry now keeps
    the import-graph argument, the version bars and Do not re-derive, and points here for the call
    paths — the shape the braces entry above it uses.

Nothing was dismissed.

Detail

esbuild was checked, not assumed. The ticket asked for it. [email protected]'s published manifest
declares esbuild: "^0.27.0 || ^0.28.0", byte-identical to 7.3.6's, so the comment's second clause
and the esbuild: '0.28.1' entry that flattens every copy both stay true. engines
(^20.19.0 || >=22.12.0), dependencies and peerDependencies are unchanged across the patch as
well, 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 last
7.x published, and the peer cap already bars 8.

Rejected: adding happy-dom: '^21.0.4' beside nodemailer. It would clear both flags today,
and nodemailer is the precedent for taking a major deliberately. Rejected for this PR because
criterion 4 forbids it and the reachability evidence means no path needed the fix. Recorded in the
header block so the next audit-deps run 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

…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
@railway-app

railway-app Bot commented Nov 2, 2026 •

Copy link
Copy Markdown

🚅 Deployed to the SahajCloud-pr-1071 environment in sahajcloud

Service Status Web Updated
SahajCloud ✅ Success (View Logs) Web Nov 2, 2026 at 10:08 pm UTC
1 service not affected by this PR
  • mailpit

@sydevs-bot sydevs-bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

1 question for the reviewer, one per thread.

🤖 Written by the sydevs autonomous loop — see what this is


Generated by Claude Code

Comment thread pnpm-workspace.yaml Resolved
@sydevs-bot

sydevs-bot commented Nov 2, 2026 •

Copy link
Copy Markdown
Contributor Author

🤖 no session running

recent dispatches
  • 21:59Z address-review · attempt 1 · session · done
  • 21:59Z address-review · attempt 1 · session
  • 21:52Z review-pr · attempt 1 · session · done
  • 21:52Z review-pr · attempt 1 · session

Written by the sydevs dispatcher. Sessions never edit this comment.

@sydevs-bot sydevs-bot added the bot:working Lock: a cloud session is running on this item. Removed when it ends. label Nov 2, 2026
@sydevs-bot sydevs-bot moved this from Pending to Working in SYDevelopers Technical Roadmap Nov 2, 2026

@sydevs-bot sydevs-bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

🧐 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 vite comment 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 vite 7.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 for dependencies.esbuild and engines, 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-environment finds 8 spec files, all jsdom. No 7.3.6 survives outside the lockfile.
  • Preview: the health endpoint answers 200 status: ok on the new lockfile. The Events admin route answers 200.
  • Not settled: a routine clone has no node_modules, so the @lexical/headless subpath read and the .next grep were not re-run here.

🤖 Written by the sydevs autonomous loop — see what this is


Generated by Claude Code

Comment thread pnpm-workspace.yaml Resolved
Comment thread pnpm-workspace.yaml Resolved
@sydevs-bot sydevs-bot removed the bot:working Lock: a cloud session is running on this item. Removed when it ends. label Nov 2, 2026
@sydevs-bot sydevs-bot moved this from Working to Pending in SYDevelopers Technical Roadmap Nov 2, 2026
@sydevs-bot sydevs-bot added the bot:working Lock: a cloud session is running on this item. Removed when it ends. label Nov 2, 2026
@sydevs-bot sydevs-bot moved this from Pending to Working in SYDevelopers Technical Roadmap Nov 2, 2026
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
@sydevs-bot

Copy link
Copy Markdown
Contributor Author

Both adversarial-review findings are built, one commit each. Lean gate green on the merged base.

Adopted

Base — origin/main merged at 225492f, clean. The merged lockfile installs unchanged, and the audit still reports two highs, both happy-dom.

Open — the carry-or-override question waits on you.

🤖 Written by the sydevs autonomous loop — see what this is


Generated by Claude Code

@sydevs-bot sydevs-bot removed the bot:working Lock: a cloud session is running on this item. Removed when it ends. label Nov 2, 2026
@sydevs-bot sydevs-bot moved this from Working to Pending in SYDevelopers Technical Roadmap Nov 2, 2026
@sydevs-bot
sydevs-bot marked this pull request as ready for review November 2, 2026 22:18
@sydevs-bot
sydevs-bot requested a review from Ardnived November 2, 2026 22:18
@sydevs-bot
sydevs-bot enabled auto-merge November 2, 2026 22:18
@sydevs-bot sydevs-bot moved this from Pending to Awaiting in SYDevelopers Technical Roadmap Nov 2, 2026
@sydevs-bot sydevs-bot moved this from Awaiting to Pending in SYDevelopers Technical Roadmap Nov 2, 2026
@sydevs-bot
sydevs-bot added this pull request to the merge queue Nov 2, 2026
Merged via the queue into main with commit 2faaf24 Nov 2, 2026
48 of 51 checks passed
@sydevs-bot
sydevs-bot deleted the claude/fix-deps-1066-vite-override branch November 2, 2026 22:49
@sydevs-bot sydevs-bot moved this from Pending to Done in SYDevelopers Technical Roadmap Nov 2, 2026
sydevs-bot pushed a commit that referenced this pull request Nov 10, 2026
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

This branch was successfully deployed

No deployments
sahajcloud / SahajCloud-pr-1071 — 0617058a Deployed Nov 2, 2026 by railway-app[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Development

Successfully merging this pull request may close these issues.

fix(deps): our own override holds vite at the version a high advisory names

3 participants