Aug 5, 2026·6 min read·3 visits
Unsanitized file paths sent via DevTools IPC to the main process can trigger arbitrary code execution by exploiting OS shell file launching handlers.
A high-severity sandbox escape and arbitrary command execution vulnerability exists in the Electron desktop framework prior to versions 39.8.9, 40.9.2, 41.2.1, and 42.0.0-beta.3. The flaw lies in the handling of DevTools embedder messages during file manager reveal actions, allowing an attacker to execute arbitrary binaries with main process privileges.
The Electron desktop application framework combines Chromium and Node.js, allowing developers to build desktop applications using web technologies. To facilitate debugging and web inspection, Electron incorporates the Chromium DevTools interface. This interface interacts with the browser's main process via specialized IPC messages handled by the DevTools embedder.\n\nThe vulnerability, tracked as CVE-2026-70611, exists in the DevTools embedder message handler for the 'reveal in file manager' action, specifically within the showItemInFolder routine. Under normal conditions, this handler is meant to open the parent directory of a file and highlight it in the system file explorer.\n\nIf an attacker can execute arbitrary JavaScript within the context of the DevTools frontend, they can invoke this message handler with an arbitrary file path. Due to insufficient sanitization, the handler can be manipulated to execute arbitrary executable files on the local host. This execution occurs with the privileges of the main process, entirely bypassing the Chromium renderer sandbox.
The root cause of this vulnerability lies in a structural design flaw within the InspectableWebContents::ShowItemInFolder method. When a request to highlight an item is received, the system extracts the directory portion of the path using the DirName() method of base::FilePath. It then attempts to open the directory first using platform_util::OpenPath, which subsequently completes and invokes platform_util::ShowItemInFolder.\n\nBecause the input path is entirely user-controlled, an attacker can append a dummy path component to a target executable file path. For example, a Unix path such as /bin/sh/dummy_component yields /bin/sh when evaluated by DirName(). Similarly, on Windows, C:\\Windows\\System32\\cmd.exe\\dummy_component yields C:\\Windows\\System32\\cmd.exe when the trailing component is stripped.\n\nThe resulting path is subsequently passed directly to platform_util::OpenPath. Instead of opening a folder, this function relies on operating system shell handlers, such as ShellExecute on Windows or xdg-open on Linux, to process the path. When an executable path is passed to these handlers instead of a directory path, the operating system launches the binary as a new process.\n\nmermaid\ngraph LR\n A["Attacker Input Path"] --> B["base::FilePath::DirName()"]\n B --> C["Extracted Executable Path"]\n C --> D["platform_util::OpenPath()"]\n D --> E["Operating System Shell"]\n E --> F["Arbitrary Process Execution"]\n
A direct comparison of the vulnerable and patched code reveals how the logic was refactored to eliminate the command execution vector. In vulnerable versions of Electron, the handler was structured as follows within shell/browser/ui/inspectable_web_contents.cc:\n\ncpp\n// Vulnerable Implementation\nvoid InspectableWebContents::ShowItemInFolder(\n const std::string& file_system_path) {\n if (!pref_service_)\n return;\n\n base::FilePath path = base::FilePath::FromUTF8Unsafe(file_system_path);\n // VULNERABLE: Invokes platform_util::OpenPath on the parent directory path\n // If path is an executable with a dummy file suffix, this runs the executable\n platform_util::OpenPath(path.DirName(),\n base::BindOnce(&OnOpenItemComplete, path));\n}\n\n\nThe corresponding patch removes the call to platform_util::OpenPath and implements strict validation against the configured DevTools workspaces before calling platform_util::ShowItemInFolder directly:\n\ncpp\n// Patched Implementation\nvoid InspectableWebContents::ShowItemInFolder(\n const std::string& file_system_path) {\n if (!pref_service_)\n return;\n \n base::FilePath path = base::FilePath::FromUTF8Unsafe(file_system_path);\n\n // Only reveal paths that fall under a DevTools workspace folder the user has\n // explicitly added. The DevTools frontend is renderer-hosted and may be\n // attacker-controlled, so it must not be able to point this at arbitrary\n // filesystem locations.\n const base::Value::Dict& added_paths =\n pref_service_->GetDict(prefs::kDevToolsFileSystemPaths);\n const bool under_registered_root =\n std::ranges::any_of(added_paths, [&path](const auto& entry) {\n const base::FilePath root = base::FilePath::FromUTF8Unsafe(entry.first);\n return root == path || root.IsParent(path);\n });\n if (!under_registered_root)\n return;\n\n // FIX: Bypasses platform_util::OpenPath entirely and directly reveals the file\n platform_util::ShowItemInFolder(path);\n}\n\n\nBy replacing the indirect open-then-reveal logic with a direct invocation of ShowItemInFolder, the application ensures that the operating system only highlights the file inside the file explorer rather than executing it. Furthermore, limiting path execution to pre-registered workspace roots prevents arbitrary path traversal attacks.
To exploit this vulnerability, an attacker must first establish a vector to run arbitrary JavaScript within the DevTools frontend context. This requirement constitutes a significant operational barrier, raising the attack complexity. Common vectors include exploiting cross-site scripting (XSS) in an application webview where DevTools is programmatically exposed, or tricking a user into installing a malicious DevTools extension.\n\nOnce JavaScript execution within the DevTools context is achieved, the attacker interacts directly with the DevToolsAPI global object. This object exposes the IPC messaging framework of the renderer process, allowing direct communication with the host system's main process.\n\nThe attacker crafts a payload path pointing to a local executable binary. The path must include a trailing dummy component to exploit the DirName() parsing behavior. The following proof-of-concept script demonstrates how to trigger the vulnerability on both Windows and Unix-like operating systems:\n\njavascript\n// Construct the path targeting system binaries with a dummy suffix\nconst windowsTarget = "C:\\\\Windows\\\\System32\\\\cmd.exe\\\\dummy_file";\nconst unixTarget = "/bin/ls/dummy_file";\n\nconst payload = (navigator.platform.indexOf('Win') !== -1) ? windowsTarget : unixTarget;\n\n// Trigger the vulnerable handler by passing the crafted path via IPC\nif (typeof DevToolsAPI !== "undefined") {\n DevToolsAPI.sendMessageToEmbedder('showItemInFolder', [payload], null);\n}\n\n\nWhen the main process receives the IPC message, it processes the payload, trims the dummy segment, and runs the targeted executable outside the sandbox environment with host privileges.
The impact of CVE-2026-70611 is classified as high-severity because it facilitates a complete sandbox escape. Although Chromium utilizes a robust multi-process architecture to isolate untrusted web content within restricted renderer processes, this flaw bypasses those protections. Successfully executing code via the DevTools embedder grants the attacker the execution privileges of the host desktop application.\n\nDepending on the privileges under which the parent Electron application is running, the spawned executable runs with identical rights. On systems where the application is run with administrative or elevated privileges, the attacker gains full administrative control over the host operating system. This allows for unauthorized file system read/write operations, credential extraction, and persistent malware installation.\n\nThe vulnerability is assigned a CVSS v3.1 score of 6.9, reflecting the high complexity of obtaining initial execution within the DevTools context. However, in scenarios where applications expose DevTools interfaces to untrusted external remote content, the vulnerability effectively acts as a reliable direct-to-host execution bridge.
The primary remediation for CVE-2026-70611 is upgrading the Electron framework to a patched release. Development teams must update their project dependencies immediately to the safe versions corresponding to their active release branches. The patched versions are 39.8.9, 40.9.2, 41.2.1, and 42.0.0-beta.3.\n\nIf upgrading the framework is not immediately viable, developers can implement defensive configurations to mitigate risk. The most effective mitigation is ensuring that DevTools is strictly disabled in production builds. This can be accomplished by intercepting keyboard shortcuts and menu items that trigger the inspector interface:\n\njavascript\n// Mitigation: Disable DevTools shortcuts in production\nconst { app, BrowserWindow } = require('electron');\n\napp.on('browser-window-created', (event, window) => {\n window.webContents.on('before-input-event', (inputEvent, input) => {\n const isDevToolsShortcut = input.key === 'F12' || \n ((input.control || input.meta) && input.shift && input.key.toLowerCase() === 'i');\n if (isDevToolsShortcut) {\n inputEvent.preventDefault();\n }\n });\n});\n\n\nAdditionally, applications must enforce strict security settings. This includes enabling contextIsolation and sandbox options, while disabling nodeIntegration in all webPreferences configurations. Security teams should also monitor system process logs for anomalous process creations where command interpreters or shell binaries are spawned directly by the primary Electron application process.
CVSS:3.1/AV:L/AC:H/PR:H/UI:R/S:C/C:H/I:H/A:N| Product | Affected Versions | Fixed Version |
|---|---|---|
Electron Electron | < 39.8.9 | 39.8.9 |
Electron Electron | >= 40.0.0-alpha.1, < 40.9.2 | 40.9.2 |
Electron Electron | >= 41.0.0-alpha.1, < 41.2.1 | 41.2.1 |
Electron Electron | >= 42.0.0-alpha.1, < 42.0.0-beta.3 | 42.0.0-beta.3 |
| Attribute | Detail |
|---|---|
| CWE ID | CWE-78 |
| Attack Vector | Local (AV:L) |
| CVSS Score | 6.9 |
| EPSS Score | Not Available |
| Impact | Sandbox Escape & Arbitrary Code Execution |
| Exploit Status | Proof-of-Concept (PoC) documented |
| KEV Status | Not Listed |
The application constructs an OS command using externally-influenced input, but it does not neutralize or incorrectly neutralizes special elements that can modify the intended command.
A security vulnerability in Electron's contextBridge allows untrusted renderer contexts to bypass context isolation. By passing an object with a crafted __proto__ property, an attacker can pollute the prototype chain of objects copied into the privileged preload context. This occurs because Electron's C++ property copying layer used standard V8 property assignment, which executes prototype setters. This bypasses Electron's context isolation security boundary, potentially enabling remote code execution (RCE) or privileges escalation. The vulnerability has been addressed in Electron versions 39.8.9, 40.9.2, 41.2.2, and 42.0.0-beta.4.
Improper access control in Electron versions prior to 39.8.8, 40.9.0, 41.2.1, and 42.0.0-beta.3 allowed sandboxed iframes to bypass sandbox restrictions and trigger external application protocols on the host operating system. The application's custom permission handler was also not provided with the frame's sandbox state, preventing effective validation of the request context.
An input validation vulnerability in the Electron desktop framework allows untrusted web content running in a renderer process to inject privileged configuration options when creating child windows via window.open. Under Windows environments, this allows attackers to pass a remote Universal Naming Convention (UNC) path to the window icon configuration parameter, forcing the host system to make an SMB connection to a remote listener and leak the current user's NetNTLM authentication hash.
Electron custom schemes registered with supportFetchAPI: true but without corsEnabled: true failed to apply CORS enforcement in versions prior to 39.8.10, 40.9.3, 41.4.0, and 42.0.0. This mapping discrepancy allowed malicious remote pages to issue cross-origin requests, read sensitive local response data, and bypass Same-Origin Policy (SOP) mechanisms.
An information disclosure vulnerability in Open WebUI versions 0.10.2 and earlier allows authenticated non-admin users with read-only access (or any authenticated user when a tool is shared publicly) to retrieve the raw Python source code of custom workspace tools. Because these server-side tools commonly contain hardcoded API tokens, credentials, and proprietary logic, the exposure of raw tool source code severely compromises confidentiality and can facilitate wider infrastructure compromise.
CVE-2026-70492 (also tracked as GHSA-pwxh-7358-jq2x) is a stored Cross-Site Scripting (XSS) vulnerability in Open WebUI versions 0.10.0 through 0.10.x. The flaw arises because engine-level JavaScript stack overflow errors escape KaTeX standard error handling. Svelte's fallback rendering path assigns the raw, unescaped mathematical input string directly to the DOM using the unsafe {@html} directive, enabling arbitrary client-side code execution. This allows attackers to steal session tokens and perform unauthorized administrative actions when users view malicious messages. The vulnerability has been fully resolved in version 0.11.0.