Privilege Escalation Vulnerability in Git

git Updated 02 Oct 2025

Summary

12/07/2022
N/A
Yes i
High
7.8

CVE-2022-29187: Git is a distributed revision control system. Affects git across 3 version ranges.

< 2.30.5-r0 >= 518ccba2352ce721cabbbf2933869c3c3313d1c3, < 9a2f22d016b61018668f8dd2f53faf92c40c6bb8 >= cb95038137e9e66fc6a6b4a0e8db62bcc521b709, < 88b7be68a4bf9f39b84ed438d8d776c0d752b316

Fixed in 2.30.5-r0. 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 Lume, the Habilume companion Habilume Habit tracker with a companion that grows with you Complete habits, earn Lume Points, and watch your Lume grow as you stay consistent. App Store Google Play

Background

Git is a distributed revision control system used for tracking changes in source code during software development. It allows multiple developers to collaborate on a project efficiently. Git is widely used and supports various platforms. However, it is susceptible to privilege escalation, which can lead to unauthorized access and control over the system.

Vulnerability Detail

The vulnerability, identified as CVE-2022-29187, affects Git versions prior to 2.37.1, 2.36.2, 2.35.4, 2.34.4, 2.33.4, 2.32.3, 2.31.4, and 2.30.5. It allows an attacker to escalate their privileges on all platforms. An unsuspecting user, even if not running Git as root or an Administrator, can still be affected when navigating into a shared tmp directory owned by them. In such a scenario, an attacker can create a malicious Git repository, potentially compromising the system. The issue has been patched in the mentioned versions of Git.

How To Fix

Minimum fixed version

2.30.5-r0

This is the first release that contains the fix.

sudo apk add --upgrade git

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

Workaround

A workaround for this vulnerability is to avoid running Git as root or an Administrator. If running Git with elevated privileges is necessary, it is advised to minimize its usage and restrict access to trusted users only. Additionally, existing repositories in shared tmp directories owned by non-root users should be removed, and new repositories should be created with root privileges to prevent future attacks.

Conclusion

The privilege escalation vulnerability in Git (CVE-2022-29187) can lead to unauthorized access and control over the system. It is crucial to update Git to the patched versions and avoid running it with elevated privileges unless necessary. Removing existing repositories in shared tmp directories owned by non-root users and creating new repositories with root privileges can further mitigate the risk. For further assistance in vulnerability remediation, please contact DevNack.com.

See every vulnerability recorded for git →

Share this vulnerability

FAQ

Git is a distributed revision control system used for tracking changes in source code during software development. It allows multiple developers to collaborate on a project efficiently.

The vulnerability affects Git versions prior to 2.37.1, 2.36.2, 2.35.4, 2.34.4, 2.33.4, 2.32.3, 2.31.4, and 2.30.5.

To fix this vulnerability, update Git to version 2.37.1, 2.36.2, 2.35.4, 2.34.4, 2.33.4, 2.32.3, 2.31.4, or 2.30.5. Avoid running Git as root or an Administrator unless necessary.

Yes, an unsuspecting user can still be affected if they navigate into a shared tmp directory owned by them, where an attacker can create a malicious Git repository.

While a generic workaround is not possible, hardening the system can be done by removing any existing repositories in shared tmp directories owned by non-root users and creating new repositories with root privileges.

Related vulnerabilities

Recent vulnerabilities recorded for git.

Sponsored Lume, the Habilume companion Habilume Habit tracker with a companion that grows with you Complete habits, earn Lume Points, and watch your Lume grow as you stay consistent. App Store Google Play

How To Fix

Minimum fixed version

2.30.5-r0

This is the first release that contains the fix.

sudo apk add --upgrade git

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