ElectronApplication · Electronjs

CVE-2026-34780

MEDIUM · 6.1 CVSS v3.1 Published 2026-04-04
Fix available
A fix is available. Upgrade to 39.8.0 / 40.7.0 or later.
See remediation →
68/100
Remediation priority · Elevated
Remotely reachable No privileges

Official description Straight from the sourceThe vendor's or NVD's own wording, published unedited. Authoritative, but often terse — it says what broke, rarely what to do.

NVD · unedited
Electron is a framework for writing cross-platform desktop applications using JavaScript, HTML and CSS. From versions 39.0.0-alpha.1 to before 39.8.0, 40.0.0-alpha.1 to before 40.7.0, and 41.0.0-alpha.1 to before 41.0.0-beta.8, apps that pass VideoFrame objects (from the WebCodecs API) across the contextBridge are vulnerable to a context isolation bypass. An attacker who can execute JavaScript in the main world (for example, via XSS) can use a bridged VideoFrame to gain access to the isolated world, including any Node.js APIs exposed to the preload script. Apps are only affected if a preload script returns, resolves, or passes a VideoFrame object to the main world via contextBridge.exposeInMainWorld(). Apps that do not bridge VideoFrame objects are not affected. This issue has been patched in versions 39.8.0, 40.7.0, and 41.0.0-beta.8.

Technical summary Written by usOur analysis, written from the advisory, the CVSS vector and the affected-version data. It adds context the advisory leaves out, and never invents facts that are not in the source.

dbcve analysis · high confidence

Electron versions 39.x, 40.x, and 41.x-beta contain a context isolation bypass where VideoFrame objects from the WebCodecs API, when passed through contextBridge.exposeInMainWorld(), can be exploited by an attacker with JavaScript execution in the main world (e.g., via XSS) to access the isolated preload context and any exposed Node.js APIs.

MitigationUpgrade Electron to version 39.8.0, 40.7.0, or 41.0.0-beta.8 or later. Alternatively, audit and remove any VideoFrame object bridging from preload scripts if immediate upgrade is not feasible.

Verify against the referenced sources before acting — the references below are authoritative for this CVE, this summary is not.

Affected products & versions What the vendor confirmedThe version ranges the vendor confirmed as vulnerable. If your version sits inside a range here, treat yourself as exposed until you have upgraded.

NVD · CPE data
ElectronApplication
Affected:>= 39.0.0, < 39.8.0>= 40.0.0, < 40.7.0= 41.0.0

CVSS breakdown How the score is builtThe industry scoring standard. It rates how the flaw is reached, what it takes to exploit, and what an attacker gains — the score is derived from those, not the other way round.

From the vector
Attack vector
Network
Complexity
Low
Privileges
None
User interaction
Required
Scope
Changed
Confidentiality
Low
Integrity
Low
Availability
None

CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N

Am I affected? How to checkSteps we derive from the advisory and the affected-version data, so you can decide whether this CVE reaches your setup. They are a guide, not a scan — your own configuration is the authority.

dbcve checks

Work through these to decide whether this CVE applies to you.

  1. Identify installed Electron version
    Run `electron --version` in the application environment, or check the version in package.json / package-lock.json, or inspect the electron binary used at runtime
    Affected if The version is >= 39.0.0 and < 39.8.0, OR >= 40.0.0 and < 40.7.0, OR equals 41.0.0
  2. Verify context isolation is enabled
    In the main process code, check the webPreferences object passed to BrowserWindow: look for `contextIsolation: true` and `nodeIntegration: false`
    Affected if Context isolation is disabled (set to false) or not explicitly set, which would make the bypass more severe, but the vulnerability exists even when enabled due to the VideoFrame bridge flaw
  3. Examine preload scripts for VideoFrame bridging
    Locate preload script files (usually in a preload/ or similar directory) and search for `contextBridge.exposeInMainWorld()` calls. Inspect whether any expose VideoFrame objects from the WebCodecs API
    Affected if Preload scripts use contextBridge.exposeInMainWorld() to bridge VideoFrame objects to the renderer isolated world
  4. Check if WebCodecs API is accessible in renderer
    In the renderer process, verify if WebCodecs API is available by checking for the `VideoFrame` constructor or running `typeof VideoFrame` in the browser devtools console
    Affected if The renderer has access to VideoFrame from WebCodecs API and the preload script bridges it to the isolated world
  5. Audit renderer for XSS vectors
    Search the renderer code for user input handling that could lead to XSS: eval(), innerHTML assignments, script tag injection, event handlers from unsanitized input
    Affected if An XSS vulnerability exists in the renderer that could be chained with the VideoFrame bridge to achieve Node.js API access

You are affected if your Electron version falls within the affected ranges AND your preload scripts bridge VideoFrame objects through contextBridge while the renderer has an XSS vulnerability that can interact with the WebCodecs API.

Generated from the published advisory. Verify against your own configuration.

Check your environment

Paste your version and any relevant configuration and it will be compared against the affected criteria above. Do not include secrets or credentials.

AI-assisted, checked against the advisory. Informational, not a guarantee.

Remediation Closing itWhat it takes to close this. Where a vendor fix exists we point at it; where none exists we say so plainly, and can build one. Effort estimates are scoped from the advisory, not from your codebase.

dbcve · scoped
Upgrade available Upgrade to 39.8.0 / 40.7.0 or later
Fixed in 39.8.040.7.0
Interim mitigation

Upgrade Electron to version 39.8.0, 40.7.0, or 41.0.0-beta.8 or later. Alternatively, audit and remove any VideoFrame object bridging from preload scripts if immediate upgrade is not feasible.

Recommended fix High confidence

Upgrade to Electron 39.8.0 (for 39.x users), 40.7.0 (for 40.x users), or 41.0.0-beta.8 or later (for 41.x users)

  1. Identify the current Electron version by checking package.json, package-lock.json, or running 'electron --version' in the application directory
  2. If using Electron 39.x.x (>=39.0.0, <39.8.0): update the electron version in package.json to ^39.8.0 or higher
  3. If using Electron 40.x.x (>=40.0.0, <40.7.0): update the electron version in package.json to ^40.7.0 or higher
  4. If using Electron 41.0.0: update the electron version in package.json to ^41.0.0-beta.8 or higher (or await stable 41.0.0 release)
  5. Run 'npm install' or 'npm update' to install the new Electron version
  6. Test the application thoroughly, particularly any code that uses contextBridge.exposeInMainWorld() and VideoFrame objects
  7. Ensure no other dependencies are broken by the Electron version change
Caveat Review Electron changelog for breaking changes between your current version and the target fixed version; major Electron upgrades often include breaking changes to API surface and Chromium updates

Generated from the published advisory — verify against the referenced sources before acting.

Fix this in Electron Scoped from the published advisory
  • Consultation2.0 h
  • Implementation4.0 h
  • Testing4.0 h
  • Review / QA2.0 h
12.0 hours of engineering $2,080
Get the upgrade done

An estimate, not a bill — we confirm scope with you before any work starts. Need it this week? Rush from $3,328.

Scan for this in your stack

Free · runs locally
dbcve dependency scanner

Check whether your project pulls in CVE-2026-34780 — or any other known-vulnerable package — straight from your lock files. Free and open source; it runs locally and uploads nothing.

References Go to the primary sourcePrimary sources — vendor advisories, patches and trackers. Where our summary and a reference disagree, the reference wins.

Primary sources

Practitioner notes

Contributed

Peer-ranked notes from engineers who’ve handled CVE-2026-34780 in production — separate from our analysis above.

No notes yet

Be the first to add a field note for this CVE — a mitigation you’ve verified, a version caveat, or a link to a working fix. Sign in above to contribute.

What this is

A place for practitioners to share what actually worked: a mitigation you’ve tested, a configuration change, a version- or environment-specific caveat, or a link to a verified patch. The most useful notes rise to the top as peers upvote them, so the signal stays high.

What belongs here
  • Verified mitigations, workarounds, and config changes
  • Version or environment caveats, and links to real fixes
  • No weaponised exploit code, or anything meant to cause harm
  • No spam, self-promotion, credentials, or personal data