Jun 3, 2026·7 min read·2 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.
A critical OS command injection vulnerability exists in Samba's Windows Internet Name Service (WINS) server implementation when configured to run as an Active Directory Domain Controller (AD DC). Unsanitized NetBIOS name data extracted from WINS registration packets is directly concatenated into a shell command invocation and executed via Samba's wins hook parameter.
CVE-2026-41242 is a critical code injection vulnerability in protobufjs. The library compiles custom serialization functions at runtime using the `Function` constructor. Prior to versions 7.5.5 and 8.0.1, dynamic type names were not sanitized, allowing an attacker to inject arbitrary JavaScript via crafted schema definitions, leading to remote code execution.
An architectural flaw in the optional Streamable HTTP transport mode of @agenticmail/mcp allows unauthenticated remote network clients to execute administrative API commands. The server, holding the AGENTICMAIL_MASTER_KEY, functions as a confused deputy, letting attackers run privileged functions like deleting agents and establishing mail relays.
A vulnerability in the Slack and Mattermost platform adapters for NousResearch hermes-agent permits an unauthenticated remote attacker to execute arbitrary mass mentions. By leveraging prompt injection, an attacker can bypass output sanitization logic and trigger workspace-wide notification exhaustion.
CVE-2026-9306 is a critical unauthenticated Insecure Direct Object Reference (IDOR) vulnerability located in the QuantumNous new-api application, affecting versions up to and including 0.12.1. The flaw is caused by improper middleware ordering combined with a lack of object-level authorization checks. This allows remote, unauthenticated attackers to retrieve sensitive Midjourney images belonging to other users by supplying a valid task identifier.
The instagrapi library prior to version 2.6.9 contains an improper input validation vulnerability within its challenge handling mechanism. Maliciously crafted server responses can manipulate the client into forwarding session cookies and credentials to an external attacker-controlled domain.