|
|
Message-ID: <awrEJl/RmvbkQcBQ@256bit.org> Date: Sat, 28 Nov 2026 13:08:06 +0100 From: Christian Brabandt <cb@...bit.org> To: oss-security@...ts.openwall.com Subject: [vim-security] Windows: job_start() and system() run executables from cwd in Vim < 9.2.1421 Windows: job_start() and system() run executables from cwd in Vim < 9.2.1421 ============================================================================ Date: 28.11.2026 Severity: Medium CVE: *requested, not yet assigned* CWE: Uncontrolled Search Path Element (CWE-427) ## Summary On Windows, Vim may execute a program from the current directory instead of the intended system program, when a script or plugin starts it using `job_start()`, `term_start()` or `system()` with a List argument. This is a follow-up to GHSA-g77q-xrww-p834. ## Description Patch v9.1.1947 fixed GHSA-g77q-xrww-p834 by setting the `$NoDefaultCurrentDirectoryInExePath` environment variable before running external commands through the shell, so that `cmd.exe` no longer searches the current directory for executables. However, `job_start()`, `term_start()` (using ConPTY) and, since patch v9.2.0025, `system()` and `systemlist()` with a List argument do not use the shell, but call `CreateProcessW()` directly. The environment variable was not set for these calls, so `CreateProcessW()` still searched the current directory before the system directories and `$PATH`. An attacker could place a trojanized executable with a common name (e.g. `git.exe`) in a project folder. It would run when the user opens a file there and a plugin starts that program by its name, e.g. a Git integration, a language server client or a linter. ## Impact Arbitrary code execution with the privileges of the user running Vim. Exploitation requires: - Vim running on Windows - the current directory set to an attacker-controlled directory, e.g. a cloned repository, by starting Vim there, by `:cd`, `:lcd` or `:tcd`, or by opening a file from Windows Explorer - a script or plugin that starts an external program by its name using `job_start()`, `term_start()` or `system()` with a List argument Since this requires a script or plugin that starts external programs by their name and the user working in an attacker-controlled directory, the severity is rated medium. ## Acknowledgements The Vim project would like to thank Mark Woods for reporting the issue. ## References The issue has been fixed as of Vim patch [v9.2.1421](https://github.com/vim/vim/releases/tag/v9.2.1421). - [Commit](https://github.com/vim/vim/commit/0602bccebe16e20e4a11edcc02078ce653f35dba) - [Github Security Advisory](https://github.com/vim/vim/security/advisories/GHSA-6mf5-6cf6-hf9c) - [Related: GHSA-g77q-xrww-p834](https://github.com/vim/vim/security/advisories/GHSA-g77q-xrww-p834) Best, Christian -- Wie man sein Kind nicht nennen sollte: Bred R. Zaun
Powered by blists - more mailing lists
Please check out the Open Source Software Security Wiki, which is counterpart to this mailing list.
Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.