Public research

launch-editor

CVE-2026-112943 · GHSA-698v-4r3x-3vcv
Windows command expansion bypasses filename escaping

Medium, 6.3 (CVSS 4.0) · Public source snapshot: November 12, 2026

Original portfolio report · Source reference · Source reference · Source reference · Source reference · Source reference · Upstream commit · Upstream commit · Public advisory · CVE record

Shared credits and the scope of my investigation are documented below.

Mallory can turn a filename into an extra Windows command when she can place the required file, influence the filename passed to launchEditor, and supply the environment-variable or NTFS alternate-data-stream conditions described by upstream. The intended operation is opening that file in Alice's editor; the failure lets Windows command interpretation change the operation. This is not an arbitrary network request becoming a shell by itself: the existing-file check and the additional attacker-controlled state are essential prerequisites.

The published advisory, GHSA-698v-4r3x-3vcv, now maps to CVE-2026-112943, assigned October 20, 2026. It rates the issue Medium, CVSS v4.0 6.3, lists launch-editor through 2.14.1 as affected, and identifies 2.14.2 as fixed. I am credited as a co-reporter, alongside iaohkut-from-NightWolf-Team and Rikuxx0; bluwy is credited as remediation reviewer.

I reviewed the public advisory, the affected and fixed release sources, the introducing change and the released tags. I did not execute the supplied trigger or run Windows exploit or regression tests. The exact missing-percent-escaping implementation is present in the inspected releases 2.9.0–2.14.1; this narrower source-history result is separate from the advisory's broader affected range.

launch-editor opens a source file in a developer's editor. A framework or application supplies a file argument and may supply an editor. On Windows, version 2.14.1 builds a command string and calls Node.js child_process.exec, which introduces Windows shell parsing. The selected editor and its ordinary options are not treated as attacker-controlled in this report.

Alice runs the consuming application on Windows. Mallory must be able to place an existing file with the relevant special-character filename and get the application to pass it to launchEditor. Upstream additionally requires malicious environment-variable control or an NTFS alternate-data-stream arrangement. Those capabilities depend on the consuming application and workspace workflow; this review did not establish that a default network-facing application supplies them.

The expected boundary is straightforward: a filename must remain a filename when it crosses into the command interpreter. Checking whether that file exists does not establish that the command interpreter will preserve its literal spelling.

In 2.14.1, packages/launch-editor/index.js, launchEditor parses the optional line and column suffix and checks the resulting filename before constructing editor arguments:

if (!fs.existsSync(fileName)) {
  return
}

This is a meaningful guard: a fabricated string for a nonexistent file stops here. Windows UNC paths are also rejected. Neither guard answers whether a valid local filename contains command-interpreter expansion syntax.

The Windows-specific escapeCmdArgs function in the same release is:

function escapeCmdArgs(cmdArgs) {
  return cmdArgs.replace(/([&|<>,;=^])/g, '^$1')
}

The expression escapes several shell metacharacters but does not match %. The surrounding comments mention percent signs, but the executable pattern omits them. We then carry those incompletely escaped arguments into the command string:

const launchCommand = [editor, ...args.map(escapeCmdArgs)].map(doubleQuoteIfNeeded).join(' ')

currentChildProcess = childProcess.exec(launchCommand, {
  stdio: 'inherit',
  shell: true,
})

The quoting helper adds quotes for spaces or caret-containing strings. It does not reject percent expressions. As upstream explains, CMD expansion can interpret %VAR% and modifier expressions before consuming caret escapes. If the expansion introduces command syntax, escaping the original filename's literal characters is not sufficient: the dangerous characters can arrive later, through expansion.

The advisory describes an environment-variable route and alternate-data-stream variants. In the environment-variable route, the literal existing filename contains a variable reference while the inherited variable supplies command syntax. File existence is established for the literal input, but the shell later interprets an expanded command string. The alternate-data-stream route supplies a Windows-specific way to meet the filename and expansion prerequisites; it is not evidence that an attacker needs no filesystem control.

Release history

The Windows escaping change, 971291e8, replaced a restrictive filename allowlist with caret escaping to support framework routing characters. The preceding released source, 2.8.2, rejects filenames containing % through that allowlist. 2.9.0 contains the new helper with the omission.

Every published tag inspected from 2.9.0 through 2.14.1 retains that helper: 2.9.0, 2.9.1, 2.10.0, 2.11.0, 2.11.1, 2.12.0, 2.13.0, 2.13.1, 2.13.2, 2.14.0 and 2.14.1. Version 2.14.2 rejects the unsafe argument before command execution. This establishes the history of the specific implementation analyzed here; it does not independently clear older releases that used other Windows command-construction code. For upgrade decisions, the upstream advisory remains the authoritative affected-package guidance.

The established primitive is command injection into the Windows editor-launch command under the stated filesystem and expansion prerequisites. Any resulting command runs with the launching process's privileges; neither the inspected source nor this review demonstrates administrator privilege escalation.

The filename-existence check rules out a plain arbitrary nonexistent string. The attack also requires the consuming application to reach the editor-launch operation with the controlled file. An application that does not expose that operation to Mallory, rejects attacker-supplied paths earlier, or prevents the required filesystem/environment control can stop the described chain. Non-Windows launches use the separate spawn(editor, args, ...) branch and are outside this CMD expansion issue.

No positive or negative runtime controls were performed. An isolated Windows validation would need to compare an ordinary existing filename, a nonexistent filename, the advisory's existing-file trigger with its expansion prerequisite, the same input without that prerequisite, and the fixed release. Checking only the escaped command string would not substitute for observing the real command-interpreter behavior.

The upstream advisory publishes the trigger descriptions and example filename/expansion combinations. I inspected those descriptions against the source but did not execute them. No reproduced output, exploit script or successful fixed-target run is claimed here.

The public fix tests contain cases for percent signs, CMD variable modifiers, carriage returns and line feeds. Their presence is source evidence of intended regression coverage, not a statement that I ran the suite. Because the trigger can execute commands with the developer process's access, any reproduction belongs in a disposable Windows environment with no sensitive workspace or credentials.

Upgrade launch-editor to 2.14.2 or later. The fix, 3c2f9bf2, does not try to preserve percent expressions through another escaping pass. In 2.14.2, packages/launch-editor/construct-windows-launch-command.js, command construction rejects them:

if (args.some((arg) => arg.includes('%'))) {
  throw new Error('Cannot launch an editor with an argument containing "%"')
}

It also rejects carriage returns and line feeds, because CMD treats line breaks as command separators and alternate-data-stream names can introduce inputs that ordinary filename assumptions miss. launchEditor catches the construction error and returns before calling exec. The fix therefore changes the boundary from incomplete escaping to explicit rejection of inputs whose shell interpretation cannot safely preserve the intended argument.

Consumers should update the dependency actually resolved in their lockfile rather than assuming a top-level package version selects the fixed copy. The advisory lists downstream Vite fixes in 8.3.3, 8.2.4, 8.1.6, 7.3.7 and 6.4.4 for its respective maintained version ranges, and vite-plus 1.1.0. These are upstream advisory mappings, not independently inspected downstream release fixes.

Regression coverage should retain ordinary filenames with supported routing characters, require rejection of percent and line-break variants, and verify that rejected input never starts an editor or another command. Consumer-level tests should exercise the actual exposed editor-launch entry point with the real filesystem prerequisites, not just the formatting helper.

GHSA-698v-4r3x-3vcv records a Windows-specific editor-launch command-injection issue with significant prerequisites: a real attacker-placed file, reachability of the launch operation, and the required expansion state. The inspected 2.14.1 source leaves percent expressions untouched before exec; 2.14.2 rejects them before launch. The public advisory credits my work as one of three reporters. This report provides source-backed analysis, not an independently reproduced exploit.