A critical vulnerability affecting Vim for Windows versions prior to 9.1.1947 allows attackers to execute arbitrary code with user privileges through an uncontrolled search path mechanism.
This vulnerability, tracked as CVE-2025-66476, was discovered by Simon Zuckerbraun of Trend Micro’s Zero Day Initiative and assigned reference ZDI-CAN-28569.
| Field | Value |
|---|---|
| CVE ID | CVE-2025-66476 |
| Affected Software | Vim for Windows < 9.1.1947 |
| Vulnerability Type | Uncontrolled Search Path Element (CWE-427) |
| Severity | High |
| Discovery Date | December 2, 2025 |
| Researcher | Simon Zuckerbraun (Trend Micro ZDI) |
| Reference | ZDI-CAN-28569 |
Technical Overview
The vulnerability exploits how Vim handles command resolution on Windows systems running cmd.exe as the shell.
When Vim executes external commands including those used for grep operations, build tool invocations, or system function calls it searches the current working directory before checking standard system paths.
This unsafe search order enables attackers to place malicious executables with commonly used names (such as findstr.exe) within project directories and have them executed instead of legitimate system binaries.
The attack becomes particularly dangerous because users can trigger it through routine operations. Opening files via Windows Explorer, using Vim’s directory change commands (:cd, :lcd, or :tcd), or allowing Vim to automatically change to a file’s directory can all initiate the vulnerability.
When users subsequently execute external commands like :grep, :!, :make, or call system() from Vim scripts, the trojanized executable runs with their user privileges.
Multiple Vim features create exploitation vectors. The :grep command invokes Windows findstr.exe, making it vulnerable if a malicious findstr.exe exists in the working directory.
External command execution through the :! operator follows the same dangerous search path. Filter commands using ! syntax, :make commands for build integration, and compiler tool invocations all follow this pattern. Vim script functions calling system() present another attack vector.
The vulnerability carries high severity because arbitrary code execution occurs without requiring elevated privileges and can happen through normal user interactions with files in untrusted directories.
Users must upgrade to Vim version 9.1.1947 or later immediately. Until patching, developers should avoid executing external commands within potentially compromised project directories and exercise caution when opening files from unknown sources.
System administrators should prioritize deployment of this patch across development environments to prevent potential compromise of developer workstations.
Find this Story Interesting! Follow us on Google News, LinkedIn and X to Get More Instant Updates