# CVE-2022-24765: Uncontrolled search for the Git directory in Git for Windows

- Priority: **Routine**
- Reason: Not severe (CVSS 6, local access); no exploitation reported by the 5 checked sources
- Next step: Fix in the normal cadence
- Status: published
- Published: 2022-04-12 · Modified: 2025-12-16
- Aliases: ALPINE-CVE-2022-24765, MGASA-2022-0147, SUSE-SU-2022:1260-1, SUSE-SU-2022:1306-1, SUSE-SU-2022:1484-1, UBUNTU-CVE-2022-24765, USN-5376-1, USN-5376-2, DEBIAN-CVE-2022-24765, openSUSE-SU-2024:12003-1, openSUSE-SU-2024:12005-1, openSUSE-SU-2024:12223-1
- Record: https://cvemate.com/vulnerability/CVE-2022-24765 · JSON: https://cvemate.com/vulnerability/CVE-2022-24765/json

## Description

```text
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`.
```

## Signals

- CVSS: 7.8 high (v3.1, NVD) CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
- EPSS: 0.987%, percentile 63.577%, as of 2026-12-04
- Known exploited (KEV): CISA not listed, ENISA not listed, CIRCL not listed
- Ransomware use: none recorded
- Public exploits: 0

## Affected (first 20 of 51)

- alpine git (Alpine Linux): \< 2.30.3-r0 \| \< 2.32.1-r0 \| \< 2.34.2-r0 \| \< 2.35.2-r0
- alpine libgit2 (Alpine Linux): \< 1.4.4-r0
- apple xcode: \< 13.4
- debian git (Debian): \< 1:2.35.2-1
- ubuntu git (Ubuntu): \< 1:2.17.1-1ubuntu0.10 \| \< 1:2.25.1-1ubuntu3.3 \| \< 1:2.34.1-1ubuntu1.1 \| \< 1:2.17.1-1ubuntu0.11 \| \< 1:2.25.1-1ubuntu3.4 \| \< 1:2.34.1-1ubuntu1.2
- debian debian\_linux: 10.0
- fedoraproject fedora: 34 \| 35 \| 36 \| 37
- git-for-windows git: \< 2.35.2
- git-scm git: \< 2.35.2
- mageia git (Mageia): \< 2.30.4-1.mga8
- opensuse git-annex&distro=openSUSE Tumbleweed (openSUSE): \< 10.20220624-1.1
- opensuse git&distro=openSUSE Leap 15.3 (openSUSE): \< 2.26.2-150000.36.1 \| \< 2.35.3-150300.10.12.1
- opensuse git&distro=openSUSE Leap 15.4 (openSUSE): \< 2.35.3-150300.10.12.1
- opensuse git&distro=openSUSE Tumbleweed (openSUSE): \< 2.35.3-1.1
- opensuse libgit2&distro=openSUSE Tumbleweed (openSUSE): \< 1.4.3-1.1
- suse git&distro=HPE Helion OpenStack 8 (SUSE Linux Enterprise): \< 2.26.2-27.52.1
- suse git&distro=SUSE Enterprise Storage 6 (SUSE Linux Enterprise): \< 2.26.2-150000.36.1
- suse git&distro=SUSE Enterprise Storage 7 (SUSE Linux Enterprise): \< 2.26.2-150000.36.1
- suse git&distro=SUSE Linux Enterprise High Performance Computing 15 SP1-ESPOS (SUSE Linux Enterprise): \< 2.26.2-150000.36.1
- suse git&distro=SUSE Linux Enterprise High Performance Computing 15 SP1-LTSS (SUSE Linux Enterprise): \< 2.26.2-150000.36.1

## References (first 20 of 34)

- <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>
- <http://www.openwall.com/lists/oss-security/2022/04/12/7>
- <https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/5PTN5NYEHYN2OQSHSAMCNICZNK2U4QH6/>
- <https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/BENQYTDGUL6TF3UALY6GSIEXIHUIYNWM/>
- <https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/SLP42KIZ6HACTVZMZLJLFJQ4W2XYT27M/>
- <https://support.apple.com/kb/HT213261>
- <http://seclists.org/fulldisclosure/2022/May/31>
- <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.debian.org/debian-lts-announce/2022/12/msg00025.html>
- <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.alpinelinux.org/vuln/CVE-2022-24765>
- <https://advisories.mageia.org/MGASA-2022-0147.html>
- <https://bugs.mageia.org/show_bug.cgi?id=30277>

---

Data as of 2026-12-05T02:45:40.635Z. The priority label is CveMate's own model from public evidence, not an official rating, and it knows nothing about your assets. How labels are decided: https://cvemate.com/faq#priority
