Electron: DevTools JavaScript Injection via Unsanitized Dock State Parameter
Package
Affected versions
< 39.8.7
>= 40.0.0-alpha.1, < 40.9.0
>= 41.0.0-alpha.1, < 41.2.0
>= 42.0.0-alpha.1, < 42.0.0-beta.1
Patched versions
39.8.7
40.9.0
41.2.0
42.0.0-beta.1
Description
Published to the GitHub Advisory Database
Aug 5, 2026
Reviewed
Aug 5, 2026
Impact
The
modeoption ofwebContents.openDevTools()was not sanitized before use by the DevTools frontend. If an attacker can influence this value, script under their control may run in the DevTools context, which in unsandboxed configurations has access to Node.js.Apps are only affected if untrusted input can reach the
modeargument ofopenDevTools(), or if untrusted content can callopenDevTools()on a<webview>it embeds. Apps that only ever pass a fixed dock mode are not affected.Workarounds
Only pass fixed, allowlisted values (
right,bottom,undocked,detach) as the DevToolsmode, and do not exposeopenDevToolsto untrusted content.Fixed Versions
42.0.0-beta.141.2.040.9.039.8.7For more information
If you have any questions or comments about this advisory, email Electron at security@electronjs.org
References