ElectronApplication · Electronjs

CVE-2026-34777

MEDIUM · 5.4 CVSS v3.1 Published 2026-04-04
Fix available
A fix is available. Upgrade to 38.8.6 / 39.8.1 or later.
See remediation →
61/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. Prior to versions 38.8.6, 39.8.1, 40.8.1, and 41.0.0, when an iframe requests fullscreen, pointerLock, keyboardLock, openExternal, or media permissions, the origin passed to session.setPermissionRequestHandler() was the top-level page's origin rather than the requesting iframe's origin. Apps that grant permissions based on the origin parameter or webContents.getURL() may inadvertently grant permissions to embedded third-party content. The correct requesting URL remains available via details.requestingUrl. Apps that already check details.requestingUrl are not affected. This issue has been patched in versions 38.8.6, 39.8.1, 40.8.1, and 41.0.0.

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

In Electron versions prior to 38.8.6, 39.8.1, 40.8.1, and 41.0.0, when an iframe requests permissions (fullscreen, pointerLock, keyboardLock, openExternal, or media), the origin passed to session.setPermissionRequestHandler() incorrectly reflects the top-level page's origin rather than the requesting iframe's origin, potentially allowing embedded third-party content to obtain permissions intended for the parent page.

MitigationUpgrade Electron to version 38.8.6, 39.8.1, 40.8.1, or 41.0.0; alternatively, modify permission handlers to check details.requestingUrl instead of relying on the origin parameter.

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:< 38.8.6>= 39.0.0, < 39.8.1>= 40.0.0, < 40.8.1= 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
Unchanged
Confidentiality
Low
Integrity
Low
Availability
None

CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/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. Check Electron version
    Run `npm list electron` in your project directory, or check the electron version in package.json, or run `electron --version` if electron is in PATH
    Affected if The installed version is less than 38.8.6, or between 39.0.0 and 39.8.1, or between 40.0.0 and 40.8.1, or exactly 41.0.0
  2. Locate permission handler registration
    Search your codebase for `session.setPermissionRequestHandler` or `session.setPermissionCheckHandler` API calls
    Affected if A permission handler is registered in your app
  3. Inspect permission handler implementation
    Examine the handler function code and look for usage of `details.origin`, `webContents.getURL()`, or any logic that derives the requesting origin from the top-level page
    Affected if The handler uses the origin parameter or webContents.getURL() to make permission decisions rather than details.requestingUrl
  4. Identify iframe usage in the app
    Search your codebase or web content for iframe elements, especially those loading third-party or external URLs
    Affected if Your app embeds iframes, particularly ones that load untrusted third-party content
  5. Check which permissions are requested
    Review your permission handler to see if it handles fullscreen, pointerLock, keyboardLock, openExternal, or media permissions
    Affected if The handler processes any of these permission types (fullscreen, pointerLock, keyboardLock, openExternal, media) and uses top-level origin for decisions

You are affected if you run a vulnerable Electron version AND your permission handler relies on the origin parameter or webContents.getURL() to make decisions about iframe-embedded content requesting fullscreen, pointerLock, keyboardLock, openExternal, or media permissions.

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 38.8.6 / 39.8.1 / 40.8.1 or later
Fixed in 38.8.639.8.140.8.1
Interim mitigation

Upgrade Electron to version 38.8.6, 39.8.1, 40.8.1, or 41.0.0; alternatively, modify permission handlers to check details.requestingUrl instead of relying on the origin parameter.

Recommended fix High confidence

Electron 38.8.6, 39.8.1, 40.8.1, or latest stable (40.x/41.x branch)

  1. 1. Identify your current Electron version by checking your package.json or running 'electron --version'
  2. 2. Determine the appropriate target version based on your current branch: if on 37.x or earlier, target 38.8.6; if on 39.x, target 39.8.1; if on 40.x or 41.x, target 40.8.1 or latest stable
  3. 3. Update your package.json dependency: 'npm install electron@<target-version> --save-dev' or 'npm install electron@latest'
  4. 4. Run your application and test that permission requests (fullscreen, pointerLock, keyboardLock, openExternal, media) work correctly
  5. 5. If your app uses session.setPermissionRequestHandler(), verify that the origin parameter now correctly reflects the iframe's origin rather than the top-level page's origin; also check details.requestingUrl
Caveat Upgrading Electron versions may introduce breaking changes in other APIs; review Electron's changelog for your target version for any breaking changes affecting your application

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-34777 — 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-34777 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