CVE-2026-34781: Electron crashes in clipboard.readImage() on malformed clipboard image data
Impact Apps that call clipboard.readImage() may be vulnerable to a denial of service. If the system clipboard contains image data that fails to decode, the resulting null bitmap is passed unchecked to image construction, triggering a controlled abort and crashing the process.
Apps are only affected if they call clipboard.readImage(). Apps that do not read images from the clipboard are not affected. This issue does not allow memory corruption or code execution.
Workarounds Validate that the clipboard contains image data via clipboard.availableFormats() before calling clipboard.readImage(). Note this only narrows the window — upgrading to a fixed version is recommended.
Fixed Versions 42.0.0-alpha.5 41.1.0 40.8.5 39.8.5
For more information If you have any questions or comments about this advisory, email us at security@electronjs.org
Other sources
Electron is a framework for writing cross-platform desktop applications using JavaScript, HTML and CSS. Prior to 39.8.5, 40.8.5, 41.1.0, and 42.0.0-alpha.5, apps that call clipboard.readImage() may be vulnerable to a denial of service. If the system clipboard contains image data that fails to decode, the resulting null bitmap is passed unchecked to image construction, triggering a controlled abort and crashing the process. Apps are only affected if they call clipboard.readImage(). Apps that do not read images from the clipboard are not affected. This issue does not allow memory corruption or code execution. This vulnerability is fixed in 39.8.5, 40.8.5, 41.1.0, and 42.0.0-alpha.5.
— MITRE
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
npm/electronto a version that resolves this vulnerability.Fixed in 42.0.0-alpha.5 - Upgrade
Upgrade
npm/electronto a version that resolves this vulnerability.Fixed in 41.1.0 - Upgrade
Upgrade
npm/electronto a version that resolves this vulnerability.Fixed in 40.8.5 - Upgrade
Upgrade
npm/electronto a version that resolves this vulnerability.Fixed in 39.8.5 - Upgrade
Upgrade
electronto a version that resolves this vulnerability.Fixed in 39.8.5 - Upgrade
Upgrade
electronto a version that resolves this vulnerability.Fixed in 40.8.5 - Upgrade
Upgrade
electronto a version that resolves this vulnerability.Fixed in 41.1.0 - Upgrade
Upgrade
electronto a version that resolves this vulnerability.Fixed in 42.0.0-alpha.5 - Configuration
Validate that the clipboard contains image data via `clipboard.availableFormats()` before calling `clipboard.readImage()`.
Electron app using clipboard API clipboard image validation before read = Use clipboard.availableFormats() to confirm image format exists before calling clipboard.readImage()