Uncontrolled Search Path Arbitrary Code Execution in Vim for Windows
CVE-2025-66476 is a high-severity uncontrolled search path vulnerability in Vim for Windows prior to 9.1.1947. When Vim is configured to use cmd.exe as its shell, external command resolution on Windows may search the current working directory before trusted system paths. As a result, when Vim invokes external utilities such as findstr.exe for :grep, shell commands via :!, filter commands using !, :make/compiler integrations, or other features that call external programs such as system(), it can execute a malicious executable planted in the directory associated with the edited file or current working directory. An attacker can place a trojanized binary with the expected name, such as findstr.exe, in a project folder and cause Vim to run it when the user edits files from that folder or changes into it. The flaw affects Vim for Windows 9.1.1946 and earlier and was fixed in 9.1.1947.
What it means and what to do now: patch path, interim mitigations, and the assume-compromise checklist.
What an attacker gets, and what they’ve been doing with it.
Successful exploitation results in arbitrary code execution in the security context of the user running Vim. This allows an attacker to run attacker-controlled programs without requiring elevated privileges, potentially leading to full compromise of the user's session, execution of follow-on malware, data theft, persistence, or use of the host as a pivot point. The impact is limited to the privileges available to the invoking user, but can still be significant in developer and administrative workflows where Vim is used in sensitive directories.
If you can’t patch tonight, do this now.
Until patching is complete, avoid opening or working in untrusted project directories with Vim on Windows, especially directories where an attacker could place executables. Avoid changing Vim's working directory into untrusted folders using :cd, :lcd, or :tcd. Reduce or avoid use of features that invoke external commands from untrusted locations, including :grep, :!, filter commands, :make, and scripts using system(). Where operationally feasible, configure Vim to use a shell or command invocation method that does not prioritize the current working directory, and monitor for suspicious executables such as trojanized findstr.exe placed in project folders.
Patch, then assume compromise.
Upgrade Vim for Windows to version 9.1.1947 or later, which contains the fix for this uncontrolled search path issue. Ensure the patched build is deployed across affected Windows systems, especially developer workstations and administrative endpoints where Vim is used to open files from untrusted or shared directories. Validate that any packaged or embedded Vim distributions are also updated to a fixed version.
No public exploits tracked yet. Mallory keeps watching.
Products and vendors Mallory has correlated with this vulnerability. Open in Mallory to drill down to specific CPE configurations and version ranges.
6 sources tracked across advisories, community write-ups, and news. New activity surfaces here as Mallory finds it.