Skip to content

feat(plugin-vite): derive build.target from the installed Electron version - #4411

Open
erickzhao wants to merge 7 commits into
mainfrom
claude/vite-electron-build-target
Open

erickzhao wants to merge 7 commits into
mainfrom
claude/vite-electron-build-target

Conversation

@erickzhao

@erickzhao erickzhao commented Sep 22, 2026 •

Copy link
Copy Markdown
Member
  • I have read the contribution documentation for this project.
  • I agree to follow the code of conduct that this project follows, as appropriate.
  • The changes are appropriately documented (if applicable).
  • The changes have sufficient test coverage (if applicable).
  • The testsuite passes successfully on my local machine (if applicable).

Summarize your changes:

Inspired by electron-vite, this PR dynamically changes build.target for every Electron major to keep the output JS as modern as possible based on the Electron runtime.

🤖 Generated with Claude Code

https://claude.ai/code/session_01HaWs2TmeyNyMACXbFqjixc


Generated by Claude Code

…rsion

Main and preload bundles were built for Vite's browser-oriented default
target and the renderer for a generic browser baseline, downleveling code
for engines Electron never runs. Resolve the project's Electron version
once per config generator and map its major to the Node.js and Chromium
versions it ships (table ported from electron-vite), then use those as
`build.target`. A `build.target` in the user's own Vite config still wins,
and if the Electron version cannot be resolved no target is set.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HaWs2TmeyNyMACXbFqjixc
…-chromium

The hand-copied Chromium column went stale as soon as a new Electron
major shipped: Electron 42 clamped down to chrome146 instead of its
actual chrome148. Take the Chromium major from electron-to-chromium,
which is published with every Electron release, and keep only the
Node.js column in the local table. Also correct the Electron 40 entry to
the Node.js version 40.0.0 shipped (24.11, not 24.14), fold the clamp
into the table lookup so a gap degrades to the next-lower entry instead
of dropping the targets, and mark the ConfigEnv field as internal.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HaWs2TmeyNyMACXbFqjixc
Preload scripts run in the renderer process, so they execute on
Chromium's V8, not on Electron's Node.js build. Targeting Node.js made
the bundle downlevel syntax the engine supports natively: with Electron
38 a preload got node22.19, rewriting `using` declarations even though
it runs on Chrome 140's V8. Use the Chrome target for preload instead,
overriding the Node.js default from getBuildConfig; a user-supplied
build.target still wins.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HaWs2TmeyNyMACXbFqjixc
Review found three problems with the target table and its typings:

- `forge-vite-env.d.ts` imported `ElectronTargets` from `src/`, which
  pulled `src/config/electron-targets.ts` — and with it the untyped
  `electron-to-chromium` — into every consumer's TypeScript program,
  failing `tsc` with TS7016 in a scaffolded app (the types package is a
  devDependency, and `skipLibCheck` does not cover a `.ts` file).
  Declare the shape inline in the augmentation instead.
- Electron 38.0.0 ships Node 22.18.0, not 22.19.0. Correct it, and add
  the 42, 43 and 44 entries so current releases stop clamping to 41.
  Every value is checked against `electron/electron`'s DEPS at `vX.0.0`.
- The lookup relied on the table being written newest-first, so an
  appended entry would have been silently ignored. Sort it instead, and
  say so where maintainers are told to extend it.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HaWs2TmeyNyMACXbFqjixc
Drop electron-to-chromium in favour of a Chromium column in the target
table, covering Electron 28 through 44. Also trim the comments.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HaWs2TmeyNyMACXbFqjixc
They were copied from the neighbouring fixtures and suppressed nothing
except an unused `using` binding in two files, which now returns the
binding instead.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HaWs2TmeyNyMACXbFqjixc
@erickzhao
erickzhao marked this pull request as ready for review September 22, 2026 17:59
@erickzhao
erickzhao requested a review from a team as a code owner September 22, 2026 17:59

@claude claude Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM, straightforward config-derivation feature.

Reviewed: the Electron-major-to-target lookup table and its fallback/parsing logic in electron-targets.ts, the memoized resolveElectronTargets() promise and its try/catch fallback to {} in ViteConfig.ts, and how electronTargets flows into build.target for main/preload/renderer configs. Confirmed via electron-targets.spec.ts that falling back to the newest known entry for majors beyond the table (e.g. 45, 999) is an intentional, tested behavior rather than a bug. Also confirmed user-supplied build.target in vite config still overrides the derived value.

Extended reasoning...

Self-contained feature addition to @ electron-forge/plugin-vite: a new lookup table module, wiring it into ConfigEnv via a memoized async resolver with try/catch fallback, and using the resolved target in three existing config builders. No auth, crypto, or data-exposure surface; worst-case failure mode is an unset or slightly-stale build.target, not a functional break. Test coverage is thorough (unit tests for the table plus generator-level tests covering resolution failure and user-override precedence), and the diff is small and mechanical enough that a human need not re-review.

…build-target

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KqAn7hhaB4Gc8yuAHdLF8J
@socket-security

Copy link
Copy Markdown

Warning

Review the following alerts detected in dependencies.

According to your organization's Security Policy, it is recommended to resolve "Warn" alerts. Learn more about Socket for GitHub.

Priority Alert  (click "▶" to expand/collapse) Action
Low priority
High CVE: Electron: can enable Node.js integration in Web Workers despite embedder restrictions

CVE: GHSA-9qh4-3jw8-366w Electron: can enable Node.js integration in Web Workers despite embedder restrictions (HIGH)

Affected versions: < 41.10.6; >= 42.0.0-alpha.1 < 42.9.2; >= 43.0.0-alpha.1 < 43.4.1; >= 44.0.0-alpha.1 < 44.0.0-beta.5

Patched version: 41.10.6

From: packages/plugin/vite/spec/fixtures/vite-configs-electron/package.json → npm/electron@38.0.0

ℹ Read more on: This package | This alert | What is a CVE?

Next steps: Take a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at support@socket.dev.

Suggestion: Remove or replace dependencies that include known high severity CVEs. Consumers can use dependency overrides or npm audit fix --force to remove vulnerable dependencies.

Mark the package as acceptable risk. To ignore this alert only in this pull request, reply with the comment @SocketSecurity ignore npm/electron@38.0.0. You can also ignore all packages with @SocketSecurity ignore-all. To ignore an alert for all future pull requests, use Socket's Dashboard to change the triage state of this alert.

Warn
Low priority
High CVE: Electron: Windows opened from a sandboxed top-level document do not inherit its sandbox restrictions

CVE: GHSA-gr2m-v5gq-v685 Electron: Windows opened from a sandboxed top-level document do not inherit its sandbox restrictions (HIGH)

Affected versions: < 41.10.6; >= 42.0.0-alpha.1 < 42.9.2; >= 43.0.0-alpha.1 < 43.4.1; >= 44.0.0-alpha.1 < 44.0.0-beta.5

Patched version: 41.10.6

From: packages/plugin/vite/spec/fixtures/vite-configs-electron/package.json → npm/electron@38.0.0

ℹ Read more on: This package | This alert | What is a CVE?

Next steps: Take a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at support@socket.dev.

Suggestion: Remove or replace dependencies that include known high severity CVEs. Consumers can use dependency overrides or npm audit fix --force to remove vulnerable dependencies.

Mark the package as acceptable risk. To ignore this alert only in this pull request, reply with the comment @SocketSecurity ignore npm/electron@38.0.0. You can also ignore all packages with @SocketSecurity ignore-all. To ignore an alert for all future pull requests, use Socket's Dashboard to change the triage state of this alert.

Warn
Low priority
High CVE: Electron: File and HTTP protocol handlers allow cross-origin reads without corsEnabled

CVE: GHSA-j84w-jfhq-vhvj Electron: File and HTTP protocol handlers allow cross-origin reads without corsEnabled (HIGH)

Affected versions: < 41.10.6; >= 42.0.0-alpha.1 < 42.9.2; >= 43.0.0-alpha.1 < 43.4.1; >= 44.0.0-alpha.1 < 44.0.0-beta.5

Patched version: 41.10.6

From: packages/plugin/vite/spec/fixtures/vite-configs-electron/package.json → npm/electron@38.0.0

ℹ Read more on: This package | This alert | What is a CVE?

Next steps: Take a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at support@socket.dev.

Suggestion: Remove or replace dependencies that include known high severity CVEs. Consumers can use dependency overrides or npm audit fix --force to remove vulnerable dependencies.

Mark the package as acceptable risk. To ignore this alert only in this pull request, reply with the comment @SocketSecurity ignore npm/electron@38.0.0. You can also ignore all packages with @SocketSecurity ignore-all. To ignore an alert for all future pull requests, use Socket's Dashboard to change the triage state of this alert.

Warn
Low priority
High CVE: Electron drops inherited HTML sandbox restrictions for popups opened through OpenURLFromTab

CVE: GHSA-hq2x-r82h-9wj4 Electron drops inherited HTML sandbox restrictions for popups opened through OpenURLFromTab (HIGH)

Affected versions: < 41.10.4; >= 42.0.0-alpha.1 < 42.5.2; >= 43.0.0-alpha.1 < 43.0.0

Patched version: 41.10.4

From: packages/plugin/vite/spec/fixtures/vite-configs-electron/package.json → npm/electron@38.0.0

ℹ Read more on: This package | This alert | What is a CVE?

Next steps: Take a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at support@socket.dev.

Suggestion: Remove or replace dependencies that include known high severity CVEs. Consumers can use dependency overrides or npm audit fix --force to remove vulnerable dependencies.

Mark the package as acceptable risk. To ignore this alert only in this pull request, reply with the comment @SocketSecurity ignore npm/electron@38.0.0. You can also ignore all packages with @SocketSecurity ignore-all. To ignore an alert for all future pull requests, use Socket's Dashboard to change the triage state of this alert.

Warn
Low priority
High CVE: Electron: Sandboxed iframe can bypass the allow-popups restriction via the OpenURL navigation path

CVE: GHSA-9f4c-93c8-jc8g Electron: Sandboxed iframe can bypass the allow-popups restriction via the OpenURL navigation path (HIGH)

Affected versions: >= 42.0.0-alpha.1 < 42.0.1; >= 40.0.0-alpha.1 < 41.10.3; < 39.8.10

Patched version: 39.8.10

From: packages/plugin/vite/spec/fixtures/vite-configs-electron/package.json → npm/electron@38.0.0

ℹ Read more on: This package | This alert | What is a CVE?

Next steps: Take a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at support@socket.dev.

Suggestion: Remove or replace dependencies that include known high severity CVEs. Consumers can use dependency overrides or npm audit fix --force to remove vulnerable dependencies.

Mark the package as acceptable risk. To ignore this alert only in this pull request, reply with the comment @SocketSecurity ignore npm/electron@38.0.0. You can also ignore all packages with @SocketSecurity ignore-all. To ignore an alert for all future pull requests, use Socket's Dashboard to change the triage state of this alert.

Warn
Low priority
High CVE: Electron: Context isolation bypass via Function.prototype.bind hijack

CVE: GHSA-h7rp-cf8h-j98x Electron: Context isolation bypass via Function.prototype.bind hijack (HIGH)

Affected versions: < 39.8.9; >= 40.0.0-alpha.1 < 40.9.2; >= 41.0.0-alpha.1 < 41.2.2; >= 42.0.0-alpha.1 < 42.0.0-beta.5

Patched version: 39.8.9

From: packages/plugin/vite/spec/fixtures/vite-configs-electron/package.json → npm/electron@38.0.0

ℹ Read more on: This package | This alert | What is a CVE?

Next steps: Take a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at support@socket.dev.

Suggestion: Remove or replace dependencies that include known high severity CVEs. Consumers can use dependency overrides or npm audit fix --force to remove vulnerable dependencies.

Mark the package as acceptable risk. To ignore this alert only in this pull request, reply with the comment @SocketSecurity ignore npm/electron@38.0.0. You can also ignore all packages with @SocketSecurity ignore-all. To ignore an alert for all future pull requests, use Socket's Dashboard to change the triage state of this alert.

Warn
Low priority
High CVE: Electron: Use-after-free in offscreen child window paint callback

CVE: GHSA-532v-xpq5-8h95 Electron: Use-after-free in offscreen child window paint callback (HIGH)

Affected versions: < 39.8.1; >= 40.0.0-alpha.1 < 40.7.0; >= 41.0.0-alpha.1 < 41.0.0

Patched version: 39.8.1

From: packages/plugin/vite/spec/fixtures/vite-configs-electron/package.json → npm/electron@38.0.0

ℹ Read more on: This package | This alert | What is a CVE?

Next steps: Take a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at support@socket.dev.

Suggestion: Remove or replace dependencies that include known high severity CVEs. Consumers can use dependency overrides or npm audit fix --force to remove vulnerable dependencies.

Mark the package as acceptable risk. To ignore this alert only in this pull request, reply with the comment @SocketSecurity ignore npm/electron@38.0.0. You can also ignore all packages with @SocketSecurity ignore-all. To ignore an alert for all future pull requests, use Socket's Dashboard to change the triage state of this alert.

Warn
Low priority
High CVE: Electron: Use-after-free in WebContents fullscreen, pointer-lock, and keyboard-lock permission callbacks

CVE: GHSA-8337-3p73-46f4 Electron: Use-after-free in WebContents fullscreen, pointer-lock, and keyboard-lock permission callbacks (HIGH)

Affected versions: < 38.8.6; >= 39.0.0-alpha.1 < 39.8.0; >= 40.0.0-alpha.1 < 40.7.0; >= 41.0.0-alpha.1 < 41.0.0-beta.8

Patched version: 38.8.6

From: packages/plugin/vite/spec/fixtures/vite-configs-electron/package.json → npm/electron@38.0.0

ℹ Read more on: This package | This alert | What is a CVE?

Next steps: Take a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at support@socket.dev.

Suggestion: Remove or replace dependencies that include known high severity CVEs. Consumers can use dependency overrides or npm audit fix --force to remove vulnerable dependencies.

Mark the package as acceptable risk. To ignore this alert only in this pull request, reply with the comment @SocketSecurity ignore npm/electron@38.0.0. You can also ignore all packages with @SocketSecurity ignore-all. To ignore an alert for all future pull requests, use Socket's Dashboard to change the triage state of this alert.

Warn
Low priority
High CVE: Electron: Renderer command-line switch injection via undocumented commandLineSwitches webPreference

CVE: GHSA-9wfr-w7mm-pc7f Electron: Renderer command-line switch injection via undocumented commandLineSwitches webPreference (HIGH)

Affected versions: < 38.8.6; >= 39.0.0-alpha.1 < 39.8.0; >= 40.0.0-alpha.1 < 40.7.0; >= 41.0.0-alpha.1 < 41.0.0-beta.8

Patched version: 38.8.6

From: packages/plugin/vite/spec/fixtures/vite-configs-electron/package.json → npm/electron@38.0.0

ℹ Read more on: This package | This alert | What is a CVE?

Next steps: Take a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at support@socket.dev.

Suggestion: Remove or replace dependencies that include known high severity CVEs. Consumers can use dependency overrides or npm audit fix --force to remove vulnerable dependencies.

Mark the package as acceptable risk. To ignore this alert only in this pull request, reply with the comment @SocketSecurity ignore npm/electron@38.0.0. You can also ignore all packages with @SocketSecurity ignore-all. To ignore an alert for all future pull requests, use Socket's Dashboard to change the triage state of this alert.

Warn
Low priority
High CVE: Electron: Use-after-free in PowerMonitor on Windows and macOS

CVE: GHSA-jjp3-mq3x-295m Electron: Use-after-free in PowerMonitor on Windows and macOS (HIGH)

Affected versions: < 38.8.6; >= 39.0.0-alpha.1 < 39.8.1; >= 40.0.0-alpha.1 < 40.8.0; >= 41.0.0-alpha.1 < 41.0.0-beta.8

Patched version: 38.8.6

From: packages/plugin/vite/spec/fixtures/vite-configs-electron/package.json → npm/electron@38.0.0

ℹ Read more on: This package | This alert | What is a CVE?

Next steps: Take a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at support@socket.dev.

Suggestion: Remove or replace dependencies that include known high severity CVEs. Consumers can use dependency overrides or npm audit fix --force to remove vulnerable dependencies.

Mark the package as acceptable risk. To ignore this alert only in this pull request, reply with the comment @SocketSecurity ignore npm/electron@38.0.0. You can also ignore all packages with @SocketSecurity ignore-all. To ignore an alert for all future pull requests, use Socket's Dashboard to change the triage state of this alert.

Warn
Low priority
High CVE: Electron: Custom protocol with supportFetchAPI but not corsEnabled allows cross-origin reads

CVE: GHSA-v3j7-r9gq-3gjw Electron: Custom protocol with supportFetchAPI but not corsEnabled allows cross-origin reads (HIGH)

Affected versions: >= 42.0.0-alpha.1 < 42.0.0; >= 41.0.0-alpha.1 < 41.4.0; >= 40.0.0-alpha.1 < 40.9.3; < 39.8.10

Patched version: 39.8.10

From: packages/plugin/vite/spec/fixtures/vite-configs-electron/package.json → npm/electron@38.0.0

ℹ Read more on: This package | This alert | What is a CVE?

Next steps: Take a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at support@socket.dev.

Suggestion: Remove or replace dependencies that include known high severity CVEs. Consumers can use dependency overrides or npm audit fix --force to remove vulnerable dependencies.

Mark the package as acceptable risk. To ignore this alert only in this pull request, reply with the comment @SocketSecurity ignore npm/electron@38.0.0. You can also ignore all packages with @SocketSecurity ignore-all. To ignore an alert for all future pull requests, use Socket's Dashboard to change the triage state of this alert.

Warn
Low priority
High CVE: Electron: can enable Node.js integration in Web Workers despite embedder restrictions

CVE: GHSA-9qh4-3jw8-366w Electron: can enable Node.js integration in Web Workers despite embedder restrictions (HIGH)

Affected versions: < 41.10.6; >= 42.0.0-alpha.1 < 42.9.2; >= 43.0.0-alpha.1 < 43.4.1; >= 44.0.0-alpha.1 < 44.0.0-beta.5

Patched version: 42.9.2

From: packages/plugin/vite/spec/fixtures/subprocess-build-electron/package.json → npm/electron@42.3.3

ℹ Read more on: This package | This alert | What is a CVE?

Next steps: Take a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at support@socket.dev.

Suggestion: Remove or replace dependencies that include known high severity CVEs. Consumers can use dependency overrides or npm audit fix --force to remove vulnerable dependencies.

Mark the package as acceptable risk. To ignore this alert only in this pull request, reply with the comment @SocketSecurity ignore npm/electron@42.3.3. You can also ignore all packages with @SocketSecurity ignore-all. To ignore an alert for all future pull requests, use Socket's Dashboard to change the triage state of this alert.

Warn
Low priority
High CVE: Electron: Windows opened from a sandboxed top-level document do not inherit its sandbox restrictions

CVE: GHSA-gr2m-v5gq-v685 Electron: Windows opened from a sandboxed top-level document do not inherit its sandbox restrictions (HIGH)

Affected versions: < 41.10.6; >= 42.0.0-alpha.1 < 42.9.2; >= 43.0.0-alpha.1 < 43.4.1; >= 44.0.0-alpha.1 < 44.0.0-beta.5

Patched version: 42.9.2

From: packages/plugin/vite/spec/fixtures/subprocess-build-electron/package.json → npm/electron@42.3.3

ℹ Read more on: This package | This alert | What is a CVE?

Next steps: Take a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at support@socket.dev.

Suggestion: Remove or replace dependencies that include known high severity CVEs. Consumers can use dependency overrides or npm audit fix --force to remove vulnerable dependencies.

Mark the package as acceptable risk. To ignore this alert only in this pull request, reply with the comment @SocketSecurity ignore npm/electron@42.3.3. You can also ignore all packages with @SocketSecurity ignore-all. To ignore an alert for all future pull requests, use Socket's Dashboard to change the triage state of this alert.

Warn
Low priority
High CVE: Electron drops inherited HTML sandbox restrictions for popups opened through OpenURLFromTab

CVE: GHSA-hq2x-r82h-9wj4 Electron drops inherited HTML sandbox restrictions for popups opened through OpenURLFromTab (HIGH)

Affected versions: < 41.10.4; >= 42.0.0-alpha.1 < 42.5.2; >= 43.0.0-alpha.1 < 43.0.0

Patched version: 42.5.2

From: packages/plugin/vite/spec/fixtures/subprocess-build-electron/package.json → npm/electron@42.3.3

ℹ Read more on: This package | This alert | What is a CVE?

Next steps: Take a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at support@socket.dev.

Suggestion: Remove or replace dependencies that include known high severity CVEs. Consumers can use dependency overrides or npm audit fix --force to remove vulnerable dependencies.

Mark the package as acceptable risk. To ignore this alert only in this pull request, reply with the comment @SocketSecurity ignore npm/electron@42.3.3. You can also ignore all packages with @SocketSecurity ignore-all. To ignore an alert for all future pull requests, use Socket's Dashboard to change the triage state of this alert.

Warn
Low priority
High CVE: Electron: File and HTTP protocol handlers allow cross-origin reads without corsEnabled

CVE: GHSA-j84w-jfhq-vhvj Electron: File and HTTP protocol handlers allow cross-origin reads without corsEnabled (HIGH)

Affected versions: < 41.10.6; >= 42.0.0-alpha.1 < 42.9.2; >= 43.0.0-alpha.1 < 43.4.1; >= 44.0.0-alpha.1 < 44.0.0-beta.5

Patched version: 42.9.2

From: packages/plugin/vite/spec/fixtures/subprocess-build-electron/package.json → npm/electron@42.3.3

ℹ Read more on: This package | This alert | What is a CVE?

Next steps: Take a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at support@socket.dev.

Suggestion: Remove or replace dependencies that include known high severity CVEs. Consumers can use dependency overrides or npm audit fix --force to remove vulnerable dependencies.

Mark the package as acceptable risk. To ignore this alert only in this pull request, reply with the comment @SocketSecurity ignore npm/electron@42.3.3. You can also ignore all packages with @SocketSecurity ignore-all. To ignore an alert for all future pull requests, use Socket's Dashboard to change the triage state of this alert.

Warn
Low priority
High CVE: Electron: Sandboxed preload code cache can be poisoned by a compromised renderer

CVE: GHSA-qmv3-fv6v-rmhq Electron: Sandboxed preload code cache can be poisoned by a compromised renderer (HIGH)

Affected versions: >= 42.3.3 < 42.10.0; >= 43.0.0-beta.1 < 43.5.0; >= 44.0.0-alpha.1 < 44.0.0-beta.6

Patched version: 42.10.0

From: packages/plugin/vite/spec/fixtures/subprocess-build-electron/package.json → npm/electron@42.3.3

ℹ Read more on: This package | This alert | What is a CVE?

Next steps: Take a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at support@socket.dev.

Suggestion: Remove or replace dependencies that include known high severity CVEs. Consumers can use dependency overrides or npm audit fix --force to remove vulnerable dependencies.

Mark the package as acceptable risk. To ignore this alert only in this pull request, reply with the comment @SocketSecurity ignore npm/electron@42.3.3. You can also ignore all packages with @SocketSecurity ignore-all. To ignore an alert for all future pull requests, use Socket's Dashboard to change the triage state of this alert.

Warn

View full report

Copy link
Copy Markdown
Member Author

Re the Socket alerts on electron@38.0.0: that version only appears as a string in the test fixture packages/plugin/vite/spec/fixtures/vite-configs-electron/package.json. The fixture isn't a workspace, yarn.lock has no electron@38 entry, and nothing installs or runs it. The spec only reads the exact version from devDependencies to check the Electron 38 → node22.18 / chrome140 mapping. Every 38.x release is in the affected ranges, so moving to a patched version would mean dropping the 38 case. I'm leaving it as is. A maintainer can run @SocketSecurity ignore npm/electron@38.0.0 if the warning should be cleared.


Generated by Claude Code

@claude claude Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

No new blocking issues. 1 optional suggestion (a nit or a note on pre-existing code) was found and not posted. Nothing in this review needs a push before merging.

This branch has not been deployed

No deployments
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.

2 participants