Bypass of safe.directory protections in Git
Key facts
- Attack vector
- Local
- Privileges required
- Low
- User interaction
- None
- Attack complexity
- Low
- Impact type
- Code execution
- Confidentiality · integrity · availability
- High · High · High
- Fix status
- Partial Red Hat: 3 fixed, 1 without a fix
Attack profile from CVSS 3.1 · CNA. Fix status from CNA and Red Hat. Impact type from CWE-427.
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.
Why it matters now
SSVC decision points
Not available: CISA has not published SSVC decision points for this record.
Affected products
| Vendor | Product | Affected versions | Fixed in | Status | Source |
|---|---|---|---|---|---|
| Git | git | 2.30.3 to before 2.30.5; 2.31.2 to before 2.31.4; 2.32.1 to before 2.32.3; 2.33.2 to before 2.33.4; 2.34.2 to before 2.34.4; 2.35.2 to before 2.35.4; 2.36 to before 2.36.2; 2.37 to before 2.37.1 | 2.30.5, 2.31.4, 2.32.3, 2.33.4, 2.34.4, 2.35.4, 2.36.2, 2.37.1 | Patch available | CNA |
- git VendorGit Affected 2.30.3 to before 2.30.5; 2.31.2 to before 2.31.4; 2.32.1 to before 2.32.3; 2.33.2 to before 2.33.4; 2.34.2 to before 2.34.4; 2.35.2 to before 2.35.4; 2.36 to before 2.36.2; 2.37 to before 2.37.1 Fixed in 2.30.5, 2.31.4, 2.32.3, 2.33.4, 2.34.4, 2.35.4, 2.36.2, 2.37.1 Patch available CNA
CPE configurations NVD · 6
| CPE | Versions | Role | Vendor |
|---|---|---|---|
| cpe:2.3:a:git-scm:git:*:*:*:*:*:*:*:* | 2.30.3 to before 2.30.5; 2.31.2 to before 2.31.4; 2.32.1 to before 2.32.3; 2.33.2 to before 2.33.4; 2.34.2 to before 2.34.4; 2.35.2 to before 2.35.4; 2.36.0 to before 2.36.2; 2.37.0 to before 2.37.1 | Vulnerable | Git-scm |
| cpe:2.3:o:fedoraproject:fedora:35:*:*:*:*:*:*:* | 35 | Vulnerable | Fedoraproject |
| cpe:2.3:o:fedoraproject:fedora:36:*:*:*:*:*:*:* | 36 | Vulnerable | Fedoraproject |
| cpe:2.3:o:fedoraproject:fedora:37:*:*:*:*:*:*:* | 37 | Vulnerable | Fedoraproject |
| cpe:2.3:a:apple:xcode:*:*:*:*:*:*:*:* | before 14.1 | Vulnerable | Apple |
| cpe:2.3:o:debian:debian_linux:10.0:*:*:*:*:*:*:* | 10.0 | Vulnerable | Debian |
- cpe:2.3:a:git-scm:git:*:*:*:*:*:*:*:* Versions 2.30.3 to before 2.30.5; 2.31.2 to before 2.31.4; 2.32.1 to before 2.32.3; 2.33.2 to before 2.33.4; 2.34.2 to before 2.34.4; 2.35.2 to before 2.35.4; 2.36.0 to before 2.36.2; 2.37.0 to before 2.37.1 Vulnerable ·Git-scm
- cpe:2.3:o:fedoraproject:fedora:35:*:*:*:*:*:*:* Versions 35 Vulnerable ·Fedoraproject
- cpe:2.3:o:fedoraproject:fedora:36:*:*:*:*:*:*:* Versions 36 Vulnerable ·Fedoraproject
- cpe:2.3:o:fedoraproject:fedora:37:*:*:*:*:*:*:* Versions 37 Vulnerable ·Fedoraproject
- cpe:2.3:a:apple:xcode:*:*:*:*:*:*:*:* Versions before 14.1 Vulnerable ·Apple
- cpe:2.3:o:debian:debian_linux:10.0:*:*:*:*:*:*:* Versions 10.0 Vulnerable ·Debian
Remediation
- Fix · CNA git (git) Fixed in 2.30.5, 2.31.4, 2.32.3, 2.33.4, 2.34.4, 2.35.4, 2.36.2, 2.37.1
Red Hat 3 advisories
- RHSA-2024:0407 Released 2024-01-25 · Red Hat rating Moderategit security update
- Red Hat Enterprise Linux AppStream EUS (v.8.6) git-2.31.8-1.el8_6, git-all-2.31.8-1.el8_6, git-core-2.31.8-1.el8_6 +12
- RHSA-2023:2859 Released 2023-05-16 · Red Hat rating Moderategit security and bug fix update
- Red Hat Enterprise Linux AppStream (v. 8) git-2.39.1-1.el8, git-all-2.39.1-1.el8, git-core-2.39.1-1.el8 +12
- RHSA-2023:2319 Released 2023-05-09 · Red Hat rating Moderategit security and bug fix update
- Red Hat Enterprise Linux AppStream (v. 9) git-2.39.1-1.el9, git-all-2.39.1-1.el9, git-core-2.39.1-1.el9 +12
Vendor assessments
Red Hat
Red Hat rating: Moderate. Red Hat's page for this CVE →
| Product | Status | Plan or fix |
|---|---|---|
| Red Hat JBoss Data Grid 7 | Affected | No fix planned: Out of support scope |
| Red Hat Enterprise Linux AppStream (v. 8) | Fixed | RHSA-2023:2859 |
| Red Hat Enterprise Linux AppStream (v. 9) | Fixed | RHSA-2023:2319 |
| Red Hat Enterprise Linux AppStream EUS (v.8.6) | Fixed | RHSA-2024:0407 |
Not affected: 3 products
- Red Hat Enterprise Linux 6
- Red Hat Enterprise Linux 7
- Red Hat Software Collections
Timeline
- 2026-10-02 Threatist record created from CVE-2022-29187
References
Advisory 14
- https://github.com/git/git/security/advisories/GHSA-j342-m5hw-rr3v
- https://github.blog/2022-04-12-git-security-vulnerability-announced
- [oss-security] 20220713 Git v2.37.1 and friends for CVE-2022-29187
- FEDORA-2022-dfd7e7fc0e
- FEDORA-2022-2a5de7cb8b
- https://support.apple.com/kb/HT213496
- 20221107 APPLE-SA-2022-11-01-1 Xcode 14.1
- [debian-lts-announce] 20221213 [SECURITY] [DLA 3239-1] git security update
- FEDORA-2023-470c7ea49e
- FEDORA-2023-e3c8abd37e
- FEDORA-2023-1068309389
- FEDORA-2023-3ec32f6d4e
- GLSA-202312-15
- GLSA-202401-17
More Git vulnerabilities
- TI-2025-30709 Git allows arbitrary code execution through broken config quoting KEVCVSS 3.1HIGH 8.1
- TI-2022-07580 gitattributes parsing integer overflow in git CVSS 3.1CRITICAL 9.8
- TI-2022-20244 Integer overflow in `git archive`, `git log --format` leading to RCE in git CVSS 3.1CRITICAL 9.8
- TI-2021-04400 malicious repositories can execute remote code while cloning CVSS 3.1HIGH 8.0
- TI-2024-21101 Git's recursive clones on case-insensitive filesystems that support symlinks are susceptible to Remote Code Execution CVSS 3.1CRITICAL 9.1
- TI-2023-10933 "git apply --reject" partially-controlled arbitrary file write CVSS 3.1HIGH 7.5
Sources
- CVE-2022-29187 · CVE Program
- CVE-2022-29187 · NVD
- FIRST EPSS
- CVE-2022-29187 · Red Hat security data · CC BY 4.0
This product uses the NVD API but is not endorsed or certified by the NVD. Sources and licences