{"id":"CVE-2026-112944","aliases":["CVE-2026-112944","GHSA-r825-w8mm-5pxw"],"related":[],"kind":"vulnerability","state":"published","title":"launch-editor: Editor CLI flag misinterpretation causing arbitrary command execution for some editors","summary":"launch-editor allows users to open files with line numbers in editor from Node.js. Prior to 2.14.2, when an attacker can create a filesystem entry beginning with plus or minus in the working directory, an affected editor is selected, and the path can remain relative or is converted to a relative WSL path, launchEditor forwards the path without forcing it to be interpreted as a positional filename. Editor option parsing then treats the attacker-controlled filename as a command-line flag, which can cause unintended file overwrite or arbitrary command execution by the selected editor. The affected editors are Vim and gVim, MacVim, Emacs and Emacsclient, and Notepad++ when a plugin exposes dangerous operations; WSL path conversion keeps Vite and newer middleware callers exposed. This issue is fixed in version 2.14.2.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"launch-editor allows users to open files with line numbers in editor from Node.js. Prior to 2.14.2, when an attacker can create a filesystem entry beginning with plus or minus in the working directory, an affected editor is selected, and the path can remain relative or is converted to a relative WSL path, launchEditor forwards the path without forcing it to be interpreted as a positional filename. Editor option parsing then treats the attacker-controlled filename as a command-line flag, which can cause unintended file overwrite or arbitrary command execution by the selected editor. The affected editors are Vim and gVim, MacVim, Emacs and Emacsclient, and Notepad++ when a plugin exposes dangerous operations; WSL path conversion keeps Vite and newer middleware callers exposed. This issue is fixed in version 2.14.2.","source":"cvelist"},{"lang":"en","text":"### Summary\n\n`launch-editor` forwarded file paths directly to editors without sanitization. If a path resembles a CLI flag, editors like Vim may interpret it as a command, potentially causing unintended file overwrites or command execution.\n\n### Impact\n\n#### Direct `launch-editor` users\n\nOnly apps that match all of the following conditions are affected:\n\n- The attacker is able to create a file system entry (e.g. a file or directory) starting with `+` or `-` in the working directory\n- The user uses or the app specifies any of the following editors:\n  - Vim (including gVim)\n  - MacVim\n  - Emacs (including Emacsclient)\n  - Notepad++ (only if using a plugin exposing dangerous operations via plugin messages)\n- The first argument of `launchEditor` can start with `+` or `-` or the user is using WSL\n\n#### `launch-editor-middleware` users\n\nOnly apps that match the following conditions are affected:\n\n- The attacker is able to create a file system entry (e.g. a file or directory) starting with `+` or `-` in the working directory\n- The user uses or the app specifies any of the following editors:\n  - Vim (including gVim)\n  - MacVim\n  - Emacs (including Emacsclient)\n  - Notepad++ (only if using a plugin exposing dangerous operations via plugin messages)\n- launch-editor older than v2.2.0 is used, or the user is using WSL\n\n#### Vite users\n\nOnly apps that match the following conditions are affected:\n\n- The attacker is able to create a file system entry (e.g. a file or directory) starting with `+` or `-` in the working directory\n- The user uses or the app specifies any of the following editors:\n  - Vim (including gVim)\n  - MacVim\n  - Emacs (including Emacsclient)\n  - Notepad++ (only if using a plugin exposing dangerous operations via plugin messages)\n- The user is using WSL\n\n### Details\n\n`launchEditor(file)` function passes the file name as-is to the editor if the file with that file name exists. If the file name starts with `-` (also `+` for Vim), the editor treats them as flags rather than positional arguments. For example, Vim treats arguments starting with `+` as an Ex command. As a result, an existing relative directory such as:\n```\n+call writefile([\"SAFE_MARKER\"],\"LAUNCH_EDITOR_MARKER\")|qa!\n```\nis not treated as a filename when passed to Vim. Vim executes the embedded Ex command.\n\nThe following editor has a potentially destructive operation exposed to the CLI arguments:\n- Vim (including gVim)\n- MacVim\n- Emacs (including Emacsclient)\n- Notepad++ (only if using a plugin exposing dangerous operations via plugin messages)\n\n`launch-editor-middleware` v2.2.0+ converts the passed file path to an absolute path so those are not affected as long as the user is not using WSL. For WSL, `launch-editor` converts the paths to relative paths internally, so those are still affected.\n\nVite 2.0.0+ uses `launch-editor-middleware` v2.2.0+ so the WSL users are only affected.","format":"markdown","source":"ghsa"}],"published":"2026-10-20T14:57:38.728Z","modified":"2026-10-20T20:00:04.608Z","severity":{"scorer":"GitHub_M","scheme":"CVSS:4.0","vector":"CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:L/VI:L/VA:L/SC:N/SI:N/SA:N","score":6.3,"rating":"MEDIUM"},"severities":[{"scorer":"GitHub_M","scheme":"CVSS:4.0","vector":"CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:L/VI:L/VA:L/SC:N/SI:N/SA:N","score":6.3,"rating":"MEDIUM"},{"scorer":"GitHub","scheme":"CVSS:4.0","vector":"CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:L/VI:L/VA:L/SC:N/SI:N/SA:N","rating":"MEDIUM"}],"cwes":["CWE-88"],"affected":[{"ranges":[{"version":"< 2.14.2","status":"affected"}],"vendor":"vitejs","product":"launch-editor","source":"cvelist"},{"ranges":[{"version":">= 8.3.0, < 8.3.3","status":"affected"},{"version":">= 8.2.0, < 8.2.4","status":"affected"},{"version":">= 8.0.0, < 8.1.6","status":"affected"},{"version":">= 7.0.0, < 7.3.7","status":"affected"},{"version":"< 6.4.4","status":"affected"}],"vendor":"vitejs","product":"vite","source":"cvelist"},{"ranges":[{"version":"< 1.1.0","status":"affected"}],"vendor":"vitejs","product":"vite-plus","source":"cvelist"},{"ranges":[{"type":"semver","introduced":"0","status":"affected","fixed":"2.14.2"}],"ecosystem":"npm","package":"launch-editor","purl":"pkg:npm/launch-editor","source":"ghsa"},{"ranges":[{"type":"semver","introduced":"8.3.0","status":"affected","fixed":"8.3.3"}],"ecosystem":"npm","package":"vite","purl":"pkg:npm/vite","source":"ghsa"},{"ranges":[{"type":"semver","introduced":"8.2.0","status":"affected","fixed":"8.2.4"}],"ecosystem":"npm","package":"vite","purl":"pkg:npm/vite","source":"ghsa"},{"ranges":[{"type":"semver","introduced":"8.0.0","status":"affected","fixed":"8.1.6"}],"ecosystem":"npm","package":"vite","purl":"pkg:npm/vite","source":"ghsa"},{"ranges":[{"type":"semver","introduced":"7.0.0","status":"affected","fixed":"7.3.7"}],"ecosystem":"npm","package":"vite","purl":"pkg:npm/vite","source":"ghsa"},{"ranges":[{"type":"semver","introduced":"0","status":"affected","fixed":"6.4.4"}],"ecosystem":"npm","package":"vite","purl":"pkg:npm/vite","source":"ghsa"},{"ranges":[{"type":"semver","introduced":"0","status":"affected","fixed":"1.1.0"}],"ecosystem":"npm","package":"vite-plus","purl":"pkg:npm/vite-plus","source":"ghsa"}],"references":[{"url":"https://github.com/vitejs/launch-editor/security/advisories/GHSA-r825-w8mm-5pxw","tags":["web","x-refsource-confirm"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/vitejs/launch-editor/pull/156","tags":["web","x-refsource-misc"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/vitejs/launch-editor/commit/f6e6701bb1f16f2dd242b321374f1b6cca6eb6d4","tags":["web","x-refsource-misc"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/vitejs/launch-editor/releases/tag/v2.14.2","tags":["web","x-refsource-misc"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2026-112944","tags":["advisory"],"sources":["ghsa"]},{"url":"https://github.com/vitejs/launch-editor","tags":["package"],"sources":["ghsa"]}],"credits":[],"assigner":"GitHub_M","ssvc":{"scorer":"CISA-ADP","exploitation":"none","automatable":"no","technicalImpact":"partial","date":"2026-10-20T15:22:50.878Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-112944","url":"https://www.cve.org/CVERecord?id=CVE-2026-112944","licence":"CVE Terms of Use","modified":"2026-10-20T15:23:12.248Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-r825-w8mm-5pxw","url":"https://github.com/advisories/GHSA-r825-w8mm-5pxw","licence":"CC-BY-4.0","modified":"2026-10-20T20:00:04.608Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-112944","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-112944","licence":"Public domain","modified":"2026-10-20T19:55:49.343Z"}],"updatedAt":"2026-11-25T22:59:46.051Z","epss":{"score":0.00705,"percentile":0.54593,"date":"2026-12-01T12:00:22.000Z"}}