The SentinelOne Annual Threat Report - A Defenders Guide from the FrontlinesThe SentinelOne Annual Threat ReportGet the Report
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
    • 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-2022-24765

CVE-2022-24765: Git for Windows Information Disclosure

CVE-2022-24765 is an information disclosure vulnerability in Git for Windows affecting multi-user systems. Attackers with disk write access can create malicious .git folders to compromise operations. This article covers technical details, affected versions, impact, and mitigation steps.

Published: February 17, 2026

CVE-2022-24765 Overview

Git for Windows contains an uncontrolled search path vulnerability that affects users working on multi-user machines where untrusted parties have write access to the same hard disk. This vulnerability allows malicious actors to create a C:\.git folder that Git operations will pick up when searching for a Git directory, even when running commands outside of a repository. Any configuration specified in this malicious .git directory would be respected by Git, potentially leading to arbitrary code execution or credential theft.

Critical Impact

Attackers with local write access can hijack Git operations across all users on a Windows system by planting a malicious .git folder at the root of a drive, enabling arbitrary configuration injection and potential code execution.

Affected Products

  • Git for Windows (versions prior to v2.35.2)
  • Microsoft Windows (when running Git)
  • Apple Xcode (bundled Git)
  • Fedora 34, 35, 36, 37
  • Debian Linux 10.0

Discovery Timeline

  • 2022-04-12 - CVE-2022-24765 published to NVD
  • 2024-11-21 - Last updated in NVD database

Technical Details for CVE-2022-24765

Vulnerability Analysis

This vulnerability (CWE-427: Uncontrolled Search Path Element) exploits Git's directory traversal behavior when searching for a .git directory. When Git commands are executed, the application searches upward through the directory hierarchy looking for a .git folder to determine repository context. On Windows systems, this search can traverse all the way to the root of the drive (e.g., C:\).

The vulnerability manifests in several distinct scenarios. Git Bash users who have configured GIT_PS1_SHOWDIRTYSTATE are vulnerable because their shell prompt continuously checks Git repository status. Users with posh-git installed become vulnerable simply by starting PowerShell, as the module automatically queries Git status. IDE users, particularly those using Visual Studio, are affected when creating new projects, as the IDE reads and respects configuration from C:\.git\config. Users of the Microsoft fork of Git are vulnerable upon starting Git Bash.

Root Cause

The root cause lies in Git's recursive directory search algorithm for locating .git directories. When Git operations are invoked outside of a legitimate repository, the search continues upward through parent directories until it either finds a .git folder or reaches the filesystem root. On Windows, this allows a .git folder placed at C:\ to be discovered and trusted by Git operations running anywhere on that drive.

The vulnerability is particularly severe because Git configuration files can specify arbitrary commands to execute through hooks, credential helpers, or other extensible mechanisms. An attacker-controlled .git\config file could configure malicious hooks or helpers that execute when unsuspecting users run Git commands.

Attack Vector

The attack requires local access to create a folder at the root of a Windows drive. Once the C:\.git folder is created with a malicious configuration, any user running Git commands on that drive outside of a legitimate repository will have their Git operations hijacked.

The attack can be triggered passively through IDE operations, shell prompts that display Git status, or any automated Git tooling. This makes the vulnerability particularly dangerous in shared computing environments such as development workstations, educational computer labs, or enterprise shared infrastructure.

Detection Methods for CVE-2022-24765

Indicators of Compromise

  • Presence of .git folders at drive roots (e.g., C:\.git, D:\.git)
  • Unexpected Git configuration files in C:\.git\config containing hooks or credential helpers
  • Anomalous Git hook scripts in C:\.git\hooks\ directory
  • Unusual processes spawned as children of Git, IDE, or PowerShell processes

Detection Strategies

  • Monitor file system activity for creation of .git directories at drive roots using Windows Security Event logging
  • Implement SIEM rules to detect access patterns to C:\.git or similar paths across multiple user accounts
  • Deploy endpoint detection to identify Git processes reading configuration from unexpected locations outside user profiles
  • Audit Git configuration loading behavior through process monitoring and command-line logging

Monitoring Recommendations

  • Enable Windows file system auditing on root directories of all drives where Git is used
  • Configure SentinelOne's behavioral AI to detect suspicious directory creation at filesystem roots
  • Implement alerts for Git processes that reference .git directories outside of normal repository paths
  • Monitor for unauthorized modifications to environment variables like GIT_CEILING_DIRECTORIES

How to Mitigate CVE-2022-24765

Immediate Actions Required

  • Upgrade Git for Windows to version 2.35.2 or later immediately
  • Audit all Windows systems for existing .git folders at drive roots and remove any suspicious configurations
  • Create protected .git folders at drive roots with restricted permissions to prevent malicious folder creation
  • Define or extend the GIT_CEILING_DIRECTORIES environment variable to include parent directories of user profiles (e.g., C:\Users)

Patch Information

The vulnerability has been patched in Git for Windows v2.35.2. Users should update to this version or later to receive the security fix. For detailed information, see the GitHub Security Advisory GHSA-vw2c-22j4-2fh2.

Additional vendor updates are available:

  • Apple Xcode: See Apple Support Article HT213261
  • Fedora: Multiple package announcements available through the Fedora Package Announce mailing list
  • Debian: See Debian LTS Announcement
  • Gentoo: See GLSA 202312-15

Workarounds

  • Create .git folders on all drives where Git commands are run, then remove read/write access from those folders to prevent attackers from using them
  • Define or extend the GIT_CEILING_DIRECTORIES environment variable to cover the parent directory of user profiles (e.g., C:\Users if profiles are in C:\Users\username)
  • Disable GIT_PS1_SHOWDIRTYSTATE in Git Bash configurations to prevent shell prompt Git status checks
  • Uninstall or disable posh-git until systems are patched
bash
# Set GIT_CEILING_DIRECTORIES to prevent traversal above user profiles
# Add to system or user environment variables
setx GIT_CEILING_DIRECTORIES "C:\Users" /M

# Create protected .git folder at drive root (run as Administrator)
mkdir C:\.git
icacls C:\.git /inheritance:r /deny "Everyone:(OI)(CI)(F)"

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

  • Vulnerability Details
  • TypeInformation Disclosure

  • Vendor/TechGit

  • SeverityHIGH

  • CVSS Score7.8

  • EPSS Probability0.18%

  • Known ExploitedNo
  • CVSS Vector
  • CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
  • Impact Assessment
  • ConfidentialityLow
  • IntegrityNone
  • AvailabilityHigh
  • CWE References
  • CWE-427
  • Technical References
  • Full Disclosure Mailing List

  • OpenWall OSS Security Update

  • Debian LTS Announcement

  • Fedora Package Announcement

  • Fedora Package Announcement

  • Fedora Package Announcement

  • Fedora Package Announcement

  • Fedora Package Announcement

  • Fedora Package Announcement

  • Fedora Package Announcement

  • Fedora Package Announcement

  • Fedora Package Announcement

  • Gentoo GLSA 202312-15

  • Apple Support Article HT213261
  • Vendor Resources
  • Git SCM Bash Environment Guide

  • Git Documentation Overview

  • GitHub Security Advisory GHSA-vw2c-22j4-2fh2
  • Related CVEs
  • CVE-2025-66413: Git for Windows NTLM Hash Disclosure Flaw

  • CVE-2024-50349: Git Information Disclosure Vulnerability

  • CVE-2024-52006: Git Information Disclosure Vulnerability

  • CVE-2024-50338: Git Credential Manager Info Disclosure
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