CVE-2022-29187

Bypass of safe.directory protections in Git

HIGH
7.8
CVSS Score
Published: July 12, 2022 at 12:00 AM UTC
Updated: June 17, 2026 at 04:39 AM UTC
5 products affected across 5 vendorsDebian LinuxFedoraXcode

Using git by git?

Get instant alerts when new vulnerabilities affect git - before attackers find them.

Real-time alertsTrack your software stackFree plan available
Severity
HIGH7.8
Exploit prediction
EPSS 0.4%

Description

Git is a distributed revision control system. Git prior to versions 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, is vulnerable to privilege escalation in all platforms. An unsuspecting user could still be affected by the issue reported in CVE-2022-24765, for example when navigating as root into a shared tmp directory that is owned by them, but where an attacker could create a git repository. Versions 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 contain a patch for this issue. The simplest way to avoid being affected by the exploit described in the example is to avoid running git as root (or an Administrator in Windows), and if needed to reduce its use to a minimum. While a generic workaround is not possible, a system could be hardened from the exploit described in the example by removing any such repository if it exists already and creating one as root to block any future attacks.

Affected

Our own answer: ranges merged, affected separated from platform-only, with confidence and review flags.

v < 14.1
Affected range stops below 14.1, so it looks safe — our inference, not a vendor statement
2.30.3 ≤ v < 2.30.52.31.2 ≤ v < 2.31.42.32.1 ≤ v < 2.32.32.33.2 ≤ v < 2.33.42.34.2 ≤ v < 2.34.42.35.2 ≤ v < 2.35.42.36.0 ≤ v < 2.36.22.37.0 ≤ v < 2.37.1
Affected range stops below 2.30.5, so it looks safe — our inference, not a vendor statement
Affected range stops below 2.31.4, so it looks safe — our inference, not a vendor statement
Affected range stops below 2.32.3, so it looks safe — our inference, not a vendor statement
Affected range stops below 2.33.4, so it looks safe — our inference, not a vendor statement
Affected range stops below 2.34.4, so it looks safe — our inference, not a vendor statement
Affected range stops below 2.35.4, so it looks safe — our inference, not a vendor statement
Affected range stops below 2.36.2, so it looks safe — our inference, not a vendor statement
Affected range stops below 2.37.1, so it looks safe — our inference, not a vendor statement
Git· Gitrubygems
60%
v < 2.30.5v < 2.31.4v < 2.32.3v < 2.33.4v < 2.34.4v < 2.35.4v < 2.36.2v < 2.37.1
Affected range stops below 2.30.5, so it looks safe — our inference, not a vendor statement
Affected range stops below 2.31.4, so it looks safe — our inference, not a vendor statement
Affected range stops below 2.32.3, so it looks safe — our inference, not a vendor statement
Affected range stops below 2.33.4, so it looks safe — our inference, not a vendor statement
Affected range stops below 2.34.4, so it looks safe — our inference, not a vendor statement
Affected range stops below 2.35.4, so it looks safe — our inference, not a vendor statement
Affected range stops below 2.36.2, so it looks safe — our inference, not a vendor statement
Affected range stops below 2.37.1, so it looks safe — our inference, not a vendor statement

CVSS

7.8HIGHGitHub_M
Attack Vector
LOCAL
Complexity
LOW
Privileges
LOW
User Interaction
NONE
Scope
UNCHANGED
Confidentiality
HIGH
Integrity
HIGH
Availability
HIGH
Vector?

Quick Info

StatusMODIFIED
CWE
CWE-282CWE-427

Get alerted

Stop reading CVE feeds looking for your own stack

Track the products you run and VulnTracker tells you when a new CVE affects them — with what is known about fixing it, and nothing about the rest.

Free plan, no card