Git for Windows - Command Injection Vulnerability (CVE-2021-46101)

git Updated 02 Oct 2025

Summary

31/01/2022
N/A
Yes i
High
7.5

CVE-2021-46101: In Git for windows through 2.34.1 when using git pull to update the local warehouse, git.cmd can be run directly. Affects git across 2 version ranges.

< 0 < 2ca94ab318509b3c271e82889938816bad76dfea

No fix is published. How to fix ↓

Free scan

Check if this vulnerability affects your application

Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.

Check my app free

No signup required · Results in about 60 seconds

Upload your dependency manifest or SBOM

Drag & drop your file here or

Java Javascript PHP Python Go Rust Ruby Dart C/C++ Elixir CycloneDX SPDX

Upload a supported dependency manifest or SBOM. No installation or source-code access required.

See supported files and SBOM formats
SBOM sbom.json · bom.json · bom.xml · *.spdx.json · *.cdx.json · *.cdx.xml
Java pom.xml · gradle.lockfile · buildscript-gradle.lockfile
Javascript package-lock.json · yarn.lock · pnpm-lock.yaml
PHP composer.lock
Python poetry.lock · requirements.txt · Pipfile.lock
Go go.mod
Rust Cargo.lock
Ruby Gemfile.lock
Dart pubspec.lock
C/C++ conan.lock
Elixir mix.lock
Enter your work email to receive your report link.

Verify your email to view the full report and start 30 days of continuous monitoring. No credit card required.

Sponsored Devnack Your last release was probably never penetration tested Manual testing by engineers who build software, not an auditor's checklist. Trusted by teams at Swift and Google Talk to Devnack

Background

Git for Windows is a version control system that allows users to track changes in files and collaborate with others. It provides a command-line interface for managing repositories and performing various operations. However, a command injection vulnerability (CVE-2021-46101) has been discovered in Git for Windows versions up to 2.34.1. This vulnerability allows an attacker to execute arbitrary commands by manipulating the 'git pull' command.

Vulnerability Detail

The command injection vulnerability in Git for Windows arises when the 'git pull' command is used to update the local repository. An attacker can exploit this vulnerability by providing a specially crafted input that includes malicious commands. When the 'git pull' command is executed, the malicious commands are executed as well, leading to arbitrary code execution. This can result in unauthorized access, data loss, or further compromise of the system. The vulnerability has a CVSS score of 7.5, indicating a high severity.

How To Fix

To fix this vulnerability, it is recommended to update Git for Windows to version 2.34.2 or later. The latest version includes a patch that addresses the command injection vulnerability. Users can download the updated version from the official Git for Windows website or use package managers to update the software.

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Workaround

As a temporary workaround, users can avoid using the 'git pull' command directly and instead use alternative methods to update the local repository. For example, users can manually download the updated repository files and replace the existing files. This eliminates the risk of command injection through the 'git pull' command.

Conclusion

The command injection vulnerability (CVE-2021-46101) in Git for Windows poses a significant risk to users. It allows attackers to execute arbitrary commands and potentially compromise the system. To mitigate this vulnerability, it is crucial to update Git for Windows to version 2.34.2 or later. Additionally, users can follow the provided workaround until the update is applied. For further support and assistance in vulnerability remediation, please contact DevNack.com.

See every vulnerability recorded for git →

Share this vulnerability

FAQ

Git for Windows is a version control system that allows users to track changes in files and collaborate with others. It provides a command-line interface for managing repositories and performing various operations.

The command injection vulnerability in Git for Windows allows an attacker to execute arbitrary commands, potentially leading to unauthorized access, data loss, or further compromise of the system.

To fix the vulnerability, update Git for Windows to version 2.34.2 or later. The latest version includes a patch that addresses the command injection vulnerability.

As a temporary workaround, users can avoid using the 'git pull' command directly and instead use alternative methods to update the local repository.

Users can download the updated version of Git for Windows from the official Git for Windows website or use package managers to update the software.

Related vulnerabilities

Recent vulnerabilities recorded for git.

How To Fix

To fix this vulnerability, it is recommended to update Git for Windows to version 2.34.2 or later. The latest version includes a patch that addresses the command injection vulnerability. Users can download the updated version from the official Git for Windows website or use package managers to update the software.

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Subscribe to Vulert on Telegram
Daily digest of new CVEs, critical and high severity, affected packages and fixes — plus a weekly roundup.
Join the channel →
Help improve this record
Report an issue or send feedback