Uncontrolled search for the Git directory in Git for Windows
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, 3 without a fix
Attack profile from CVSS 3.1 · NVD. Fix status from CNA and Red Hat. Impact type from CWE-427.
Summary
Git for Windows is a fork of Git containing Windows-specific patches. This vulnerability affects users working on multi-user machines, where untrusted parties have write access to the same hard disk. Those untrusted parties could create the folder `C:\.git`, which would be picked up by Git operations run supposedly outside a repository while searching for a Git directory. Git would then respect any config in said Git directory. Git Bash users who set `GIT_PS1_SHOWDIRTYSTATE` are vulnerable as well. Users who installed posh-gitare vulnerable simply by starting a PowerShell. Users of IDEs such as Visual Studio are vulnerable: simply creating a new project would already read and respect the config specified in `C:\.git\config`. Users of the Microsoft fork of Git are vulnerable simply by starting a Git Bash. The problem has been patched in Git for Windows v2.35.2. Users unable to upgrade may create the folder `.git` on all drives where Git commands are run, and remove read/write access from those folders as a workaround. Alternatively, define or extend `GIT_CEILING_DIRECTORIES` to cover the _parent_ directory of the user profile, e.g. `C:\Users` if the user profile is located in `C:\Users\my-user-name`.
Why it matters now
SSVC decision points
CISA ADP · SSVC 2.0.3
- Exploitation
- None
- Automatable
- No
- Technical impact
- Total
The decision (Track, Attend, Act) also depends on your mission and well-being impact; see CISA's SSVC guide.
Affected products
| Vendor | Product | Affected versions | Fixed in | Status | Source |
|---|---|---|---|---|---|
| git-for-windows | git | before 2.35.2 | 2.35.2 | Patch available | CNA |
- git Vendorgit-for-windows Affected before 2.35.2 Fixed in 2.35.2 Patch available CNA
CPE configurations NVD · 8
| CPE | Versions | Role | Vendor |
|---|---|---|---|
| cpe:2.3:a:git-scm:git:*:*:*:*:*:*:*:* | before 2.35.2 | Vulnerable | Git-scm |
| cpe:2.3:o:microsoft:windows:-:*:*:*:*:*:*:* | not specified by NVD | Running on | Microsoft |
| cpe:2.3:o:fedoraproject:fedora:34:*:*:*:*:*:*:* | 34 | Vulnerable | Fedoraproject |
| 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 13.4 | Vulnerable | Apple |
| cpe:2.3:o:debian:debian_linux:10.0:*:*:*:*:*:*:* | 10.0 | Vulnerable | Debian |
- cpe:2.3:a:git-scm:git:*:*:*:*:*:*:*:* Versions before 2.35.2 Vulnerable ·Git-scm
- cpe:2.3:o:microsoft:windows:-:*:*:*:*:*:*:* Versions not specified by NVD Running on ·Microsoft
- cpe:2.3:o:fedoraproject:fedora:34:*:*:*:*:*:*:* Versions 34 Vulnerable ·Fedoraproject
- 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 13.4 Vulnerable ·Apple
- cpe:2.3:o:debian:debian_linux:10.0:*:*:*:*:*:*:* Versions 10.0 Vulnerable ·Debian
Remediation
- Fix · CNA git (git-for-windows) Fixed in 2.35.2
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 Enterprise Linux 6 | Affected | No fix planned: Out of support scope |
| Red Hat Enterprise Linux 7 | Affected | No fix planned: Out of support scope |
| Red Hat Software Collections | Affected | No fix planned: Will not fix |
| 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 |
Timeline
- 2026-10-02 Threatist record created from CVE-2022-24765
References
Advisory 17
- https://github.com/git-for-windows/git/security/advisories/GHSA-vw2c-22j4-2fh2
- https://git-scm.com/book/en/v2/Appendix-A%3A-Git-in-Other-Environments-Git-in-Bash
- https://git-scm.com/docs/git#Documentation/git.txt-codeGITCEILINGDIRECTORIEScode
- [oss-security] 20220412 git v2.35.2 and friends for CVE-2022-24765
- FEDORA-2022-e99ae504f5
- FEDORA-2022-3759ebabd2
- FEDORA-2022-2fec5f30be
- https://support.apple.com/kb/HT213261
- 20220516 APPLE-SA-2022-05-16-8 Xcode 13.4
- FEDORA-2022-dfd7e7fc0e
- FEDORA-2022-2a5de7cb8b
- [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
More git-for-windows vulnerabilities
- TI-2026-44986 Git for Windows: Server-advertised bundle-uri can trigger outbound SMB callbacks via UNC and file:// paths on Windows CVSS 3.1HIGH 7.4
- TI-2025-40849 Git for Windows leaks NTLM hash when cloning from an attacker-controlled server CVSS 3.1HIGH 7.4
- TI-2018-07996 In Git before 2.13.7, 2.14.x before 2.14.4, 2.15.x before 2.15.2, 2.16.x before 2.16.4… CVSS 3.0HIGH 7.8
- TI-2026-85080 Out-of-bounds write in Git for Windows credential helper CVSS 3.1MEDIUM 4.4
- TI-2022-20294 Git clone remote code execution vulnerability in git-for-windows CVSS 3.1HIGH 8.6
- TI-2023-09447 gitk can inadvertently call executables in the worktree CVSS 3.1HIGH 8.6
Sources
- CVE-2022-24765 · CVE Program
- CVE-2022-24765 · NVD
- FIRST EPSS
- CVE-2022-24765 · 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