CVE-2022-29187
Bypass of safe.directory protections in Git
Mitigation
- Upgrade git to 2.37.1 or later.
Who should check
- Anyone running 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
Vulnerability facts
- Affected
- 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
- git 2.30.5, git 2.31.4, git 2.32.3, git 2.33.4, git 2.34.4, git 2.35.4, git 2.36.2, git 2.37.1
- Exploited in the wild
- Not in CISA KEV
- Public exploit / PoC
- None known
- Remote exploitation
- Not remotely exploitable (local or adjacent access needed)
- CVSS
- 7.8 (v3.1, CNA)CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:HOpen in CVSS calculator
Show all 8 CVSS metrics
- Attack vector: Local
- Attack complexity: Low
- Privileges required: Low
- User interaction: None
- Scope: Unchanged
- Confidentiality impact: High
- Integrity impact: High
- Availability impact: High
- EPSS
- 0.41% chance of exploitation in 30 days (percentile 27, 2026-11-26)
- CWE
- CWE-282, CWE-427
- Modified
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 and fixed versions
| Package / product | Affected | Fixed | Source |
|---|---|---|---|
| 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 | — | cvelist |
Check your systems with an agent
Paste this into Claude Code, Cursor or another coding agent. It only reads; it changes nothing.
Check whether anything I run is affected by CVE-2022-29187. Work read-only: do not install, upgrade, delete or change anything. Details: https://flawdb.com/CVE-2022-29187.md Affected: 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: git 2.30.5, git 2.31.4, git 2.32.3, git 2.33.4, git 2.34.4, git 2.35.4, git 2.36.2, git 2.37.1 Steps: 1. Search this machine and project for git: dependency manifests and lockfiles, installed packages, container images and running services. 2. For each match, note the installed version and whether it is inside the affected range. 3. Report a table: location, installed version, affected (yes / no / unsure), evidence. If affected, say which fixed version or mitigation from the details link applies, but don't apply it.
References
Vendor advisories
- https://github.com/git/git/security/advisories/GHSA-j342-m5hw-rr3v
- 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/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/YROCMBWYFKRSS64PO6FUNM6L7LKBUKVW/
- 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/UDZRZAL7QULOB6V7MKT66MOMWJLBJPX4/
- https://security.gentoo.org/glsa/202312-15
- https://security.gentoo.org/glsa/202401-17
Other
- https://github.blog/2022-04-12-git-security-vulnerability-announced
- https://lore.kernel.org/git/xmqqv8s2fefi.fsf%40gitster.g/T/#u
- http://www.openwall.com/lists/oss-security/2022/07/14/1
- https://support.apple.com/kb/HT213496
- http://seclists.org/fulldisclosure/2022/Nov/1
- https://lists.debian.org/debian-lts-announce/2022/12/msg00025.html
FAQ
Is CVE-2022-29187 being exploited?
There is no confirmed exploitation: CVE-2022-29187 is not in the CISA Known Exploited Vulnerabilities catalog. No public exploit code is known. EPSS estimates a 0.41% chance of exploitation in the next 30 days (as of 2026-11-26).
How serious is CVE-2022-29187?
High: CVSS 7.8 (v3.1, scored by CNA). Not remotely exploitable (local or adjacent access needed).
Which versions are affected by CVE-2022-29187?
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.
Is there a fix for CVE-2022-29187?
Yes. Fixed in git 2.30.5, git 2.31.4, git 2.32.3, git 2.33.4, git 2.34.4, git 2.35.4, git 2.36.2, git 2.37.1. Upgrade git to 2.37.1 or later.
How do I check if I'm affected by CVE-2022-29187?
Find where you use the affected software (dependency lockfiles, installed packages, container images, servers) and compare the installed version with the affected range above. The agent prompt on this page does this read-only.