Repository navigation
build(deps-dev): bump happy-dom to 21.0.4; run the lockfile fix in a fork - #7
Merged
Merged
Conversation
…fork happy-dom 20.14.6 -> 21.0.4 closes GHSA-834v-8h66-3h79 (code injection in the ESM compiler). It is the vitest DOM only, never shipped. The major turns CSS and iframe loading off by default; the suite does not rely on either, 318/318 pass. Supersedes Dependabot's #3, whose lockfile dropped the dev flags on 86 packages. That drop is what dependabot-lockfile-fix.yml exists to repair, but its `!head.repo.fork` guard is true for every branch of a repository that is itself a fork, so the job never ran here. Compare the head repository with the base repository instead, which is what the guard meant. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
There was a problem hiding this comment.
🟡 Changes recommended
Although the change is correct and low-risk, it modifies a security-sensitive pull_request_target workflow holding a write token, which warrants human confirmation before approval.
No open issues 🎉
1 file not reviewed
src/dispatch/static/dispatch/package-lock.json: Generated file
What changed in this PR
This PR bumps the frontend dev-dependency happy-dom from 20.14.6 to 21.0.4 to close GHSA-834v-8h66-3h79 (code injection in happy-dom's ESM compiler), and fixes the dependabot-lockfile-fix workflow guard so it actually runs in a repository that is itself a fork. happy-dom only backs vitest --dom, so it is not part of the shipped UI or image, and the major-version default changes (CSS/iframe loading off) don't affect the test suite.
Changes:
- Bump
happy-domto^21.0.4inpackage.jsonand regenerate the matchingpackage-lock.jsonentry (npm-written lockfile with dev flags intact). - Replace the
!github.event.pull_request.head.repo.forkguard withhead.repo.full_name == github.repository, since theforkflag is always true on branches of a fork repository and would wrongly skip every Dependabot PR.
| File | Description |
|---|---|
src/dispatch/static/dispatch/package.json |
Updates the happy-dom devDependency range to ^21.0.4. |
src/dispatch/static/dispatch/package-lock.json |
Updates the resolved happy-dom version, URL, and integrity to 21.0.4; transitive deps already satisfy the new ranges and dev: true is retained. |
.github/workflows/dependabot-lockfile-fix.yml |
Switches the fork guard to a head.repo.full_name == github.repository comparison so the repair job runs on Dependabot PRs in a fork-of-upstream repo while still excluding external forks. |
Verification notes:
- The new workflow guard is the canonical secure pattern for
pull_request_target: same-repo (Dependabot) PRs run, external-fork PRs are excluded, and the job still checks outhead.shawithpersist-credentials: falseand--ignore-scripts, so no PR code executes with the write token. - The lockfile change is internally consistent:
entities@7.0.1,@types/ws,buffer-image-size,whatwg-mimetype, and@types/whatwg-mimetypeare all present and satisfy happy-dom 21's ranges, and the dev-flag gate (check-lock-dev-flags.mjs) expectations are preserved. - No other references to the happy-dom version exist in the repo, and the test setup (
src/tests/setup.js) does not rely on CSS/iframe loading disabled by the major bump.
Review effort: Balanced
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
happy-dom20.14.6 → 21.0.4 in the frontend devDependencies. Closes GHSA-834v-8h66-3h79 (high: code injection in happy-dom's ESM compiler). happy-dom is only the DOM behindvitest --dom; it is not part of the built UI or the image. The major disables CSS and iframe loading by default; nothing in the suite depends on either:vitest run --dom318/318 locally with this lock..github/workflows/dependabot-lockfile-fix.yml: the job guards against running with a write token on PRs from forks via!github.event.pull_request.head.repo.fork. In a repository that is itself a fork (this one is a fork of Netflix/dispatch) that flag is true for every branch, so the repair never ran here and every Dependabot frontend PR failsnpm-lock-syncandlockfileDevFlags.spec.js. Comparehead.repo.full_namewithgithub.repositoryinstead, which is what the guard meant.Why not just merge Dependabot's #3
Its lockfile was written by Dependabot's own updater and drops
"dev": trueon 86 packages, socheck-lock-dev-flags.mjsfails and so does the spec that wraps it. This PR carries the same bump with a lockfile regenerated by npm (npm install --ignore-scripts happy-dom@21.0.4): 8 lines change inpackage-lock.json, dev flags consistent,npm ci --dry-runin sync. #3 can be closed once this is in.Also done outside git: the labels Jamyn's
dependabot.ymlandenforce-labels.ymlexpect (maintenance,security,ci,breaking-change,docker,github-actions,javascript,dependencies) now exist in this repository, so Dependabot PRs stop failingenforce-label.🤖 Generated with Claude Code