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-2021-21300

CVE-2021-21300: Git-scm Git RCE Vulnerability

CVE-2021-21300 is a remote code execution vulnerability in Git-scm Git affecting case-insensitive file systems. Attackers can execute scripts during repository cloning. This article covers technical details, affected versions, and mitigation.

Published: February 25, 2026

CVE-2021-21300 Overview

CVE-2021-21300 is a symlink attack vulnerability in Git, the widely-used open-source distributed revision control system. The vulnerability allows remote code execution when cloning a specially crafted malicious repository onto case-insensitive file systems such as NTFS (Windows), HFS+, or APFS (macOS). The attack leverages symbolic links combined with clean/smudge filters like Git LFS to execute arbitrary scripts during the clone operation.

This vulnerability is particularly dangerous because Git for Windows configures Git LFS by default, making Windows users automatically vulnerable without any additional configuration. The attack requires no authentication and can be triggered simply by cloning a malicious repository, making it highly exploitable in supply chain attack scenarios.

Critical Impact

Remote code execution during git clone operations on Windows and macOS systems, potentially compromising developer workstations and CI/CD pipelines through malicious repositories.

Affected Products

  • Git-scm Git (versions 2.14.2 through 2.30.0)
  • Apple Xcode (multiple versions)
  • Apple macOS (multiple versions)
  • Fedora (versions 32, 33, 34)
  • Debian Linux 10.0

Discovery Timeline

  • 2021-03-09 - CVE-2021-21300 published to NVD
  • 2024-11-21 - Last updated in NVD database

Technical Details for CVE-2021-21300

Vulnerability Analysis

The vulnerability exploits a race condition in how Git handles symbolic links during the checkout process on case-insensitive file systems. When Git clones a repository, it processes files in a specific order. An attacker can craft a repository where a symbolic link is checked out first, pointing to a directory that will be created later. Due to case-insensitivity, when Git subsequently creates the target directory, it follows the symlink, placing files in an unintended location.

The attack becomes especially dangerous when combined with Git LFS or other clean/smudge filters. These filters execute external programs to process file content during checkout. By exploiting the symlink traversal issue, an attacker can place a malicious script in the repository that gets executed by the filter mechanism.

Root Cause

The root cause is improper link resolution in Git's checkout code (CWE-59: Improper Link Resolution Before File Access). Git's lstat cache was not properly invalidated when directories were removed and replaced, allowing stale symlink information to persist. This caused Git to follow symbolic links in leading path components when it should have been creating new directories, enabling path traversal attacks on case-insensitive file systems.

Attack Vector

The attack requires a victim to clone a malicious repository onto a case-insensitive file system with Git LFS or similar clean/smudge filters configured. The attacker constructs a repository with:

  1. A symbolic link pointing to a target directory path
  2. Files using case variations that resolve to the same path on case-insensitive systems
  3. A hook script or executable that gets placed via the symlink traversal
  4. Attributes configuring clean/smudge filters to trigger script execution

The following patch from the official Git security fix demonstrates the cache invalidation added to prevent stale symlink information:

c
extern int threaded_has_symlink_leading_path(struct cache_def *, const char *, int);
extern int check_leading_path(const char *name, int len);
extern int has_dirs_only_path(const char *name, int len, int prefix_len);
+extern void invalidate_lstat_cache(void);
extern void schedule_dir_for_removal(const char *name, int len);
extern void remove_scheduled_dirs(void);

Source: Git Security Commit

The fix also ensures cache invalidation occurs when directories are removed:

c
       ask_yes_no_if_possible("Deletion of directory '%s' failed. "
		       "Should I try again?", pathname))
       ret = _wrmdir(wpathname);
+	if (!ret)
+		invalidate_lstat_cache();
	return ret;
}

Source: Git Security Commit

Detection Methods for CVE-2021-21300

Indicators of Compromise

  • Unexpected script execution during git clone operations
  • Repository contents containing symbolic links combined with .gitattributes filter configurations
  • Presence of case-variant file names designed to exploit case-insensitive file systems
  • Suspicious Git LFS filter activity creating files outside the repository directory

Detection Strategies

  • Monitor git clone operations for unexpected child process spawning, particularly shell scripts or executables
  • Implement file integrity monitoring on developer workstations to detect unauthorized file creation during clone operations
  • Analyze incoming repository contents for symbolic links pointing outside the repository structure before allowing clone operations
  • Deploy endpoint detection to identify unusual Git process behavior patterns

Monitoring Recommendations

  • Enable audit logging for all Git operations in CI/CD environments
  • Monitor for repositories containing both symlinks and .gitattributes with filter configurations
  • Implement network-level monitoring for clone operations from untrusted or unknown repository sources
  • Use SentinelOne's behavioral AI to detect anomalous process execution chains originating from Git operations

How to Mitigate CVE-2021-21300

Immediate Actions Required

  • Update Git to a patched version immediately: 2.30.1, 2.29.3, 2.28.1, 2.27.1, 2.26.3, 2.25.5, 2.24.4, 2.23.4, 2.22.5, 2.21.4, 2.20.5, 2.19.6, 2.18.5, or 2.17.6
  • Audit all systems running Git for Windows, as Git LFS is configured by default and makes systems automatically vulnerable
  • Review and remove any Git LFS or clean/smudge filter configurations from global Git settings if not required
  • Avoid cloning repositories from untrusted sources until patches are applied

Patch Information

Patches were released on March 9th, 2021. The fix versions address the vulnerability across multiple Git release branches. The security commit 684dd4c2b414bcf648505e74498a608f28de4592 introduces the invalidate_lstat_cache() function to properly clear cached symlink information when directories are removed. For detailed information, refer to the GitHub Security Advisory and the official Git commit.

Workarounds

  • Disable symbolic link support globally using git config --global core.symlinks false to prevent the symlink-based attack vector
  • Remove global clean/smudge filter configurations (including Git LFS) before cloning untrusted repositories
  • Configure Git LFS only on a per-repository basis rather than globally to limit exposure
  • Use containerized or sandboxed environments for cloning repositories from untrusted sources
bash
# Disable symbolic links globally to mitigate the vulnerability
git config --global core.symlinks false

# Verify Git LFS is not configured globally
git lfs uninstall --system
git config --global --unset filter.lfs.clean
git config --global --unset filter.lfs.smudge
git config --global --unset filter.lfs.process

# Check current Git version
git --version

# Update Git on macOS via Homebrew
brew upgrade git

# Update Git on Windows (download from git-scm.com)
# Or use: git update-git-for-windows

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

  • Vulnerability Details
  • TypeRCE

  • Vendor/TechGit

  • SeverityHIGH

  • CVSS Score7.5

  • EPSS Probability67.16%

  • Known ExploitedNo
  • CVSS Vector
  • CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:H/I:H/A:H
  • Impact Assessment
  • ConfidentialityHigh
  • IntegrityHigh
  • AvailabilityHigh
  • CWE References
  • CWE-59
  • Technical References
  • Packet Storm Advisory

  • Full Disclosure Post

  • OpenWall Security Notice

  • GitHub Security Advisory

  • Debian LTS Announcement

  • Fedora Package Announcement

  • Fedora Package Update

  • Fedora Package Notification

  • Kernel Mailing List Post

  • Gentoo GLSA 2021-04-01

  • Apple Support Article
  • Vendor Resources
  • Git Documentation - Config

  • Git Documentation - Attributes

  • Git Commit Update
  • Related CVEs
  • CVE-2026-4496: Git-MCP-Server RCE Vulnerability

  • CVE-2024-32004: Git-scm Git RCE Vulnerability

  • CVE-2025-48384: Git-scm Git RCE Vulnerability via CRLF

  • CVE-2025-48385: Git Bundle URI RCE Vulnerability
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