Jun 3, 2026·7 min read·10 visits
ViteJS launch-editor before version 2.9.0 on Windows fails to validate line numbers parsed from filenames, allowing remote attackers to trigger arbitrary command execution on developer workstations via cross-origin HTTP requests targeting the local development server.
CVE-2024-52011 is a critical command injection vulnerability in the ViteJS launch-editor utility (versions prior to 2.9.0) affecting Windows environments. Unsanitized command-line arguments can lead to remote code execution on a developer workstation via cross-origin requests targeting the local development server.
The ViteJS launch-editor utility is designed to streamline the developer experience by allowing editors to open files directly from the browser devtools interface. When a developer clicks on an error or file stack trace, a request is sent to an endpoint hosted by the Vite local development server. This endpoint parses the file location and line number before launching the configured text editor.
On Windows systems, executing the editor program requires constructing a command string that is parsed by the Windows command processor, cmd.exe. Because these server endpoints are accessible to local network interfaces, they are highly exposed to web-based attack vectors. The utility relies on strict input validation to prevent arbitrary commands from being executed within the command shell context.
This vulnerability, tracked as CVE-2024-52011, arises from an incomplete input validation model where file parameters are split into separate components. While the file path itself is verified against a strict character allowlist, the associated line and column parameters bypass validation entirely. This omission allows an external attacker to supply shell control characters through the line number field, resulting in remote code execution on the host system.
The root cause of CVE-2024-52011 lies in the design of the file parsing and validation sequence within launch-editor. When a request is received, the package uses parseFile() to extract the filename, line number, and column number. This splitting is performed by looking for the : separator commonly used in compiler error outputs (such as filename.js:10:5).
To prevent command injection on Windows systems, the utility implements WINDOWS_CMD_SAFE_FILE_NAME_PATTERN. This regular expression is designed to permit only safe characters, including alphanumeric values, slashes, periods, and hyphens. However, the application only runs the regex test against the extracted fileName variable, while the extracted lineNumber and columnNumber variables are excluded from any structural validation.
On Windows, the package spawns the text editor using childProcess.spawn('cmd.exe', ['/C', editor].concat(args)). Because Node.js translates array-based arguments into a single command-line string for execution, special command prompt rules apply. The shell processes symbols like &, |, and > as execution operators rather than literal values, and because the line number is passed without escaping, an attacker can append command operators that force the shell to execute arbitrary payloads.
The diagram below outlines the structural processing of the exploit request. The attack begins with a cross-origin HTTP request originating from a web browser, targeting the developer's local network loopback port where Vite is running.
As the flowchart demonstrates, the system's defenses fail because the path validation and parameter assembly operations run in parallel without a unified integrity check. The validation check acts as a gateway for the filename, but it remains blind to the payload embedded in the line number.
In vulnerable versions of the package (prior to 2.9.0), the parameter handling sequence exposes the line number directly to the arguments array. Below is the vulnerable representation of the file parsing and processing loop:
// Vulnerable code in launch-editor
let [fileName, lineNumber, columnNumber] = parseFile(fileInput);
// The file path is checked against the safe pattern
if (process.platform === 'win32' && !WINDOWS_CMD_SAFE_FILE_NAME_PATTERN.test(fileName.trim())) {
return; // Abort if fileName contains dangerous shell characters
}
// The unsanitized lineNumber is appended directly to arguments
if (lineNumber) {
args.push('-g', `${fileName}:${lineNumber}`);
}The fix implemented in version 2.9.0 (commit 971291e8a6a91226e1616c5c0ec85423d2d50a5e) removes the incomplete file path allowlist pattern. It replaces it with a dedicated shell character escaping function (escapeCmdArgs) and a quoting wrapper (doubleQuoteIfNeeded):
// Patched command-line escaping implementation
function escapeCmdArgs(cmdArgs) {
// Escapes control operators with a caret (^)
return cmdArgs.replace(/([&|<>,;=^])/g, '^$1');
}
function doubleQuoteIfNeeded(str) {
if (str.includes('^')) {
// If a string contains escaped characters, the quotes themselves must be escaped
return `^"${str}^"`;
} else if (str.includes(' ')) {
return `"${str}"`;
}
return str;
}
// Assembly of the launch command and execution
const launchCommand = [editor, ...args.map(escapeCmdArgs)]
.map(doubleQuoteIfNeeded)
.join(' ');
_childProcess = childProcess.exec(launchCommand, { shell: true });Exploitation of CVE-2024-52011 relies on a client-side delivery mechanism known as local port scanning and cross-origin request abuse. Because developer tools bind HTTP servers to loopback ports such as 5173 or 3000, any website rendered in a browser on the same host can attempt to make HTTP connections to these local ports using simple asynchronous requests.
To mount a successful attack, a malicious actor hosts a web page containing cross-origin scripts. When a developer visits this page, the script executes a loop sending HTTP requests to known local development ports. These requests target the internal editor endpoints, utilizing payloads specifically crafted to inject characters such as & into the parameter fields.
For example, an attacker can supply the query parameter file=src/index.js:10 & calc.exe. The target server parses src/index.js as the filename, which passes the regular expression check. The trailing string 10 & calc.exe is interpreted as the line number. When spawned on Windows using cmd.exe /C, the command processor interprets the & symbol as a command concatenator, resulting in the simultaneous launch of the editor and the execution of calc.exe with the permissions of the current logged-in developer.
Although the patch introduced in version 2.9.0 mitigates immediate exploits using common control characters like & and |, a closer examination of the escaping design reveals potential weaknesses. The utility transitions from a strict allowlist input validation approach to an escaping-based blocklist approach. Historically, blocklists on Windows command shells are prone to bypasses due to the parser's complexity.
The implemented regex in escapeCmdArgs targets specific characters: /([&|<>,;=^])/g. Notably, it does not escape the newline or line feed character (\n, 0x0a). In Windows cmd.exe, a raw newline character acts as an active command terminator, equivalent to the & operator or a newline in Unix shells.
Furthermore, environment variable expansion characters (%) are left unescaped. This omission means an attacker can still pass environmental variables that are parsed and expanded within the command shell context. Organizations should rely on network and application-level isolation to fully secure developer environments rather than relying solely on the sanitization layer of the development tools.
Remediation requires updating all instances of launch-editor to version 2.9.0 or higher. For downstream developers running the Vite build tool, Vite must be updated to version 5.4.9 or higher to pull in the fixed dependency. This update eliminates the vulnerable command generation sequence and enforces the argument escaping logic.
In addition to software updates, development teams should implement defensive measures at the browser and system levels. Restricting cross-origin requests targeting localhost is recommended. This restriction can be achieved by utilizing browser configurations or security policies that deny cross-origin resource sharing to loopback addresses.
Finally, ensuring that development servers validate the Host header of incoming requests reduces the risk of DNS rebinding attacks. Validating that requests originating from external domains are rejected preventing attackers from proxying requests to the local editor endpoints.
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:H/I:H/A:H| Product | Affected Versions | Fixed Version |
|---|---|---|
launch-editor ViteJS | < 2.9.0 | 2.9.0 |
vite ViteJS | < 5.4.9 | 5.4.9 |
| Attribute | Detail |
|---|---|
| CWE ID | CWE-77 |
| Attack Vector | Network / Cross-Origin HTTP Request |
| CVSS Score | 7.5 (High) |
| EPSS Score | 0.0006 |
| Impact | Remote Code Execution (RCE) |
| Exploit Status | Proof-of-Concept Available |
| KEV Status | Not Listed |
The application constructs an OS command using externally-influenced input, but fails to neutralize or incorrectly neutralizes special elements that can modify the intended command.
CVE-2024-29203 identifies a cross-site scripting (XSS) vulnerability in the content ingestion and parsing mechanics of TinyMCE rich text editor. Due to a failure to enforce sandbox attributes on dynamic iframe elements and safely handle legacy embed objects, unauthenticated attackers can inject malicious elements that execute scripts within the context of the parent application session.
A technical breakdown of the OS command injection vulnerability in the shell-quote NPM package (CVE-2026-9277 / GHSA-w7jw-789q-3m8p). The bug resides in the character-by-character backslash-escaping logic applied to the .op field of object-tokens within the quote() function, which fails to match and escape line terminators due to a regex matching oversight in JavaScript. This allows unauthenticated remote attackers to execute arbitrary shell commands if they can control inputs processed by this library.
A high-severity memory corruption vulnerability exists in the V8 JavaScript engine of Google Chrome before versions 149.0.7827.102/103. The flaw arises from an incorrect bounds-check elimination during JIT compilation by the TurboFan optimizer, allowing remote attackers to achieve out-of-bounds read and write access inside the sandboxed renderer process.
An improper authentication vulnerability (CWE-287) exists in the legacy, deprecated Internet Key Exchange version 1 (IKEv1) key exchange protocol implementation in Check Point Security Gateways. The vulnerability is caused by a logic flow weakness during the certificate validation process for Remote Access VPN and Mobile Access (SSL VPN) connections. An unauthenticated remote attacker can exploit this weakness to bypass user authentication entirely, establishing a fully functional Remote Access VPN connection without a valid password.
GeoNode versions prior to 4.4.5 and 5.0.2 are vulnerable to Server-Side Request Forgery (SSRF) in the service registration endpoint. Authenticated attackers with low privileges can exploit insufficient input validation in the Web Map Service (WMS) registration module to force the application server to make outbound network queries to loopback addresses, private RFC1918 subnets, link-local scopes, and cloud metadata endpoints. This technical report details the mechanics of the vulnerability, the underlying architectural flaw, and how to effectively remediate and mitigate the associated security risks.
CVE-2022-0492 is a high-severity missing authorization vulnerability in the Linux kernel's Control Groups (cgroups) v1 implementation. The flaw resides within the cgroup_release_agent_write function in kernel/cgroup/cgroup-v1.c, where the kernel fails to validate if the process writing to the release_agent file possesses administrative capabilities in the initial user namespace. This allows a local attacker inside a container with root privileges (UID 0) to abuse user namespaces, mount a cgroups v1 directory, modify the release_agent parameter, and execute arbitrary commands on the host system as host root, effectively achieving a complete container escape.