launch-editor: `fs.existsSync()` existence check can be bypassed on Windows
What fixes it
- 2.14.2launch-editor, npmGitHub
npm install launch-editor@2.14.2 - 8.3.3vite, npmGitHub
npm install vite@8.3.3 - 8.2.4vite, npmGitHub
npm install vite@8.2.4 - 8.1.6vite, npmGitHub
npm install vite@8.1.6 - 7.3.7vite, npmGitHub
npm install vite@7.3.7 - 6.4.4vite, npmGitHub
npm install vite@6.4.4
Show all 7 fixed versions
- 1.1.0vite-plus, npmGitHub
npm install vite-plus@1.1.0
A fixed version on one release line is not the upgrade target for every line. Check your exact version and any vendor backports.
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.
Text from GitHub Advisory Database
Affected versions 21
- launch-editor, npm<= 2.14.1GitHub
- vite, npm>= 8.3.0, <= 8.3.2GitHub
- vite, npm>= 8.2.0, <= 8.2.3GitHub
- vite, npm>= 8.0.0, <= 8.1.5GitHub
- vite, npm>= 7.0.0, <= 7.3.6GitHub
- vite, npm<= 6.4.3GitHub
- vite-plus, npm<= 1.0.0GitHub
- launch-editoraffected: < 2.14.2CVE List
- viteaffected: >= 8.3.0, < 8.3.3CVE List
- viteaffected: >= 8.2.0, < 8.2.4CVE List
- viteaffected: >= 8.0.0, < 8.1.6CVE List
- viteaffected: >= 7.0.0, < 7.3.7CVE List
- viteaffected: < 6.4.4CVE List
- vite-plusaffected: < 1.1.0CVE List
- launch-editor, npmfrom first release, fixed in 2.14.2OSV
- vite, npmfrom 8.3.0, fixed in 8.3.3OSV
- vite, npmfrom 8.2.0, fixed in 8.2.4OSV
- vite, npmfrom 8.0.0, fixed in 8.1.6OSV
- vite, npmfrom 7.0.0, fixed in 7.3.7OSV
- vite, npmfrom first release, fixed in 6.4.4OSV
- vite-plus, npmfrom first release, fixed in 1.1.0OSV
References 5
- github.com/vitejs/launch-editor/commit/f13cd835d4b8e860b1d4d080ad8a490cc2463679Fixvia CVE List
- github.com/vitejs/launch-editor/releases/tag/v2.14.2Fixvia CVE List
- github.com/vitejs/launch-editor/security/advisories/GHSA-587h-7wmj-h5pmAdvisoryvia CVE List
- github.com/advisories/GHSA-587h-7wmj-h5pmAdvisoryvia GitHub
- nvd.nist.gov/vuln/detail/CVE-2026-112942Referencevia GitHub