GHSA-587h-7wmj-h5pm CVE-2026-112942
launch-editor: `fs.existsSync()` existence check can be bypassed on Windows
- Severity
- 7.5 / 10
- High · CVSS 4.0
- Exploit chance (EPSS)
- 1.34%
- Chance of exploitation in the next 30 days. Higher than 71.41% of scored vulnerabilities.
- Known exploited
- No
- Not in CISA's catalog
- Weakness
- CWE-77 Improper Neutralization of Special Elements used in a Command ('Command Injection')
- Fix
- Available
- 3 packages have a fixed version
Description
Summary
launch-editor checked fs.existsSync(fileName) before passing a supplied path to an editor command. On Windows, an attacker can bypass this check with a crafted path ending in \\..:line:column. This removes the requirement that the attacker be able to place a file with a malicious filename.
Combined with the % escaping issue described in GHSA-698v-4r3x-3vcv, this bypass can lead to OS command injection when an attacker controls the file argument.
Impact
Only apps that runs on Windows is affected.
Details
The earlier advisory assumed that fs.existsSync() required an attacker-controlled filename to exist. This advisory covers a bypass of that requirement.
A crafted value ending in \\..:1:1 is interpreted differently by launch-editor-middleware, launch-editor, and Windows:
launch-editor-middlewarecallspath.resolve()while the final path component is..:1:1, so it is not treated as a parent-directory component.launch-editortreats:1:1as a line-and-column suffix and removes it, leaving a path ending in\\...- On Windows,
fs.existsSync()accepts the resulting path as the existing parent directory even though the attacker-controlled preceding component does not exist. - Because the existence check passes, the crafted filename reaches the Windows shell command.
Affected versions
npm
| Package | Vulnerable | Fixed in |
|---|---|---|
| launch-editor | <= 2.14.1 |
No fix yet |
| launch-editor | < 2.14.2 |
2.14.2 |
| vite | >= 8.3.0, <= 8.3.2 |
No fix yet |
| vite | >= 8.2.0, <= 8.2.3 |
No fix yet |
| vite | >= 8.0.0, <= 8.1.5 |
No fix yet |
| vite | >= 7.0.0, <= 7.3.6 |
No fix yet |
| vite | <= 6.4.3 |
No fix yet |
| vite | >= 8.3.0, < 8.3.3 |
8.3.3 |
| vite | >= 8.2.0, < 8.2.4 |
8.2.4 |
| vite | >= 8.0.0, < 8.1.6 |
8.1.6 |
| vite | >= 7.0.0, < 7.3.7 |
7.3.7 |
| vite | < 6.4.4 |
6.4.4 |
| vite-plus | <= 1.0.0 |
No fix yet |
| vite-plus | < 1.1.0 |
1.1.0 |
How to fix
Move to the fixed version or later with your package manager, update the lockfile, and run your tests. If the package only arrives through another dependency, upgrade that dependency first. If none of its releases pulls a fixed version yet, force the version with your package manager's override.
launch-editor npm → 2.14.2
- npm
npm install launch-editor@2.14.2- yarn
yarn add launch-editor@2.14.2- pnpm
pnpm add launch-editor@2.14.2
vite npm → 8.3.3
- npm
npm install vite@8.3.3- yarn
yarn add vite@8.3.3- pnpm
pnpm add vite@8.3.3
vite-plus npm → 1.1.0
- npm
npm install vite-plus@1.1.0- yarn
yarn add vite-plus@1.1.0- pnpm
pnpm add vite-plus@1.1.0
Severity breakdown
CVSS 4.0 7.5
CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:A/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N
- Attack vector
- Network
- Attack complexity
- Low
- Attack requirements
- Present
- Privileges required
- None
- User interaction
- Active
- Confidentiality (vulnerable system)
- High
- Integrity (vulnerable system)
- High
- Availability (vulnerable system)
- High
- Confidentiality (subsequent systems)
- None
- Integrity (subsequent systems)
- None
- Availability (subsequent systems)
- None
Weakness
CWE-77: Improper Neutralization of Special Elements used in a Command ('Command Injection')
The product constructs all or part of a command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended command when it is sent to a downstream component.
How to prevent it
- Architecture and Design: If at all possible, use library calls rather than external processes to recreate the desired functionality.
- Implementation: If possible, ensure that all external commands called from the program are statically created.
- Implementation: Assume all input is malicious. Use an "accept known good" input validation strategy, i.e., use a list of acceptable inputs that strictly conform to specifications. Reject any input that does not strictly conform to specifications, or transform it into something that does. When performing input validation, consider all potentially relevant properties, including length, type of input, the full range of acceptable values, missing or extra inputs, syntax, consistency across related fields, and conformance to business rules. As an example of business rule logic, "boat" may be syntactically valid because it only contains alphanumeric characters, but it is not valid if the input is only expected to contain colors such as "red" or "blue." Do not rely exclusively on looking for malicious or malformed inputs. This is likely to miss at least one undesirable input, especially if the code's environment changes. This can give attackers enough room to bypass the intended validation. However, denylists can be useful for detecting potential attacks or determining which inputs are so malformed that they should be rejected outright.
- Operation: Run time: Run time policy enforcement may be used in an allowlist fashion to prevent use of any non-sanctioned commands.
- System Configuration: Assign permissions that prevent the user from accessing/opening privileged files.
References
Advisories
Fixes and patches
Packages
Other links
Timeline
- Published
- Last updated by the source
- Latest EPSS score
Related advisories
| Advisory | Severity | Why it's related |
|---|---|---|
| GHSA-4r4m-qw57-chr8 Vite has a `server.fs.deny` bypassed for `inline` and `raw` with `?import` query | High Known exploited | Also affects vite |
| GHSA-8g5g-mxqh-grgj Vite: `server.fs.deny` bypassed with queries | Medium | Also affects vite |
| GHSA-vfpm-58rq-9qcg Vite: First 4 bytes of files outside of `server.fs` setting is exposed by `?vite-wasm-instance` | Medium | Also affects vite |
| GHSA-rq7h-c2jc-7f22 Vite: Files outside `server.fs.allow` could be served when project paths match system paths on non-Windows machine | Medium | Also affects vite |
| GHSA-9jrq-w75r-8gcw Vite: Cross origin script execution through Vite custom middleware | Low | Also affects vite |
| GHSA-r825-w8mm-5pxw launch-editor: Editor CLI flag misinterpretation causing arbitrary command execution for some editors | Medium | Also affects launch-editor |
| GHSA-698v-4r3x-3vcv launch-editor: escapeCmdArgs() omits % escaping on Windows | Medium | Also affects launch-editor |
| GHSA-v6wh-96g9-6wx3 launch-editor: NTLMv2 hash disclosure via UNC path handling on Windows | Medium | Also affects launch-editor |
Credits: bluwy, hutsbotnet
MergeHarbor checks every repository's dependencies against this database, ranks what matters by exploitability and reachability, routes it to the owning team and opens the fix pull request.
Check your repos with MergeHarbor