Join the Cyber Forum: Threat Intel on May 12, 2026 to learn how AI is reshaping threat defense.Join the Virtual Cyber Forum: Threat IntelRegister Now
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-2021-46101

CVE-2021-46101: Git for Windows RCE Vulnerability

CVE-2021-46101 is a remote code execution vulnerability in Git for Windows through version 2.34.1 that allows git.cmd execution during pull operations. This article covers technical details, affected versions, and mitigations.

Published: February 25, 2026

CVE-2021-46101 Overview

CVE-2021-46101 is a command execution vulnerability affecting Git for Windows through version 2.34.1. When using git pull to update a local repository, the git.cmd file can be executed directly, potentially allowing attackers to compromise systems by manipulating the execution flow of Git commands on Windows platforms.

Critical Impact

This vulnerability enables unauthorized command execution through Git for Windows, potentially allowing attackers to execute arbitrary commands when users perform routine Git operations like git pull.

Affected Products

  • Git for Windows through version 2.34.1

Discovery Timeline

  • 2022-01-31 - CVE CVE-2021-46101 published to NVD
  • 2024-11-21 - Last updated in NVD database

Technical Details for CVE-2021-46101

Vulnerability Analysis

This vulnerability exists in Git for Windows' command execution mechanism. The core issue stems from how Git for Windows handles the resolution and execution of git.cmd during repository operations. When a user executes git pull to synchronize their local repository with a remote source, the system may inadvertently execute a malicious git.cmd file if one is present in a location that takes precedence in the Windows PATH or current working directory.

Windows systems resolve commands by searching through directories in a specific order, and this vulnerability exploits that behavior. An attacker who can place a malicious git.cmd file in a strategic location can hijack the execution flow when a victim runs legitimate Git operations.

Root Cause

The root cause of this vulnerability lies in improper handling of command resolution on Windows systems. Git for Windows relies on batch files (git.cmd) for command execution, and the application does not adequately verify or restrict which git.cmd file gets executed. This allows for command hijacking when a malicious file is placed in a directory that Windows searches before the legitimate Git installation directory.

Attack Vector

The attack vector for CVE-2021-46101 is network-based, requiring no privileges and no user interaction beyond normal Git operations. An attacker can exploit this vulnerability through the following scenario:

  1. An attacker creates a malicious git.cmd file containing arbitrary commands
  2. The attacker places this file in a repository or directory that will be accessed by the victim
  3. When the victim performs a git pull operation, Windows executes the malicious git.cmd instead of the legitimate Git command
  4. The attacker's arbitrary commands execute with the victim's privileges

This attack could be delivered through a compromised or malicious Git repository, where the malicious git.cmd file is included in the repository contents. A proof-of-concept demonstrating this attack vector is available in the GitHub PoC Repository published by security researcher 0xADY.

Detection Methods for CVE-2021-46101

Indicators of Compromise

  • Presence of unexpected git.cmd files in repository directories or user-accessible paths
  • Suspicious git.cmd files with modification timestamps that don't match the Git for Windows installation
  • Unusual process spawning from Git operations, particularly command shells or PowerShell instances
  • Unexpected network connections initiated during routine git pull operations

Detection Strategies

  • Monitor file system for creation or modification of git.cmd files outside of the official Git for Windows installation directory
  • Implement application allowlisting to restrict which executables and batch files can be run
  • Use endpoint detection to identify anomalous command execution patterns following Git operations
  • Deploy SentinelOne's behavioral AI to detect suspicious command chains originating from Git processes

Monitoring Recommendations

  • Enable Windows file auditing for directories commonly used for Git repositories
  • Configure SentinelOne agents to alert on unusual batch file execution in user directories
  • Implement logging for all Git operations and correlate with process creation events
  • Monitor for unexpected child processes spawned by Git-related executables

How to Mitigate CVE-2021-46101

Immediate Actions Required

  • Update Git for Windows to the latest available version beyond 2.34.1
  • Audit existing repositories for unexpected git.cmd files
  • Configure Windows to prioritize the official Git installation directory in PATH resolution
  • Implement application control policies to prevent execution of batch files from untrusted locations

Patch Information

Users should update Git for Windows to a version newer than 2.34.1. The latest version can be obtained from the official Git for Windows website or through package managers like Chocolatey or Winget. After updating, verify the installation by running git --version to confirm the updated version is in use.

Workarounds

  • Modify the Windows PATH environment variable to ensure the official Git installation directory appears first
  • Remove execute permissions from git.cmd files found in non-standard locations
  • Use the full path to Git executables when running Git commands in scripts
  • Consider using Git Bash instead of cmd.exe for Git operations, as this reduces exposure to Windows command resolution vulnerabilities
bash
# Configuration example
# Verify Git for Windows version
git --version

# Check for suspicious git.cmd files in common locations
dir /s /b C:\Users\%USERNAME%\git.cmd 2>nul
dir /s /b %APPDATA%\git.cmd 2>nul

# Ensure correct Git path priority in system PATH
echo %PATH% | findstr /i "Git"

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

  • Vulnerability Details
  • TypeRCE

  • Vendor/TechGitforwindows

  • SeverityHIGH

  • CVSS Score7.5

  • EPSS Probability0.86%

  • Known ExploitedNo
  • CVSS Vector
  • CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N
  • Impact Assessment
  • ConfidentialityLow
  • IntegrityNone
  • AvailabilityNone
  • CWE References
  • NVD-CWE-noinfo
  • Technical References
  • GitHub PoC Repository
  • Latest CVEs
  • CVE-2026-25874: LeRobot RCE Vulnerability

  • CVE-2026-41272: Flowise LLM Builder SSRF Vulnerability

  • CVE-2026-41268: Flowise RCE Vulnerability

  • CVE-2026-41265: Flowise Airtable Agent RCE Vulnerability
Default Legacy - Prefooter | Experience the World’s Most Advanced Cybersecurity Platform

Experience the World’s Most Advanced Cybersecurity Platform

See how our intelligent, autonomous cybersecurity platform can protect your organization now 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