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

- Severity: Medium 6.0 (CVSS:3.1, scored by GitHub_M) `CVSS:3.1/AV:L/AC:H/PR:L/UI:R/S:U/C:H/I:H/A:N`
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Likelihood of exploitation in the next 30 days (EPSS): 0.99%, higher than 63% of CVEs (2026-12-01)
- Published: 2022-04-12T00:00:00.000Z
- Modified: 2026-09-08T08:47:33.047Z
- Also known as: BIT-GIT-2022-24765, GHSA-vw2c-22j4-2fh2
- Weaknesses: CWE-427
- SSVC (CISA-ADP): exploitation none, automatable no, technical impact total
- Assigned by: GitHub_M

## Description

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

(As written by CVE List.)

## Affected

- git-for-windows git: < 2.35.2
- git-scm git: before 2.35.2
- fedoraproject fedora: 34; 35; 36; 37
- apple xcode: before 13.4
- debian debian_linux: 10.0
- git (Bitnami): before 2.35.2

## Every score

- GitHub_M: CVSS:3.1 6.0 Medium `CVSS:3.1/AV:L/AC:H/PR:L/UI:R/S:U/C:H/I:H/A:N`
- NVD: CVSS:3.1 7.8 High `CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H`
- NVD: CVSS:2.0 6.9 Medium `AV:L/AC:M/Au:N/C:C/I:C/A:C`
- Bitnami Vulnerability Database: rating High

## References

- <https://github.com/git-for-windows/git/security/advisories/GHSA-vw2c-22j4-2fh2> (advisory, mitigation, third-party-advisory)
- <https://git-scm.com/book/en/v2/Appendix-A%3A-Git-in-Other-Environments-Git-in-Bash> (advisory, vendor-advisory)
- <https://git-scm.com/docs/git#Documentation/git.txt-codeGITCEILINGDIRECTORIEScode> (advisory, vendor-advisory)
- <http://www.openwall.com/lists/oss-security/2022/04/12/7> (advisory, mailing-list, third-party-advisory)
- <https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/5PTN5NYEHYN2OQSHSAMCNICZNK2U4QH6/> (vendor-advisory, web)
- <https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/BENQYTDGUL6TF3UALY6GSIEXIHUIYNWM/> (vendor-advisory, web)
- <https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/SLP42KIZ6HACTVZMZLJLFJQ4W2XYT27M/> (vendor-advisory, web)
- <https://support.apple.com/kb/HT213261> (advisory, third-party-advisory)
- <http://seclists.org/fulldisclosure/2022/May/31> (advisory, mailing-list, third-party-advisory)
- <https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/TRZG5CDUQ27OWTPC5MQOR4UASNXHWEZS/> (vendor-advisory, web)
- <https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/DDI325LOO2XBDDKLINOAQJEG6MHAURZE/> (vendor-advisory, web)
- <https://lists.debian.org/debian-lts-announce/2022/12/msg00025.html> (advisory, mailing-list, third-party-advisory)
- <https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/DIKWISWUDFT2FAITYIA6372BVLH3OOOC/> (vendor-advisory, web)
- <https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/YROCMBWYFKRSS64PO6FUNM6L7LKBUKVW/> (vendor-advisory, web)
- <https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/HVOLER2PIGMHPQMDGG4RDE2KZB74QLA2/> (vendor-advisory, web)
- <https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/UDZRZAL7QULOB6V7MKT66MOMWJLBJPX4/> (vendor-advisory, web)
- <https://security.gentoo.org/glsa/202312-15> (vendor-advisory, web)
- <https://nvd.nist.gov/vuln/detail/CVE-2022-24765> (web)

## Sources

- CVE List: [CVE-2022-24765](https://www.cve.org/CVERecord?id=CVE-2022-24765), CVE Terms of Use, modified 2025-12-16
- NVD: [CVE-2022-24765](https://nvd.nist.gov/vuln/detail/CVE-2022-24765), Public domain, modified 2026-06-17
- Bitnami Vulnerability Database: [BIT-GIT-2022-24765](https://osv.dev/vulnerability/BIT-GIT-2022-24765), Apache-2.0, modified 2026-09-08

---

Page: https://cve.day/CVE-2022-24765 · Whole record: https://cve.day/CVE-2022-24765.json · Rebuilt by cve.day 2026-11-25T22:58:10.589Z
