{"id":"CVE-2022-24765","published":"2022-04-12T00:00:00Z","modified":"2025-12-16T17:47:44Z","title":"Uncontrolled search for the Git directory in Git for Windows","vendor":"git-for-windows","product":"git","tier":"tail","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`.","provenance":"source","from":"CVE.org"},"cvss":{"score":6,"severity":"MEDIUM","version":"3.1","vector":"CVSS:3.1/AV:L/AC:H/PR:L/UI:R/S:U/C:H/I:H/A:N","provenance":"source","from":"CVE.org CNA"},"epss":{"score":0.0101,"percentile":0.63975,"provenance":"source"},"cwes":[{"id":"CWE-427","name":"Uncontrolled Search Path Element"}],"references":[{"url":"https://github.com/git-for-windows/git/security/advisories/GHSA-vw2c-22j4-2fh2","tags":[]},{"url":"https://git-scm.com/book/en/v2/Appendix-A%3A-Git-in-Other-Environments-Git-in-Bash","tags":[]},{"url":"https://git-scm.com/docs/git#Documentation/git.txt-codeGITCEILINGDIRECTORIEScode","tags":[]},{"url":"http://www.openwall.com/lists/oss-security/2022/04/12/7","tags":["mailing-list"]},{"url":"https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/5PTN5NYEHYN2OQSHSAMCNICZNK2U4QH6/","tags":["vendor-advisory"]},{"url":"https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/BENQYTDGUL6TF3UALY6GSIEXIHUIYNWM/","tags":["vendor-advisory"]},{"url":"https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/SLP42KIZ6HACTVZMZLJLFJQ4W2XYT27M/","tags":["vendor-advisory"]},{"url":"https://support.apple.com/kb/HT213261","tags":[]},{"url":"http://seclists.org/fulldisclosure/2022/May/31","tags":["mailing-list"]},{"url":"https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/TRZG5CDUQ27OWTPC5MQOR4UASNXHWEZS/","tags":["vendor-advisory"]},{"url":"https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/DDI325LOO2XBDDKLINOAQJEG6MHAURZE/","tags":["vendor-advisory"]},{"url":"https://lists.debian.org/debian-lts-announce/2022/12/msg00025.html","tags":["mailing-list"]},{"url":"https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/DIKWISWUDFT2FAITYIA6372BVLH3OOOC/","tags":["vendor-advisory"]},{"url":"https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/YROCMBWYFKRSS64PO6FUNM6L7LKBUKVW/","tags":["vendor-advisory"]},{"url":"https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/HVOLER2PIGMHPQMDGG4RDE2KZB74QLA2/","tags":["vendor-advisory"]},{"url":"https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/UDZRZAL7QULOB6V7MKT66MOMWJLBJPX4/","tags":["vendor-advisory"]},{"url":"https://security.gentoo.org/glsa/202312-15","tags":["vendor-advisory"]}],"priority":{"score":22.0,"factors":[{"name":"EPSS percentile","points":12.8},{"name":"Public exploit code","points":5.0},{"name":"CVSS severity","points":4.2}]},"exploitSources":{"pocGithub":{"count":1,"skipped":0,"earliest":"2026-11-06","earliestUrl":"https://github.com/federiconbaez/cortex9-git-safe-directory-discovery-model","repos":[{"name":"federiconbaez/cortex9-git-safe-directory-discovery-model","url":"https://github.com/federiconbaez/cortex9-git-safe-directory-discovery-model","stars":0,"created":"2026-11-06"}]},"first":{"date":"2026-11-06","source":"PoC-in-GitHub","url":"https://github.com/federiconbaez/cortex9-git-safe-directory-discovery-model"},"provenance":"source"},"vendorSlug":"git-for-windows","affectedVersions":[{"vendor":"git-for-windows","product":"git","versions":["< 2.35.2"]}],"ssvc":{"exploitation":"none","automatable":"no","technicalImpact":"total","timestamp":"2025-12-16T17:47:32.484278Z","from":"CISA ADP","provenance":"source"},"euvd":{"id":"EUVD-2022-29592","exploited":false,"provenance":"source"},"lineage":{"familyId":"fam-git-for-windows-git-cve-2022-24765","children":[{"from":"CVE-2022-24765","to":"CVE-2022-29187","relation":"incomplete-fix","confidence":"high","kind":"lineage","evidence":[{"kind":"text","provenance":"source","relation":"incomplete-fix","quote":"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.","from":"CVE.org","in":"CVE-2022-29187"}]}]}}