Skip to content
OpenAdvisories
High · 7.8 CVE-2022-29187 EUVD-2022-33581

Bypass of safe.directory protections in Git

Published Jul 12, 2022 · Updated Aug 3, 2024 · Assigned by GitHub_M

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 products

VendorProductAffectedFixed
git git >= 2.30.3, < 2.30.5, >= 2.31.2, < 2.31.4, >= 2.32.1, < 2.32.3, >= 2.33.2, < 2.33.4, >= 2.34.2, < 2.34.4, >= 2.35.2, < 2.35.4, >= 2.36, < 2.36.2, >= 2.37, < 2.37.1 —

Fixed in Linux distributions

Distributions backport fixes, so the version that fixes this vulnerability differs per release — upgrade to at least the version shown. From the distributions' security trackers and advisories.

ReleasePackageFixed inAdvisory
Debian 14 git 1:2.37.2-1 —
Debian 13 git 1:2.37.2-1 —
Debian 12 git 1:2.37.2-1 —
Debian 11 git 1:2.30.2-1+deb11u1 DSA-5332-1
Debian 10 git 1:2.20.1-2+deb10u5 DLA-3239-1
ReleasePackageFixed inAdvisory
Ubuntu 22.04 LTS git 1:2.34.1-1ubuntu1.4 USN-5511-1
Ubuntu 20.04 LTS git 1:2.25.1-1ubuntu3.5 USN-5511-1
Ubuntu 18.04 LTS git 1:2.17.1-1ubuntu0.12 USN-5511-1
ReleasePackageFixed inAdvisory
RHEL 9 git +14 2.39.1-1.el9 RHSA-2023:2319
RHEL 8 git +14 2.39.1-1.el8 RHSA-2023:2859
Show 1 more (older releases, extended support, other products)
ReleasePackageFixed inAdvisory
RHEL 8.6 EUS git +14 2.31.8-1.el8_6 RHSA-2024:0407

AlmaLinux

Errata ↗
ReleasePackageFixed inAdvisory
AlmaLinux 9 git +14 2.39.1-1.el9 ALSA-2023:2319
AlmaLinux 8 git +14 2.39.1-1.el8 ALSA-2023:2859
ReleasePackageFixed inAdvisory
SLES 15 SP4 git 2.35.3-150300.10.15.1 SUSE-SU-2022:2550-1
SLES 15 SP4 libgit2 1.3.0-150400.3.3.1 SUSE-SU-2022:3283-1
SLES 15 SP3 git 2.35.3-150300.10.15.1 SUSE-SU-2022:2550-1
SLES 15 SP3 libgit2 0.28.4-150200.3.3.1 SUSE-SU-2022:3494-1
SLES 15 SP2 git 2.26.2-150000.41.1 SUSE-SU-2022:2535-1
SLES 15 SP2 libgit2 0.26.8-150000.3.15.1 SUSE-SU-2022:3495-1, SUSE-SU-2022:3494-1
SLES 15 SP1 git 2.26.2-150000.41.1 SUSE-SU-2022:2535-1
SLES 15 SP1 libgit2 0.26.8-150000.3.15.1 SUSE-SU-2022:3495-1
SLES 15 git 2.26.2-150000.41.1 SUSE-SU-2022:2535-1
SLES 15 libgit2 0.26.8-150000.3.15.1 SUSE-SU-2022:3495-1
Show 24 more (older releases, extended support, other products)
ReleasePackageFixed inAdvisory
SLES 12 SP5 git 2.26.2-27.57.1 SUSE-SU-2022:2537-1
SLES 12 SP4 git 2.26.2-27.57.1 SUSE-SU-2022:2537-1
SLES 12 SP3 git 2.26.2-27.57.1 SUSE-SU-2022:2537-1
SLES 12 SP2 git 2.26.2-27.57.1 SUSE-SU-2022:2537-1
SLES for SAP 15 SP2 git 2.26.2-150000.41.1 SUSE-SU-2022:2535-1
SLES for SAP 15 SP2 libgit2 0.26.8-150000.3.15.1 SUSE-SU-2022:3495-1, SUSE-SU-2022:3494-1
SLES for SAP 15 SP1 git 2.26.2-150000.41.1 SUSE-SU-2022:2535-1
SLES for SAP 15 SP1 libgit2 0.26.8-150000.3.15.1 SUSE-SU-2022:3495-1
SLES for SAP 15 git 2.26.2-150000.41.1 SUSE-SU-2022:2535-1
SLES for SAP 15 libgit2 0.26.8-150000.3.15.1 SUSE-SU-2022:3495-1
SLES for SAP 12 SP5 git 2.26.2-27.57.1 SUSE-SU-2022:2537-1
SLES for SAP 12 SP4 git 2.26.2-27.57.1 SUSE-SU-2022:2537-1
SLE HPC 15 SP2 git 2.26.2-150000.41.1 SUSE-SU-2022:2535-1
SLE HPC 15 SP2 libgit2 0.26.8-150000.3.15.1 SUSE-SU-2022:3495-1, SUSE-SU-2022:3494-1
SLE HPC 15 SP1 git 2.26.2-150000.41.1 SUSE-SU-2022:2535-1
SLE HPC 15 SP1 libgit2 0.26.8-150000.3.15.1 SUSE-SU-2022:3495-1
SLE HPC 15 git 2.26.2-150000.41.1 SUSE-SU-2022:2535-1
SLE HPC 15 libgit2 0.26.8-150000.3.15.1 SUSE-SU-2022:3495-1
SUSE OpenStack Cloud Crowbar 9 git 2.26.2-27.57.1 SUSE-SU-2022:2537-1
SUSE OpenStack Cloud 9 git 2.26.2-27.57.1 SUSE-SU-2022:2537-1
SUSE OpenStack Cloud 8 git 2.26.2-27.57.1 SUSE-SU-2022:2537-1
SUSE Manager Server Module 4.3 libgit2 0.28.4-150200.3.3.1 SUSE-SU-2022:3494-1
SUSE Manager Server Module 4.2 libgit2 0.28.4-150200.3.3.1 SUSE-SU-2022:3494-1
SUSE Manager Server Module 4.1 libgit2 0.28.4-150200.3.3.1 SUSE-SU-2022:3494-1
SUSE Manager Server 4.1 git 2.26.2-150000.41.1 SUSE-SU-2022:2535-1
SUSE Manager Server 4.1 libgit2 0.26.8-150000.3.15.1 SUSE-SU-2022:3495-1, SUSE-SU-2022:3494-1
SUSE Manager Retail Branch Server 4.1 git 2.26.2-150000.41.1 SUSE-SU-2022:2535-1
SUSE Manager Retail Branch Server 4.1 libgit2 0.26.8-150000.3.15.1 SUSE-SU-2022:3495-1, SUSE-SU-2022:3494-1
SUSE Manager Proxy 4.1 git 2.26.2-150000.41.1 SUSE-SU-2022:2535-1
SUSE Manager Proxy 4.1 libgit2 0.26.8-150000.3.15.1 SUSE-SU-2022:3495-1, SUSE-SU-2022:3494-1
SUSE HPE Helion OpenStack 8 git 2.26.2-27.57.1 SUSE-SU-2022:2537-1
SUSE Enterprise Storage 7 git 2.26.2-150000.41.1 SUSE-SU-2022:2535-1
SUSE Enterprise Storage 7 libgit2 0.26.8-150000.3.15.1 SUSE-SU-2022:3495-1, SUSE-SU-2022:3494-1
SUSE Enterprise Storage 6 git 2.26.2-150000.41.1 SUSE-SU-2022:2535-1
SUSE Enterprise Storage 6 libgit2 0.26.8-150000.3.15.1 SUSE-SU-2022:3495-1
ReleasePackageFixed inAdvisory
openSUSE Tumbleweed git 2.37.1-1.1 openSUSE-SU-2024:12188-1
openSUSE Tumbleweed libgit2 1.7.1-3.1 openSUSE-SU-2024:13449-1
openSUSE Leap 15.4 git 2.26.2-150000.41.1 SUSE-SU-2022:2550-1, SUSE-SU-2022:2535-1
openSUSE Leap 15.4 libgit2 0.26.8-150000.3.15.1 SUSE-SU-2022:3495-1, SUSE-SU-2022:3494-1, SUSE-SU-2022:3283-1
openSUSE Leap 15.3 git 2.26.2-150000.41.1 SUSE-SU-2022:2550-1, SUSE-SU-2022:2535-1
openSUSE Leap 15.3 libgit2 0.26.8-150000.3.15.1 SUSE-SU-2022:3495-1, SUSE-SU-2022:3494-1
ReleasePackageFixed inAdvisory
Alpine v3.24 git 2.37.1-r0 —
Alpine v3.24 libgit2 1.4.4-r0 —
Alpine v3.23 git 2.37.1-r0 —
Alpine v3.23 libgit2 1.4.4-r0 —
Alpine v3.22 git 2.37.1-r0 —
Alpine v3.22 libgit2 1.4.4-r0 —
Alpine v3.21 git 2.37.1-r0 —
Alpine v3.21 libgit2 1.4.4-r0 —
Alpine v3.20 git 2.37.1-r0 —
Alpine v3.20 libgit2 1.4.4-r0 —
Show 7 more (older releases, extended support, other products)
ReleasePackageFixed inAdvisory
Alpine v3.19 git 2.37.1-r0 —
Alpine v3.19 libgit2 1.4.4-r0 —
Alpine v3.18 git 2.37.1-r0 —
Alpine v3.18 libgit2 1.4.4-r0 —
Alpine v3.17 git 2.37.1-r0 —
Alpine v3.17 libgit2 1.4.4-r0 —
Alpine v3.16 git 2.36.2-r0 —
Alpine v3.15 git 2.34.4-r0 —
Alpine v3.14 git 2.32.3-r0 —
Alpine v3.13 git 2.30.5-r0 —

Amazon Linux

ReleasePackageFixed inAdvisory
Amazon Linux 2023 git +16 2.39.1-1.amzn2023.0.2 ALAS2023-2023-065
Amazon Linux 2 git +16 2.37.1-1.amzn2.0.1 ALAS2-2022-1820

Oracle Linux

ReleasePackageFixed inAdvisory
Oracle Linux 9 git +14 2.39.1-1.el9 ELSA-2023-2319
Oracle Linux 8 git +14 2.39.1-1.el8 ELSA-2023-2859

Advisories 27

References