CVE-2022-29187 | Bypass of safe.directory protections in Git

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.

Published: 2022-07-12 Last update: 2024-11-21 Assigner: [email protected] Source: [email protected]

Conclusion & alert: CVE-2022-29187 is rated Low Risk (36.7/100): CVSS High severity, with low exploitation likelihood (EPSS 0.05%). Mandatory action: Monitor for updates and reassess as exploit intelligence or EPSS changes.

Risk is dynamic; we continuously reassess and refresh what is shown on this page as upstream context changes.

Exploit prediction scoring system (EPSS) score for CVE-2022-29187

EPSS lead: Daily EPSS estimates relative likelihood of exploitation; percentile ranks this CVE among scored vulnerabilities (higher = more severe relative rank).

# Date Old EPSS score New EPSS score Delta (New - Old)
1 2025-07-30 0.04% 0.05% +0.01%
2 2023-03-07 1.55% 0.04% -1.50%
3 2023-01-31 1.55%

Full EPSS history (7 records total)

Common vulnerability scoring system (CVSS) metrics for CVE-2022-29187

CVSS metrics for this CVE.

Base score Version Severity Vector Exploitability Impact Score source
7.8 3.1 HIGH
CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H Click to expand
Attack vector (AV:L)
They already need access on the box, or another person has to do something wrong; it’s not a remote drive-by.
Attack complexity (AC:L)
Once they can reach the bug, pulling it off is straightforward—no weird race conditions or rare setup.
Privileges required (PR:L)
A normal user session is enough; they don’t have to be admin.
User interaction (UI:N)
Nobody has to click “OK” or open a trap file; it can work without a victim helping.
Scope (S:U)
Damage stays in the same “trust bubble” as the broken component—no big spill into unrelated systems.
Confidentiality (C:H)
Serious risk that confidential data gets exposed in a big way.
Integrity (I:H)
They could widely tamper with or forge data—trust in the data is badly hurt.
Availability (A:H)
Could take the service down hard or make it unusable for people who depend on it.
1.8 5.9 [email protected]
7.8 3.1 HIGH
CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H Click to expand
Attack vector (AV:L)
They already need access on the box, or another person has to do something wrong; it’s not a remote drive-by.
Attack complexity (AC:L)
Once they can reach the bug, pulling it off is straightforward—no weird race conditions or rare setup.
Privileges required (PR:L)
A normal user session is enough; they don’t have to be admin.
User interaction (UI:N)
Nobody has to click “OK” or open a trap file; it can work without a victim helping.
Scope (S:U)
Damage stays in the same “trust bubble” as the broken component—no big spill into unrelated systems.
Confidentiality (C:H)
Serious risk that confidential data gets exposed in a big way.
Integrity (I:H)
They could widely tamper with or forge data—trust in the data is badly hurt.
Availability (A:H)
Could take the service down hard or make it unusable for people who depend on it.
1.8 5.9 [email protected]
6.9 2.0 MEDIUM
AV:L/AC:M/Au:N/C:C/I:C/A:C Click to expand
Access vector (AV:L)
Requires local access to the target system.
Access complexity (AC:M)
Exploitation needs some favorable conditions, but not exceptional ones.
Authentication (AU:N)
No authentication is required.
Confidentiality impact (C:C)
Complete confidentiality impact.
Integrity impact (I:C)
Complete integrity impact.
Availability impact (A:C)
Complete availability impact.
3.4 10.0 [email protected]

Weakness enumeration for CVE-2022-29187

OS Trackers for CVE-2022-29187

vendor priority summary link
alpine CVE-2022-29187: 3 source package rows (git, libgit2, libgit2-1.5); 20 state rows across 14 repos (3.17-community, 3.17-main, 3.18-community, 3.18-main, 3.19-community, 3.19-main, 3.20-community, 3.20-main, 3.21-community, 3.21-main, 3.22-community, 3.22-main, edge-community, edge-main); fixed 15, open 5. https://security.alpinelinux.org/vuln/CVE-2022-29187
debian not yet assigned CVE-2022-29187 not yet assigned priority: Debian including 1 source packages (git), 5 status rows across 5 suites (bookworm, bullseye, forky, sid, trixie): resolved 5. https://security-tracker.debian.org/tracker/CVE-2022-29187
gentoo normal CVE-2022-29187: 2 GLSA(s) (202312-15, 202401-17), 2 atom(s) (dev-libs/libgit2, dev-vcs/git); latest impact normal. https://bugs.gentoo.org/buglist.cgi?quicksearch=CVE-2022-29187
redhat medium https://access.redhat.com/security/cve/CVE-2022-29187
suse high CVE-2022-29187 severity important: SUSE including 168 source package names (1.16-13.25:git-core-2.35.3-150300.10.15.1, 1.17-12.26:git-core-2.35.3-150300.10.15.1, …), 627 product×package rows across 68 product lines (Container bci/golang, Container bci/nodejs, … (68 product lines)): Fixed 627. https://www.suse.com/security/cve/CVE-2022-29187/
ubuntu medium CVE-2022-29187 medium priority: Ubuntu including 1 source packages (git), 11 status rows across 11 suites (bionic, focal, impish, jammy, kinetic, lunar, mantic, noble, trusty, upstream, xenial): released 9, ignored 1, not-affected 1. https://ubuntu.com/security/CVE-2022-29187

Affected software / configurations for CVE-2022-29187

Vendor Product Version Raw CPE
git-scm git >= 2.30.3, < 2.30.5 cpe:2.3:a:git-scm:git:*:*:*:*:*:*:*:*
git-scm git >= 2.31.2, < 2.31.4 cpe:2.3:a:git-scm:git:*:*:*:*:*:*:*:*
git-scm git >= 2.32.1, < 2.32.3 cpe:2.3:a:git-scm:git:*:*:*:*:*:*:*:*
git-scm git >= 2.33.2, < 2.33.4 cpe:2.3:a:git-scm:git:*:*:*:*:*:*:*:*
git-scm git >= 2.34.2, < 2.34.4 cpe:2.3:a:git-scm:git:*:*:*:*:*:*:*:*
git-scm git >= 2.35.2, < 2.35.4 cpe:2.3:a:git-scm:git:*:*:*:*:*:*:*:*
git-scm git >= 2.36.0, < 2.36.2 cpe:2.3:a:git-scm:git:*:*:*:*:*:*:*:*
git-scm git >= 2.37.0, < 2.37.1 cpe:2.3:a:git-scm:git:*:*:*:*:*:*:*:*
fedoraproject fedora 35 cpe:2.3:o:fedoraproject:fedora:35:*:*:*:*:*:*:*
fedoraproject fedora 36 cpe:2.3:o:fedoraproject:fedora:36:*:*:*:*:*:*:*
fedoraproject fedora 37 cpe:2.3:o:fedoraproject:fedora:37:*:*:*:*:*:*:*
apple xcode < 14.1 cpe:2.3:a:apple:xcode:*:*:*:*:*:*:*:*
debian debian_linux 10.0 cpe:2.3:o:debian:debian_linux:10.0:*:*:*:*:*:*:*

References for CVE-2022-29187

URL Tags
http://seclists.org/fulldisclosure/2022/Nov/1 Mailing List Third Party Advisory
http://www.openwall.com/lists/oss-security/2022/07/14/1 Mailing List Third Party Advisory
https://github.blog/2022-04-12-git-security-vulnerability-announced Third Party Advisory
https://github.com/git/git/security/advisories/GHSA-j342-m5hw-rr3v Third Party Advisory
https://lists.debian.org/debian-lts-announce/2022/12/msg00025.html Mailing List Third Party Advisory
https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/DDI325LOO2XBDDKLINOAQJEG6MHAURZE/
https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/DIKWISWUDFT2FAITYIA6372BVLH3OOOC/
https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/HVOLER2PIGMHPQMDGG4RDE2KZB74QLA2/
https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/TRZG5CDUQ27OWTPC5MQOR4UASNXHWEZS/
https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/UDZRZAL7QULOB6V7MKT66MOMWJLBJPX4/
https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/YROCMBWYFKRSS64PO6FUNM6L7LKBUKVW/
https://lore.kernel.org/git/xmqqv8s2fefi.fsf%40gitster.g/T/#u
https://security.gentoo.org/glsa/202312-15
https://security.gentoo.org/glsa/202401-17
https://support.apple.com/kb/HT213496 Third Party Advisory
cvelogic Threat Intelligence