A Leader in the 2026 Gartner® Magic Quadrant™ for Endpoint Protection. Six years running.Six years. Gartner® Magic Quadrant™ Leader.Find Out Why
Experiencing a Breach?Blog
Get StartedContact Us
SentinelOne
  • Platform
    Platform Overview
    • Singularity Platform
      Welcome to Integrated Enterprise Security
    • AI for Security
      Leading the Way in AI-Powered Security Solutions
    • Securing AI
      Accelerate AI Adoption with Secure AI Tools, Apps, and Agents.
    • How It Works
      The Singularity XDR Difference
    • Singularity Marketplace
      One-Click Integrations to Unlock the Power of XDR
    • Pricing & Packaging
      Comparisons and Guidance at a Glance
    Data & AI
    • Purple AI
      Accelerate SecOps with Generative AI
    • Singularity Hyperautomation
      Easily Automate Security Processes
    • AI-SIEM
      The AI SIEM for the Autonomous SOC
    • AI Data Pipelines
      Security Data Pipeline for AI SIEM and Data Optimization
    • Singularity Data Lake
      AI-Powered, Unified Data Lake
    • Singularity Data Lake for Log Analytics
      Seamlessly Ingest Data from On-Prem, Cloud or Hybrid Environments
    Endpoint Security
    • Singularity Endpoint
      Autonomous Prevention, Detection, and Response
    • Singularity XDR
      Native & Open Protection, Detection, and Response
    • Singularity RemoteOps Forensics
      Orchestrate Forensics at Scale
    • Singularity Threat Intelligence
      Comprehensive Adversary Intelligence
    • Singularity Vulnerability Management
      Application & OS Vulnerability Management
    • Singularity Identity
      Identity Threat Detection and Response
    Cloud Security
    • Singularity Cloud Security
      Block Attacks with an AI-Powered CNAPP
    • Singularity Cloud Native Security
      Secure Cloud and Development Resources
    • Singularity Cloud Workload Security
      Real-Time Cloud Workload Protection Platform
    • Singularity Cloud Data Security
      AI-Powered Threat Detection for Cloud Storage
    • Singularity Cloud Security Posture Management
      Detect and Remediate Cloud Misconfigurations
    Securing AI
    • Prompt Security
      Secure AI Tools Across Your Enterprise
  • Why SentinelOne?
    Why SentinelOne?
    • Why SentinelOne?
      Cybersecurity Built for What’s Next
    • Our Customers
      Trusted by the World’s Leading Enterprises
    • Industry Recognition
      Tested and Proven by the Experts
    • About Us
      The Industry Leader in Autonomous Cybersecurity
    Compare SentinelOne
    • Arctic Wolf
    • Broadcom
    • CrowdStrike
    • Cybereason
    • Microsoft
    • Palo Alto Networks
    • Sophos
    • Splunk
    • Trellix
    • Trend Micro
    • Wiz
    Verticals
    • Energy
    • Federal Government
    • Finance
    • Healthcare
    • Higher Education
    • K-12 Education
    • Manufacturing
    • Retail
    • State and Local Government
  • Services
    Managed Services
    • Managed Services Overview
      Wayfinder Threat Detection & Response
    • Threat Hunting
      World-Class Expertise and Threat Intelligence
    • Managed Detection & Response
      24/7/365 Expert MDR Across Your Entire Environment
    • Incident Readiness & Response
      DFIR, Breach Readiness, & Compromise Assessments
    Support, Deployment, & Health
    • Technical Account Management
      Customer Success with Personalized Service
    • SentinelOne GO
      Guided Onboarding & Deployment Advisory
    • SentinelOne University
      Live and On-Demand Training
    • Services Overview
      Comprehensive Solutions for Seamless Security Operations
    • SentinelOne Community
      Community Login
  • Partners
    Our Network
    • MSSP Partners
      Succeed Faster with SentinelOne
    • Singularity Marketplace
      Extend the Power of S1 Technology
    • Cyber Risk Partners
      Enlist Pro Response and Advisory Teams
    • Technology Alliances
      Integrated, Enterprise-Scale Solutions
    • SentinelOne for AWS
      Hosted in AWS Regions Around the World
    • Channel Partners
      Deliver the Right Solutions, Together
    • SentinelOne for Google Cloud
      Unified, Autonomous Security Giving Defenders the Advantage at Global Scale
    • Partner Locator
      Your Go-to Source for Our Top Partners in Your Region
    Partner Portal→
  • Resources
    Resource Center
    • Case Studies
    • Data Sheets
    • eBooks
    • Reports
    • Videos
    • Webinars
    • Whitepapers
    • Events
    View All Resources→
    Blog
    • Feature Spotlight
    • For CISO/CIO
    • From the Front Lines
    • Identity
    • Cloud
    • macOS
    • SentinelOne Blog
    Blog→
    Tech Resources
    • SentinelLABS
    • Ransomware Anthology
    • Cybersecurity 101
  • About
    About SentinelOne
    • About SentinelOne
      The Industry Leader in Cybersecurity
    • Investor Relations
      Financial Information & Events
    • SentinelLABS
      Threat Research for the Modern Threat Hunter
    • Careers
      The Latest Job Opportunities
    • Press & News
      Company Announcements
    • Cybersecurity Blog
      The Latest Cybersecurity Threats, News, & More
    • FAQ
      Get Answers to Our Most Frequently Asked Questions
    • DataSet
      The Live Data Platform
    • S Foundation
      Securing a Safer Future for All
    • S Ventures
      Investing in the Next Generation of Security, Data and AI
  • Pricing
Get StartedContact Us
CVE Vulnerability Database
Vulnerability Database/CVE-2025-66476

CVE-2025-66476: Vim Text Editor RCE Vulnerability

CVE-2025-66476 is a remote code execution flaw in Vim for Windows that exploits uncontrolled search paths to execute malicious files. This article covers technical details, affected versions, impact, and mitigation.

Published: May 26, 2026

CVE-2025-66476 Overview

CVE-2025-66476 is an uncontrolled search path vulnerability [CWE-427] affecting Vim for Windows prior to version 9.1.1947. When Vim runs on Windows using cmd.exe as the shell, it resolves external commands by searching the current working directory before system paths. An attacker can place a malicious executable in the same directory as a file opened by Vim. The attacker-controlled binary executes when the user invokes :grep, :!, :make, or compiler commands. Exploitation requires local access and user interaction, but yields code execution in the user's security context.

Critical Impact

A user opening a file from an untrusted directory in Vim on Windows can trigger execution of attacker-supplied binaries like findstr.exe placed alongside the file.

Affected Products

  • Vim for Windows prior to version 9.1.1947
  • Microsoft Windows installations using cmd.exe as the Vim shell
  • Any Vim workflow invoking :grep, :!, :make, or compiler commands

Discovery Timeline

  • 2025-12-02 - CVE CVE-2025-66476 published to NVD
  • 2025-12-02 - Vim security advisory GHSA-g77q-xrww-p834 published
  • 2026-01-30 - Last updated in NVD database

Technical Details for CVE-2025-66476

Vulnerability Analysis

The flaw stems from how Windows resolves executable names. When cmd.exe searches for a command, it checks the current working directory before traversing %PATH%. Vim inherits this behavior when spawning external processes. Commands such as :grep invoke findstr.exe, and :! runs arbitrary shell commands. If an attacker plants a file named findstr.exe in the directory of the file being edited, Vim executes that binary instead of the system utility in C:\Windows\System32. The attacker gains code execution with the privileges of the user running Vim.

Root Cause

The root cause is reliance on the default Windows command resolution order, which prioritizes the current working directory. Vim did not previously set the NoDefaultCurrentDirectoryInExePath environment variable when invoking external commands. This left the search path uncontrolled and trusted the file system layout of the edited document.

Attack Vector

An attacker delivers a directory containing a target file and a malicious binary, for example via a ZIP archive, network share, or USB drive. The victim opens the file in Vim and runs any feature that calls an external tool. Vim launches the planted executable, which inherits the user's permissions.

c
/* Restore a previous environment variable value, or unset it if NULL.
 * 'must_free' indicates whether 'old_value' was allocated.
 */
    static void
restore_env_var(char_u *name, char_u *old_value, int must_free)
{
    if (old_value != NULL)
    {
	vim_setenv(name, old_value);
	if (must_free)
	    vim_free(old_value);
	return;
    }
    vim_unsetenv(name);
}

/*
 * Either execute a command by calling the shell or start a new shell
 */

Source: Vim commit 083ec6d. The patch introduces helper logic to set NoDefaultCurrentDirectoryInExePath before invoking shell commands and restore the prior value afterward.

Detection Methods for CVE-2025-66476

Indicators of Compromise

  • Presence of executables such as findstr.exe, cmd.exe, or compiler binaries in non-system directories that also contain document or source files.
  • Process creation events where vim.exe or gvim.exe spawns a child binary located outside C:\Windows\System32 or other trusted directories.
  • Archives extracted to user-writable paths that contain both editable files and .exe payloads with system utility names.

Detection Strategies

  • Hunt for child processes of vim.exe whose image path resolves to a user directory rather than a system path.
  • Monitor Sysmon Event ID 1 for process creations where the parent is Vim and the command line references findstr, make, or compiler executables resolved from non-standard locations.
  • Correlate file write events that create executables with system utility names in document directories.

Monitoring Recommendations

  • Enable command-line logging and Sysmon across Windows workstations used for development or text editing.
  • Forward process telemetry to a centralized analytics platform to baseline expected Vim child processes.
  • Alert on any executable named after a Windows built-in utility that lives outside its canonical system path.

How to Mitigate CVE-2025-66476

Immediate Actions Required

  • Upgrade Vim for Windows to version 9.1.1947 or later on all affected endpoints.
  • Set the NoDefaultCurrentDirectoryInExePath environment variable system-wide to remove the current directory from command resolution.
  • Avoid opening untrusted archives or repositories directly in Vim until patching is complete.

Patch Information

The fix is delivered in Vim patch 9.1.1947. The change always sets NoDefaultCurrentDirectoryInExePath when Vim invokes :! commands, regardless of user environment configuration. See the Vim Security Advisory GHSA-g77q-xrww-p834 and the GitHub Release v9.1.1947 for release notes.

Workarounds

  • Define NoDefaultCurrentDirectoryInExePath=1 as a user or system environment variable before launching Vim.
  • Switch Vim's shell from cmd.exe to PowerShell, which does not search the current directory by default.
  • Open untrusted files only from directories that contain no executable payloads, such as a dedicated quarantine folder.
bash
# Configuration example: set the protective environment variable on Windows
setx NoDefaultCurrentDirectoryInExePath 1

# Or inside Vim's vimrc, switch shell to PowerShell
# set shell=powershell
# set shellcmdflag=-NoLogo\ -NoProfile\ -NonInteractive\ -Command

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

  • Vulnerability Details
  • TypeRCE

  • Vendor/TechVim

  • SeverityHIGH

  • CVSS Score7.8

  • EPSS Probability0.02%

  • Known ExploitedNo
  • CVSS Vector
  • CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H
  • Impact Assessment
  • ConfidentialityLow
  • IntegrityHigh
  • AvailabilityHigh
  • CWE References
  • CWE-427
  • Technical References
  • GitHub Release v9.1.1947
  • Vendor Resources
  • GitHub Commit Note

  • GitHub Security Advisory

  • Openwall OSS-Security Discussion
  • Related CVEs
  • CVE-2026-46483: Vim Text Editor RCE Vulnerability

  • CVE-2026-44656: Vim Command Injection RCE Vulnerability

  • CVE-2026-42307: Vim Text Editor RCE Vulnerability

  • CVE-2026-41411: Vim Text Editor RCE Vulnerability
Default Legacy - Prefooter | Experience the World’s Most Advanced Cybersecurity Platform

Experience the Most Advanced Cybersecurity Platform

See how the world’s most intelligent, autonomous cybersecurity platform can protect your organization today and into the future.

Try SentinelOne
  • Get Started
  • Get a Demo
  • Product Tour
  • Why SentinelOne
  • Pricing & Packaging
  • FAQ
  • Contact
  • Contact Us
  • Customer Support
  • SentinelOne Status
  • Language
  • Platform
  • Singularity Platform
  • Singularity Endpoint
  • Singularity Cloud
  • Singularity AI-SIEM
  • Singularity Identity
  • Singularity Marketplace
  • Purple AI
  • Services
  • Wayfinder TDR
  • SentinelOne GO
  • Technical Account Management
  • Support Services
  • Verticals
  • Energy
  • Federal Government
  • Finance
  • Healthcare
  • Higher Education
  • K-12 Education
  • Manufacturing
  • Retail
  • State and Local Government
  • Cybersecurity for SMB
  • Resources
  • Blog
  • Labs
  • Case Studies
  • Videos
  • Product Tours
  • Events
  • Cybersecurity 101
  • eBooks
  • Webinars
  • Whitepapers
  • Press
  • News
  • Ransomware Anthology
  • Company
  • About Us
  • Our Customers
  • Careers
  • Partners
  • Legal & Compliance
  • Security & Compliance
  • Investor Relations
  • S Foundation
  • S Ventures

©2026 SentinelOne, All Rights Reserved.

Privacy Notice Terms of Use

English