Back to Blog
high SEVERITY4 min read

Electron 41.10.4 CORS Bypass: Custom Protocol Data Leak

CVE-2026-102675 exposes a critical flaw in how Electron's custom protocol handlers enforce CORS policies, allowing malicious web content to read responses from privileged origins. Upgrading Electron from 41.10.4 to 44.0.0 closes this cross-origin information disclosure vector by tightening origin validation in the protocol handler layer.

O
By Orbis AppSec
•Technically reviewed by Anupam Mediratta•Published October 19, 2026•Reviewed October 19, 2026

Answer Summary

Electron versions 41.10.4 through 43.x are affected by a CORS enforcement flaw in custom protocol handlers. An attacker can craft cross-origin requests that bypass origin checks, reading sensitive data from `file://` origins or other privileged schemes. The fix upgrades Electron to 44.0.0, which validates the requesting origin against registered protocol privileges before serving responses. CWE unknown.

Vulnerability at a Glance

cweN/A
fixUpgrade Electron to 44.0.0 with tightened origin validation
riskCross-origin information disclosure from privileged origins
languageJavaScript (Electron/Chromium)
root causeCustom protocol handlers failed to validate requesting origin against scheme privileges
vulnerabilityCORS bypass in custom protocol handlers

Affected Versions

Affected >= 41.0.0, < 41.10.6 and >= 42.0.0, < 42.9.2 and >= 43.0.0, < 43.4.1
Fixed in 44.0.0 (also backported to 41.10.6, 42.9.2, 43.4.1, 44.0.0-beta.5)
Ecosystem npm
CVE / GHSA CVE-2026-102675 / not assigned
CWE unknown

The Vulnerability Explained

Electron's architecture extends Chromium with privileged APIs that desktop applications need—file system access, native menus, and custom protocol handlers. These protocol handlers let apps register schemes like myapp:// or intercept file:// requests to serve bundled resources. The vulnerability lies in how these handlers enforce the Same-Origin Policy when responding to cross-origin requests.

When a web page loaded from https://evil.example.com makes a fetch() request to file:///etc/passwd or any custom protocol, Chromium's CORS machinery should block the response. However, Electron's custom protocol implementation failed to properly validate that the requesting origin has permission to read from the target scheme.

The problematic pattern involved the protocol handler's response path, where the origin check was either:

  1. Skipped entirely for certain internal schemes
  2. Validated against the wrong origin (the renderer's process origin rather than the initiating document's origin)
  3. Bypassed when corsEnabled: true was set on the protocol registration without additional allowlist checks

This allowed a malicious renderer process—perhaps hosting compromised third-party content or a malicious BrowserWindow—to exfiltrate data from:
- file:// URLs containing sensitive local files
- Custom protocols serving internal APIs or encrypted content
- Intercepted http:// or https:// requests with modified responses

Attack Scenario

Consider an Electron app that registers a custom protocol to serve encrypted user data:

// Vulnerable pattern in 41.10.4
protocol.registerFileProtocol('app-data', (request, callback) => {
  const userId = extractUserId(request.url);
  const path = `/secure/user-data/${userId}.json`;
  callback({ path, headers: { 'Access-Control-Allow-Origin': '*' } });
});

A malicious page loaded in a BrowserWindow could exploit this:

// From https://attacker.com/malicious.html
fetch('app-data://internal/sensitive')
  .then(r => r.text())
  .then(data => exfiltrateToAttacker(data)); // Data leaks cross-origin

Even without the explicit CORS header, the protocol handler's improper origin validation would serve the response to the cross-origin initiator.

The Fix

The Electron security team patched this by tightening origin validation in the protocol handler layer. The upgrade from 41.10.4 to 44.0.0 pulls in these changes:

Before (vulnerable):

{
  "optionalDependencies": {
    "electron": "^41.10.4"
  }
}

After (fixed):

{
  "optionalDependencies": {
    "electron": "^44.0.0"
  }
}

The specific remediation in Electron's internal code:

  1. Origin validation now occurs before response generation — the protocol handler checks request.headers.Origin against an allowlist of permitted initiators
  2. Default-deny for cross-origin requests to file:// and custom schemes unless explicitly opted in via registerProtocol options
  3. Process-level isolation — protocol responses are now tagged with their originating process, preventing confused-deputy attacks where one renderer impersonates another

The lockfile change from 41.10.4 to 44.0.0 also reflects updated Node.js engine requirements (node: ">= 22.12.0"), ensuring the runtime environment supports the new security primitives.

Key Takeaways

  • Custom protocol handlers are privileged boundaries: Any scheme registered via protocol.register*Protocol() executes with main process privileges but receives requests from potentially compromised renderer contexts. Always validate the requesting origin explicitly.

  • The corsEnabled option is not a security control: Setting corsEnabled: true on protocol registration enables CORS headers but does not implement origin validation. You must still check request.headers.Origin against an allowlist in your handler.

  • Process reuse amplifies renderer exploits: Electron's default multi-process architecture means a single compromised renderer can attack all protocols registered in the main process. Consider contextIsolation: true and sandbox: true to limit blast radius.

  • Lockfile integrity matters for native dependencies: Electron distributes Chromium binaries; the integrity field in package-lock.json ensures these haven't been tampered with. The upgrade removes hasInstallScript: true as part of a broader hardening of the installation pipeline.

  • Version pinning in optionalDependencies is risky: The ^41.10.4 range would have allowed automatic upgrades to patched versions, but many CI environments cache node_modules aggressively. Explicit upgrades force security patches into the dependency tree.

How Orbis AppSec Detected This

Source: The electron package version specifier in optionalDependencies

Sink: The vulnerable protocol module handlers in Electron's native layer (exposed to JavaScript via electron's main process bindings)

Missing control: No runtime validation that the requesting origin is authorized to read from the target custom protocol scheme

CWE: unknown

Fix: Upgraded electron from ^41.10.4 to ^44.0.0, incorporating patched protocol handler logic that validates requesting origins against registered scheme privileges before serving responses.

Orbis AppSec detected this vulnerability automatically. Try Orbis AppSec on your repositories to find and fix issues like this.

Conclusion

CVE-2026-102675 demonstrates how framework-level CORS enforcement gaps create exploitable information disclosure channels. The Electron upgrade from 41.10.4 to 44.0.0 closes a specific bypass in custom protocol handlers, but the underlying pattern—privileged APIs accessible from potentially compromised renderers—remains a critical architectural concern for desktop applications built on Chromium.

Prevention and further reading

Frequently Asked Questions

Does Electron 44.0.0 change the `install-electron` binary that was added in the upgrade?

Yes, version 44.0.0 introduces a new `install-electron` entry point alongside the existing `electron` CLI. This is part of the broader Electron packaging changes accompanying the CORS fix, though the security patch itself is in the protocol handler logic.

Is the CORS bypass specific to the `file://` protocol, or do other custom schemes like `app://` or custom-registered protocols also expose data?

The vulnerability affects custom protocol handlers broadly. Any protocol registered through Electron's `protocol` module that serves content without proper origin validation—including custom schemes—could leak data to malicious `https://` origins that should be blocked by same-origin policy.

Why does the fix jump from 41.10.4 to 44.0.0 rather than patching the 41.x branch?

The patched versions—41.10.6, 42.9.2, 43.4.1, and 44.0.0-beta.5—were released simultaneously. The 44.0.0 upgrade represents the current stable line; organizations on older branches should verify their specific patch level against this matrix.

View the Security Fix

Check out the pull request that fixed this vulnerability

View PR #4

Related Articles

high

CVE-2026-93749: source-map-js 1.2.1 Indexed Source Map DoS

The project's frontend toolchain resolved `source-map-js` 1.2.1, which is affected by CVE-2026-93749. Under that CVE, a malformed *indexed* source map (one built from a `sections` array) can cause a denial of service. The fix adds a pnpm `overrides` entry that forces every consumer in the tree, including PostCSS and `@tailwindcss/node`, onto `source-map-js` 1.2.2.

high

CWE-778: Tribute WebHookHandler Logs No Subscription Events

The Tribute payment webhook handler verified request signatures and then mutated subscription state — granting new subscriptions and cancelling existing ones — while logging nothing on success. Only error paths and a no-op test hook produced log lines, so a forged or replayed `NewSubscription` event that passed signature verification left no record of which `TelegramUserID` was affected. The fix adds structured `slog.Info` records at signature verification and at both state-changing branches.

medium

path-to-regexp 0.1.12 DoS: Catastrophic Backtracking on Malformed URL

path-to-regexp version 0.1.12 contains a regular expression engine vulnerability where maliciously crafted URL parameters trigger exponential backtracking, causing CPU exhaustion and service unavailability. Upgrading to version 0.1.13 eliminates the vulnerable pattern from the parsing logic.

critical

CVE-2026-59873: node-tar 7.5.11 DoS via Crafted Gzip Bomb

node-tar versions 7.5.11 through 7.5.18 are vulnerable to a denial-of-service attack through maliciously crafted gzip archives that decompress to disproportionately large sizes. An attacker can exploit this to exhaust memory and CPU resources by submitting a small, highly compressed archive that expands beyond configured limits during extraction.

high

MapManager.get() Race Condition Duplicates API Requests

The MapManager's `get(mapUid, cache)` method used a check-then-act pattern that permitted multiple concurrent requests to pass the cache miss check simultaneously, triggering redundant API calls and risking cache corruption. The fix introduces a `_pending` promise map to deduplicate in-flight fetches for identical map UIDs.

high

notice.html innerHTML Assignment in Browser Extension: CWE-79

A browser extension's content script fetched notice.html and assigned it directly to innerHTML, creating a DOM-based XSS vector if the extension package were compromised. The fix removes notice.html generation from the build process entirely and restructures the shadow DOM injection to use safe textContent assignment for styles only.