CVE-2022-29187 json
Bypass of safe.directory protections in Git
published 2022-07-12 4 y ago modified 2026-06-17 4 mo ago also EUVD-2022-33581
- cvss
- 7.8
- version 3.1, CNA
- cisa kev
- Not listed
- not in CISA's catalog
- epss
- 0.4%
- EPSS 0.4% chance of exploitation in 30 days, percentile 39%
- public exploits
- 0
- none known
Summary
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.
Patch / fix
- git-scm git 2.30.5, 2.31.4, 2.32.3, 2.33.4, 2.34.4, 2.35.4, 2.36.2, 2.37.1
- apple xcode 14.1
- git Debian 14, Debian 13, Debian 12 1:2.37.2-1
debian advisories DEBIAN-CVE-2022-29187
- git Ubuntu 18.04 LTS 1:2.17.1-1ubuntu0.12
- git Ubuntu 20.04 LTS 1:2.25.1-1ubuntu3.5
- git Ubuntu 22.04 LTS 1:2.34.1-1ubuntu1.4
ubuntu advisories UBUNTU-CVE-2022-29187
Ubuntu security data © Canonical Ltd., from https://github.com/canonical/ubuntu-security-notices via OSV; changed: normalised to fixed package versions per release. CC BY-SA 4.0
- git RHEL 8 2.39.1-1.el8
- gitk RHEL 8 2.39.1-1.el8
- gitweb RHEL 8 2.39.1-1.el8
- git-all RHEL 8 2.39.1-1.el8
- git-gui RHEL 8 2.39.1-1.el8
- git-svn RHEL 8 2.39.1-1.el8
- git-core RHEL 8 2.39.1-1.el8
- perl-Git RHEL 8 2.39.1-1.el8
red hat advisories RHSA-2024:0407RHSA-2023:2859RHSA-2023:2319
- libgit2 SLES for SAP 15 SP2, SLES for SAP 15 SP1, SLES for SAP 15 +18 more 0.26.8-150000.3.15.1
- libgit2 SLES for SAP 15 SP2, SLES 15 SP2-LTSS, SLES 15 SP2-BCL +12 more 0.28.4-150200.3.3.1
- libgit2 SLE Module for Development Tools 15 SP4, openSUSE Leap 15.4 1.3.0-150400.3.3.1
- git SLE Module for Development Tools 15 SP4, SLE Module for Development Tools 15 SP3, SLE Module for Basesystem 15 SP4 +3 more 2.35.3-150300.10.15.1
- git SLES for SAP 12 SP5, SLES for SAP 12 SP4, SLES 12 SP5 +8 more 2.26.2-27.57.1
- git SLES for SAP 15 SP2, SLES for SAP 15 SP1, SLES for SAP 15 +18 more 2.26.2-150000.41.1
suse advisories SUSE-SU-2022:3495-1SUSE-SU-2022:3494-1SUSE-SU-2022:3283-1SUSE-SU-2022:2550-1SUSE-SU-2022:2537-1SUSE-SU-2022:2535-1
- git openSUSE Tumbleweed 2.37.1-1.1
- libgit2 openSUSE Tumbleweed 1.7.1-3.1
opensuse advisories openSUSE-SU-2024:12188-1openSUSE-SU-2024:13449-1
- git AlmaLinux 8 2.39.1-1.el8
- gitk AlmaLinux 8 2.39.1-1.el8
- gitweb AlmaLinux 8 2.39.1-1.el8
- git-all AlmaLinux 8 2.39.1-1.el8
- git-gui AlmaLinux 8 2.39.1-1.el8
- git-svn AlmaLinux 8 2.39.1-1.el8
- git-core AlmaLinux 8 2.39.1-1.el8
- perl-Git AlmaLinux 8 2.39.1-1.el8
almalinux advisories ALSA-2023:2859ALSA-2023:2319
- git Alpine 3.13 2.30.5-r0
- git Alpine 3.14 2.32.3-r0
- git Alpine 3.15 2.34.4-r0
- git Alpine 3.16 2.36.2-r0
- git Alpine 3.24, Alpine 3.23, Alpine 3.22 +5 more 2.37.1-r0
- libgit2 Alpine 3.24, Alpine 3.23, Alpine 3.22 +5 more 1.4.4-r0
alpine advisories ALPINE-CVE-2022-29187
Alpine secdb © Alpine Linux, from https://secdb.alpinelinux.org via OSV; changed: normalised to fixed package versions per release. CC BY-SA 4.0
- git Arch Linux 2.37.1-1
arch linux advisories AVG-2778
Vendor advisories
What the vendors themselves say about their products: affected, fixed or not affected, and what to do.
red hat product security vex CVE-2022-29187 updated cvss 7.8
git: Bypass of safe.directory protections
-
Red Hat JBoss Data Grid 7 gitaffected: no fix planned “Out of support scope”
-
Red Hat Enterprise Linux AppStream (v. 8) git 2.39.1-1.el8, gitk 2.39.1-1.el8, gitweb 2.39.1-1.el8, git-all 2.39.1-1.el8, git-gui 2.39.1-1.el8, git-svn 2.39.1-1.el8, +8 morefixed: vendor fix RHSA-2023:2859
-
Red Hat Enterprise Linux AppStream (v. 9) git 2.39.1-1.el9, gitk 2.39.1-1.el9, gitweb 2.39.1-1.el9, git-all 2.39.1-1.el9, git-gui 2.39.1-1.el9, git-svn 2.39.1-1.el9, +8 morefixed: vendor fix RHSA-2023:2319
-
Red Hat Enterprise Linux AppStream EUS (v.8.6) git 2.31.8-1.el8_6, gitk 2.31.8-1.el8_6, gitweb 2.31.8-1.el8_6, git-all 2.31.8-1.el8_6, git-gui 2.31.8-1.el8_6, git-svn 2.31.8-1.el8_6, +8 morefixed: vendor fix RHSA-2024:0407
-
Red Hat Enterprise Linux 6 git, gitk, gitweb, git-all, git-cvs, git-gui, +6 more Red Hat Enterprise Linux 7 git, gitk, git-hg, git-p4, gitweb, git-all, +12 more Red Hat Software Collections rh-git227-git, rh-git227-gitk, rh-git227-git-p4, rh-git227-gitweb, rh-git227-git-all, rh-git227-git-cvs, +10 morenot affected: vulnerable code not present
Red Hat CSAF VEX © Red Hat, Inc., from https://security.access.redhat.com/data/csaf/v2/vex/; changed: reduced to product statuses and remediations. CC BY 4.0 · csaf
cisa ICSA-24-046-11 updated cvss 7.8
Siemens SCALANCE XCM-/XRM-300
-
Siemens SCALANCE XCH328 (6GK5328-4TS01-2EC2) <V2.4 Siemens SCALANCE XCM324 (6GK5324-8TS01-2AC2) <V2.4 Siemens SCALANCE XCM328 (6GK5328-4TS01-2AC2) <V2.4 Siemens SCALANCE XCM332 (6GK5332-0GA01-2AC2) <V2.4 Siemens SCALANCE XRH334 (24 V DC, 8xFO, CC) (6GK5334-2TS01-2ER3) <V2.4 Siemens SCALANCE XRM334 (2x230 V AC, 8xFO) (6GK5334-2TS01-4AR3) <V2.4affected: fixed in V2.4 support.industry.siemens.com
+5 more productsfewer
Siemens SCALANCE XRM334 (2x230 V AC, 12xFO) (6GK5334-3TS01-4AR3) <V2.4 Siemens SCALANCE XRM334 (24 V DC, 8xFO) (6GK5334-2TS01-2AR3) <V2.4 Siemens SCALANCE XRM334 (24 V DC, 12xFO) (6GK5334-3TS01-2AR3) <V2.4 Siemens SCALANCE XRM334 (230 V AC, 8xFO) (6GK5334-2TS01-3AR3) <V2.4 Siemens SCALANCE XRM334 (230 V AC, 12xFO) (6GK5334-3TS01-3AR3) <V2.4
Facts from CISA's republication of the vendor's own advisory (CSAF); the linked advisory is the authoritative source. CISA notification · csaf
Exploit prediction
0.45% chance of exploitation in the next 30 days, higher than 39% of all scored CVEs (FIRST EPSS, 2026-11-08).
CVSS scores
| assigned by | version | score | vector |
|---|---|---|---|
| CNA | 3.1 | 7.8 | CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H |
| NVD | 3.1 | 7.8 | CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H |
| NVD | 2.0 | 6.9 | AV:L/AC:M/Au:N/C:C/I:C/A:C |
Affected products
- git git
Classification
References
-
lists.fedoraproject.org
/archives/list/package-announce%40lists.fedoraproject.org/message/TRZG5CDUQ27OWTPC5MQOR4UASNXHWEZS/
vendor-advisory
-
lists.fedoraproject.org
/archives/list/package-announce%40lists.fedoraproject.org/message/DDI325LOO2XBDDKLINOAQJEG6MHAURZE/
vendor-advisory
-
lists.fedoraproject.org
/archives/list/package-announce%40lists.fedoraproject.org/message/DIKWISWUDFT2FAITYIA6372BVLH3OOOC/
vendor-advisory
-
lists.fedoraproject.org
/archives/list/package-announce%40lists.fedoraproject.org/message/YROCMBWYFKRSS64PO6FUNM6L7LKBUKVW/
vendor-advisory
-
lists.fedoraproject.org
/archives/list/package-announce%40lists.fedoraproject.org/message/HVOLER2PIGMHPQMDGG4RDE2KZB74QLA2/
vendor-advisory
-
lists.fedoraproject.org
/archives/list/package-announce%40lists.fedoraproject.org/message/UDZRZAL7QULOB6V7MKT66MOMWJLBJPX4/
vendor-advisory
-
security.gentoo.org
/glsa/202312-15
vendor-advisory
-
security.gentoo.org
/glsa/202401-17
vendor-advisory
-
github.com
/git/git/security/advisories/GHSA-j342-m5hw-rr3v
third-party-advisory
-
github.blog
/2022-04-12-git-security-vulnerability-announced
third-party-advisory
- lore.kernel.org /git/xmqqv8s2fefi.fsf%40gitster.g/T/#u
-
openwall.com
/lists/oss-security/2022/07/14/1
mailing-list, third-party-advisory
-
support.apple.com
/kb/HT213496
third-party-advisory
-
seclists.org
/fulldisclosure/2022/Nov/1
mailing-list, third-party-advisory
-
lists.debian.org
/debian-lts-announce/2022/12/msg00025.html
mailing-list, third-party-advisory
Sources
- CVE List CVE-2022-29187
- NVD CVE-2022-29187
Fencer Vulns keeps one entry per vulnerability: the CVE id wins, then GHSA, and records that alias each other are merged, except that two CVEs always keep separate entries. The same data is available as JSON.