{"id":"CVE-2022-24765","state":"PUBLISHED","title":"Uncontrolled search for the Git directory in Git for Windows","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`.","publishedAt":"2022-04-12T00:00:00.000Z","updatedAt":"2025-12-16T17:47:44.510Z","severity":{"score":6,"label":"Medium","version":"3.1","vector":"CVSS:3.1/AV:L/AC:H/PR:L/UI:R/S:U/C:H/I:H/A:N","source":"GitHub_M"},"assigner":"GitHub_M","products":["git-for-windows git"],"affected":[{"vendor":"git-for-windows","product":"git","versions":[{"version":"< 2.35.2","status":"affected"}]}],"references":["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"],"weaknesses":["CWE-427"],"ingestedAt":"2026-10-29T19:49:43.915Z","source":{"repository":"CVEProject/cvelistV5","path":"cves/2022/24xxx/CVE-2022-24765.json","commit":"556c9d3a8cd17e218bb8e452ba7cd619a384ff47"},"raw":{"dataType":"CVE_RECORD","dataVersion":"5.2","cveMetadata":{"cveId":"CVE-2022-24765","state":"PUBLISHED","datePublished":"2022-04-12T00:00:00.000Z","dateUpdated":"2025-12-16T17:47:44.510Z","assignerShortName":"GitHub_M","assignerOrgId":"a0819718-46f1-4df5-94e2-005712e83aaa","dateReserved":"2022-02-10T00:00:00.000Z"},"containers":{"cna":{"title":"Uncontrolled search for the Git directory in Git for Windows","descriptions":[{"lang":"en","value":"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`."}],"affected":[{"vendor":"git-for-windows","product":"git","versions":[{"version":"< 2.35.2","status":"affected"}]}],"references":[{"url":"https://github.com/git-for-windows/git/security/advisories/GHSA-vw2c-22j4-2fh2"},{"url":"https://git-scm.com/book/en/v2/Appendix-A%3A-Git-in-Other-Environments-Git-in-Bash"},{"url":"https://git-scm.com/docs/git#Documentation/git.txt-codeGITCEILINGDIRECTORIEScode"},{"url":"http://www.openwall.com/lists/oss-security/2022/04/12/7","name":"[oss-security] 20220412 git v2.35.2 and friends for CVE-2022-24765","tags":["mailing-list"]},{"url":"https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/5PTN5NYEHYN2OQSHSAMCNICZNK2U4QH6/","name":"FEDORA-2022-e99ae504f5","tags":["vendor-advisory"]},{"url":"https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/BENQYTDGUL6TF3UALY6GSIEXIHUIYNWM/","name":"FEDORA-2022-3759ebabd2","tags":["vendor-advisory"]},{"url":"https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/SLP42KIZ6HACTVZMZLJLFJQ4W2XYT27M/","name":"FEDORA-2022-2fec5f30be","tags":["vendor-advisory"]},{"url":"https://support.apple.com/kb/HT213261"},{"url":"http://seclists.org/fulldisclosure/2022/May/31","name":"20220516 APPLE-SA-2022-05-16-8 Xcode 13.4","tags":["mailing-list"]},{"url":"https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/TRZG5CDUQ27OWTPC5MQOR4UASNXHWEZS/","name":"FEDORA-2022-dfd7e7fc0e","tags":["vendor-advisory"]},{"url":"https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/DDI325LOO2XBDDKLINOAQJEG6MHAURZE/","name":"FEDORA-2022-2a5de7cb8b","tags":["vendor-advisory"]},{"url":"https://lists.debian.org/debian-lts-announce/2022/12/msg00025.html","name":"[debian-lts-announce] 20221213 [SECURITY] [DLA 3239-1] git security update","tags":["mailing-list"]},{"url":"https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/DIKWISWUDFT2FAITYIA6372BVLH3OOOC/","name":"FEDORA-2023-470c7ea49e","tags":["vendor-advisory"]},{"url":"https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/YROCMBWYFKRSS64PO6FUNM6L7LKBUKVW/","name":"FEDORA-2023-e3c8abd37e","tags":["vendor-advisory"]},{"url":"https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/HVOLER2PIGMHPQMDGG4RDE2KZB74QLA2/","name":"FEDORA-2023-1068309389","tags":["vendor-advisory"]},{"url":"https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/UDZRZAL7QULOB6V7MKT66MOMWJLBJPX4/","name":"FEDORA-2023-3ec32f6d4e","tags":["vendor-advisory"]},{"url":"https://security.gentoo.org/glsa/202312-15","name":"GLSA-202312-15","tags":["vendor-advisory"]}],"metrics":[{"cvssV3_1":{"version":"3.1","vectorString":"CVSS:3.1/AV:L/AC:H/PR:L/UI:R/S:U/C:H/I:H/A:N","attackVector":"LOCAL","attackComplexity":"HIGH","privilegesRequired":"LOW","userInteraction":"REQUIRED","scope":"UNCHANGED","confidentialityImpact":"HIGH","integrityImpact":"HIGH","availabilityImpact":"NONE","baseScore":6,"baseSeverity":"MEDIUM"}}],"problemTypes":[{"descriptions":[{"cweId":"CWE-427","type":"CWE","lang":"en","description":"CWE-427: Uncontrolled Search Path Element"}]}],"providerMetadata":{"shortName":"GitHub_M","orgId":"a0819718-46f1-4df5-94e2-005712e83aaa","dateUpdated":"2023-12-27T10:06:30.486Z"},"source":{"advisory":"GHSA-vw2c-22j4-2fh2","discovery":"UNKNOWN"}},"adp":[{"title":"CVE Program Container","references":[{"url":"https://github.com/git-for-windows/git/security/advisories/GHSA-vw2c-22j4-2fh2","tags":["x_transferred"]},{"url":"https://git-scm.com/book/en/v2/Appendix-A%3A-Git-in-Other-Environments-Git-in-Bash","tags":["x_transferred"]},{"url":"https://git-scm.com/docs/git#Documentation/git.txt-codeGITCEILINGDIRECTORIEScode","tags":["x_transferred"]},{"url":"http://www.openwall.com/lists/oss-security/2022/04/12/7","name":"[oss-security] 20220412 git v2.35.2 and friends for CVE-2022-24765","tags":["mailing-list","x_transferred"]},{"url":"https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/5PTN5NYEHYN2OQSHSAMCNICZNK2U4QH6/","name":"FEDORA-2022-e99ae504f5","tags":["vendor-advisory","x_transferred"]},{"url":"https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/BENQYTDGUL6TF3UALY6GSIEXIHUIYNWM/","name":"FEDORA-2022-3759ebabd2","tags":["vendor-advisory","x_transferred"]},{"url":"https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/SLP42KIZ6HACTVZMZLJLFJQ4W2XYT27M/","name":"FEDORA-2022-2fec5f30be","tags":["vendor-advisory","x_transferred"]},{"url":"https://support.apple.com/kb/HT213261","tags":["x_transferred"]},{"url":"http://seclists.org/fulldisclosure/2022/May/31","name":"20220516 APPLE-SA-2022-05-16-8 Xcode 13.4","tags":["mailing-list","x_transferred"]},{"url":"https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/TRZG5CDUQ27OWTPC5MQOR4UASNXHWEZS/","name":"FEDORA-2022-dfd7e7fc0e","tags":["vendor-advisory","x_transferred"]},{"url":"https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/DDI325LOO2XBDDKLINOAQJEG6MHAURZE/","name":"FEDORA-2022-2a5de7cb8b","tags":["vendor-advisory","x_transferred"]},{"url":"https://lists.debian.org/debian-lts-announce/2022/12/msg00025.html","name":"[debian-lts-announce] 20221213 [SECURITY] [DLA 3239-1] git security update","tags":["mailing-list","x_transferred"]},{"url":"https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/DIKWISWUDFT2FAITYIA6372BVLH3OOOC/","name":"FEDORA-2023-470c7ea49e","tags":["vendor-advisory","x_transferred"]},{"url":"https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/YROCMBWYFKRSS64PO6FUNM6L7LKBUKVW/","name":"FEDORA-2023-e3c8abd37e","tags":["vendor-advisory","x_transferred"]},{"url":"https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/HVOLER2PIGMHPQMDGG4RDE2KZB74QLA2/","name":"FEDORA-2023-1068309389","tags":["vendor-advisory","x_transferred"]},{"url":"https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/UDZRZAL7QULOB6V7MKT66MOMWJLBJPX4/","name":"FEDORA-2023-3ec32f6d4e","tags":["vendor-advisory","x_transferred"]},{"url":"https://security.gentoo.org/glsa/202312-15","name":"GLSA-202312-15","tags":["vendor-advisory","x_transferred"]}],"providerMetadata":{"shortName":"CVE","orgId":"af854a3a-2127-422b-91ae-364da2661108","dateUpdated":"2024-08-03T04:20:50.377Z"}},{"title":"CISA ADP Vulnrichment","metrics":[{"other":{"type":"ssvc","content":{"timestamp":"2025-12-16T17:47:32.484278Z","id":"CVE-2022-24765","options":[{"Exploitation":"none"},{"Automatable":"no"},{"Technical Impact":"total"}],"role":"CISA Coordinator","version":"2.0.3"}}}],"providerMetadata":{"shortName":"CISA-ADP","orgId":"134c704f-9b21-4f2e-91b3-4a467353bcc0","dateUpdated":"2025-12-16T17:47:44.510Z"}}]}}}