Read the docs

Uncontrolled search path in Vim on Windows runs programs from current directory

Priority LOW 38CWE-427Published · Updated

Key facts

Attack vector
—
Privileges required
—
User interaction
—
Attack complexity
—
Impact type
Code execution
Confidentiality · integrity · availability
—
Fix status
Fixed

No CVSS vector from any source. Fix status from GitHub. Impact type from CWE-427.

Summary

Vim before 9.2.1421 on Windows can run an executable from the current directory instead of the intended system program when a script or plugin starts it by name with job_start(), term_start() or system() using a List argument. The flaw is an uncontrolled search path element (CWE-427) because these calls use CreateProcessW() directly without the environment setting that the earlier fix applied to shell commands. An attacker who can place a trojanized program with a common name such as git.exe in a project folder can get code run with the privileges of the user running Vim when that user opens a file there and a plugin starts the program.

Written with Claude Haiku 5.5 from the sources below · 2026-11-28

Description from the GitHub advisory

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)

Why it matters now

Fix Fixed Vim (vim): v9.2.1421

SSVC decision points

Not available: CISA has not published SSVC decision points for this record.

Affected products

VendorProductAffected versionsFixed inStatusSource
—Vim (vim)< 9.2.1421v9.2.1421Patch availableGHSA-6mf5-6cf6-hf9c
  • Vim (vim) Vendor— Affected < 9.2.1421 Fixed in v9.2.1421 Patch available GHSA-6mf5-6cf6-hf9c

Remediation

Update Vim to version 9.2.1421 or later, which fixes the issue in patch v9.2.1421.

Written with Claude Haiku 5.5 from the sources below · 2026-11-28

  • Fix · GHSA-6mf5-6cf6-hf9c Vim (vim) Fixed in v9.2.1421 Advisory →

Timeline

  1. 2026-11-28 Threatist record created from GHSA-6mf5-6cf6-hf9c

References

Sources

This product uses the NVD API but is not endorsed or certified by the NVD. Sources and licences