CVE-2022-24765Uncontrolled search for the Git directory in Git for Windows
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`.
What to do
Fixed builds are available from AlmaLinux, Alpine, Debian, Red Hat, Ubuntu: see the table below for the fixed version per release.
Is your server affected? One read-only command checks every installed package against this CVE and all others, using each vendor's fixed versions. Get started or get a free API key.
curl -sS "https://api.cvefocus.com/v1/check?format=text" -H "Authorization: Bearer $CVEFOCUS_KEY" \ -H "Content-Type: text/plain" --data-binary @inventory.txt
Vendor status at a glance
Status by vendor and release
From each vendor's own security data and VEX statements. "Fixed" means a fixed build is published for that release.
| Release | Package | Status | Fixed version | Advisory |
|---|---|---|---|---|
| Ubuntu 22.04 | git | Fixed | 1:2.34.1-1ubuntu1.2 | UBUNTU-CVE-2022-24765 |
| Ubuntu 20.04 | git | Fixed | 1:2.25.1-1ubuntu3.4 | UBUNTU-CVE-2022-24765 |
| Ubuntu 18.04 | git | Fixed | 1:2.17.1-1ubuntu0.11 | UBUNTU-CVE-2022-24765 |
| Debian 14 | git | Fixed | 1:2.35.2-1 | DEBIAN-CVE-2022-24765 |
| Debian 13 | git | Fixed | 1:2.35.2-1 | DEBIAN-CVE-2022-24765 |
| Debian 12 | git | Fixed | 1:2.35.2-1 | DEBIAN-CVE-2022-24765 |
| Red Hat Enterprise Linux 9 | git | Fixed | 0:2.39.1-1.el9 | RHSA-2023:2319 |
| Red Hat Enterprise Linux 9 | git-all | Fixed | 0:2.39.1-1.el9 | RHSA-2023:2319 |
| Red Hat Enterprise Linux 9 | git-core | Fixed | 0:2.39.1-1.el9 | RHSA-2023:2319 |
| Red Hat Enterprise Linux 9 | git-core-doc | Fixed | 0:2.39.1-1.el9 | RHSA-2023:2319 |
| Red Hat Enterprise Linux 9 | git-credential-libsecret | Fixed | 0:2.39.1-1.el9 | RHSA-2023:2319 |
| Red Hat Enterprise Linux 9 | git-daemon | Fixed | 0:2.39.1-1.el9 | RHSA-2023:2319 |
| Red Hat Enterprise Linux 9 | git-email | Fixed | 0:2.39.1-1.el9 | RHSA-2023:2319 |
| Red Hat Enterprise Linux 9 | git-gui | Fixed | 0:2.39.1-1.el9 | RHSA-2023:2319 |
| Red Hat Enterprise Linux 9 | git-instaweb | Fixed | 0:2.39.1-1.el9 | RHSA-2023:2319 |
| Red Hat Enterprise Linux 9 | git-subtree | Fixed | 0:2.39.1-1.el9 | RHSA-2023:2319 |
| Red Hat Enterprise Linux 9 | git-svn | Fixed | 0:2.39.1-1.el9 | RHSA-2023:2319 |
| Red Hat Enterprise Linux 9 | gitk | Fixed | 0:2.39.1-1.el9 | RHSA-2023:2319 |
| Red Hat Enterprise Linux 9 | gitweb | Fixed | 0:2.39.1-1.el9 | RHSA-2023:2319 |
| Red Hat Enterprise Linux 9 | perl-Git | Fixed | 0:2.39.1-1.el9 | RHSA-2023:2319 |
| Red Hat Enterprise Linux 9 | perl-Git-SVN | Fixed | 0:2.39.1-1.el9 | RHSA-2023:2319 |
| Red Hat Enterprise Linux 8 | git | Fixed | 0:2.39.1-1.el8 | RHSA-2023:2859 |
| Red Hat Enterprise Linux 8 | git-all | Fixed | 0:2.39.1-1.el8 | RHSA-2023:2859 |
| Red Hat Enterprise Linux 8 | git-core | Fixed | 0:2.39.1-1.el8 | RHSA-2023:2859 |
| Red Hat Enterprise Linux 8 | git-core-doc | Fixed | 0:2.39.1-1.el8 | RHSA-2023:2859 |
| Red Hat Enterprise Linux 8 | git-credential-libsecret | Fixed | 0:2.39.1-1.el8 | RHSA-2023:2859 |
| Red Hat Enterprise Linux 8 | git-daemon | Fixed | 0:2.39.1-1.el8 | RHSA-2023:2859 |
| Red Hat Enterprise Linux 8 | git-email | Fixed | 0:2.39.1-1.el8 | RHSA-2023:2859 |
| Red Hat Enterprise Linux 8 | git-gui | Fixed | 0:2.39.1-1.el8 | RHSA-2023:2859 |
| Red Hat Enterprise Linux 8 | git-instaweb | Fixed | 0:2.39.1-1.el8 | RHSA-2023:2859 |
| Red Hat Enterprise Linux 8 | git-subtree | Fixed | 0:2.39.1-1.el8 | RHSA-2023:2859 |
| Red Hat Enterprise Linux 8 | git-svn | Fixed | 0:2.39.1-1.el8 | RHSA-2023:2859 |
| Red Hat Enterprise Linux 8 | gitk | Fixed | 0:2.39.1-1.el8 | RHSA-2023:2859 |
| Red Hat Enterprise Linux 8 | gitweb | Fixed | 0:2.39.1-1.el8 | RHSA-2023:2859 |
| Red Hat Enterprise Linux 8 | perl-Git | Fixed | 0:2.39.1-1.el8 | RHSA-2023:2859 |
| Red Hat Enterprise Linux 8 | perl-Git-SVN | Fixed | 0:2.39.1-1.el8 | RHSA-2023:2859 |
| Red Hat Enterprise Linux 7 | emacs-git | Will not fix Out of support scope | ||
| Red Hat Enterprise Linux 7 | emacs-git-el | Will not fix Out of support scope | ||
| Red Hat Enterprise Linux 7 | git | Will not fix Out of support scope | ||
| Red Hat Enterprise Linux 7 | git-all | Will not fix Out of support scope | ||
| Red Hat Enterprise Linux 7 | git-bzr | Will not fix Out of support scope | ||
| Red Hat Enterprise Linux 7 | git-cvs | Will not fix Out of support scope | ||
| Red Hat Enterprise Linux 7 | git-daemon | Will not fix Out of support scope | ||
| Red Hat Enterprise Linux 7 | git-email | Will not fix Out of support scope | ||
| Red Hat Enterprise Linux 7 | git-gnome-keyring | Will not fix Out of support scope | ||
| Red Hat Enterprise Linux 7 | git-gui | Will not fix Out of support scope | ||
| Red Hat Enterprise Linux 7 | git-hg | Will not fix Out of support scope | ||
| Red Hat Enterprise Linux 7 | git-instaweb | Will not fix Out of support scope | ||
| Red Hat Enterprise Linux 7 | git-p4 | Will not fix Out of support scope | ||
| Red Hat Enterprise Linux 7 | git-svn | Will not fix Out of support scope | ||
| Red Hat Enterprise Linux 7 | gitk | Will not fix Out of support scope | ||
| Red Hat Enterprise Linux 7 | gitweb | Will not fix Out of support scope | ||
| Red Hat Enterprise Linux 7 | perl-Git | Will not fix Out of support scope | ||
| Red Hat Enterprise Linux 7 | perl-Git-SVN | Will not fix Out of support scope | ||
| Red Hat Enterprise Linux 6 | emacs-git | Will not fix Out of support scope | ||
| Red Hat Enterprise Linux 6 | emacs-git-el | Will not fix Out of support scope | ||
| Red Hat Enterprise Linux 6 | git | Will not fix Out of support scope | ||
| Red Hat Enterprise Linux 6 | git-all | Will not fix Out of support scope | ||
| Red Hat Enterprise Linux 6 | git-cvs | Will not fix Out of support scope | ||
| Red Hat Enterprise Linux 6 | git-daemon | Will not fix Out of support scope | ||
| Red Hat Enterprise Linux 6 | git-email | Will not fix Out of support scope | ||
| Red Hat Enterprise Linux 6 | git-gui | Will not fix Out of support scope | ||
| Red Hat Enterprise Linux 6 | git-svn | Will not fix Out of support scope | ||
| Red Hat Enterprise Linux 6 | gitk | Will not fix Out of support scope | ||
| Red Hat Enterprise Linux 6 | gitweb | Will not fix Out of support scope | ||
| Red Hat Enterprise Linux 6 | perl-Git | Will not fix Out of support scope | ||
| AlmaLinux 9 | git | Fixed | 2.39.1-1.el9 | ALSA-2023:2319 |
| AlmaLinux 9 | git-all | Fixed | 2.39.1-1.el9 | ALSA-2023:2319 |
| AlmaLinux 9 | git-core | Fixed | 2.39.1-1.el9 | ALSA-2023:2319 |
| AlmaLinux 9 | git-core-doc | Fixed | 2.39.1-1.el9 | ALSA-2023:2319 |
| AlmaLinux 9 | git-credential-libsecret | Fixed | 2.39.1-1.el9 | ALSA-2023:2319 |
| AlmaLinux 9 | git-daemon | Fixed | 2.39.1-1.el9 | ALSA-2023:2319 |
| AlmaLinux 9 | git-email | Fixed | 2.39.1-1.el9 | ALSA-2023:2319 |
| AlmaLinux 9 | git-gui | Fixed | 2.39.1-1.el9 | ALSA-2023:2319 |
| AlmaLinux 9 | git-instaweb | Fixed | 2.39.1-1.el9 | ALSA-2023:2319 |
| AlmaLinux 9 | git-subtree | Fixed | 2.39.1-1.el9 | ALSA-2023:2319 |
| AlmaLinux 9 | git-svn | Fixed | 2.39.1-1.el9 | ALSA-2023:2319 |
| AlmaLinux 9 | gitk | Fixed | 2.39.1-1.el9 | ALSA-2023:2319 |
| AlmaLinux 9 | gitweb | Fixed | 2.39.1-1.el9 | ALSA-2023:2319 |
| AlmaLinux 9 | perl-Git | Fixed | 2.39.1-1.el9 | ALSA-2023:2319 |
| AlmaLinux 9 | perl-Git-SVN | Fixed | 2.39.1-1.el9 | ALSA-2023:2319 |
| AlmaLinux 8 | git | Fixed | 2.39.1-1.el8 | ALSA-2023:2859 |
| AlmaLinux 8 | git-all | Fixed | 2.39.1-1.el8 | ALSA-2023:2859 |
| AlmaLinux 8 | git-core | Fixed | 2.39.1-1.el8 | ALSA-2023:2859 |
| AlmaLinux 8 | git-core-doc | Fixed | 2.39.1-1.el8 | ALSA-2023:2859 |
| AlmaLinux 8 | git-credential-libsecret | Fixed | 2.39.1-1.el8 | ALSA-2023:2859 |
| AlmaLinux 8 | git-daemon | Fixed | 2.39.1-1.el8 | ALSA-2023:2859 |
| AlmaLinux 8 | git-email | Fixed | 2.39.1-1.el8 | ALSA-2023:2859 |
| AlmaLinux 8 | git-gui | Fixed | 2.39.1-1.el8 | ALSA-2023:2859 |
| AlmaLinux 8 | git-instaweb | Fixed | 2.39.1-1.el8 | ALSA-2023:2859 |
| AlmaLinux 8 | git-subtree | Fixed | 2.39.1-1.el8 | ALSA-2023:2859 |
| AlmaLinux 8 | git-svn | Fixed | 2.39.1-1.el8 | ALSA-2023:2859 |
| AlmaLinux 8 | gitk | Fixed | 2.39.1-1.el8 | ALSA-2023:2859 |
| AlmaLinux 8 | gitweb | Fixed | 2.39.1-1.el8 | ALSA-2023:2859 |
| AlmaLinux 8 | perl-Git | Fixed | 2.39.1-1.el8 | ALSA-2023:2859 |
| AlmaLinux 8 | perl-Git-SVN | Fixed | 2.39.1-1.el8 | ALSA-2023:2859 |
| Alpine Linux 3.24 | git | Fixed | 2.35.2-r0 | ALPINE-CVE-2022-24765 |
| Alpine Linux 3.24 | libgit2 | Fixed | 1.4.4-r0 | ALPINE-CVE-2022-24765 |
| Alpine Linux 3.23 | git | Fixed | 2.35.2-r0 | ALPINE-CVE-2022-24765 |
| Alpine Linux 3.23 | libgit2 | Fixed | 1.4.4-r0 | ALPINE-CVE-2022-24765 |
| Alpine Linux 3.22 | git | Fixed | 2.35.2-r0 | ALPINE-CVE-2022-24765 |
| Alpine Linux 3.22 | libgit2 | Fixed | 1.4.4-r0 | ALPINE-CVE-2022-24765 |
| Alpine Linux 3.21 | git | Fixed | 2.35.2-r0 | ALPINE-CVE-2022-24765 |
| Alpine Linux 3.21 | libgit2 | Fixed | 1.4.4-r0 | ALPINE-CVE-2022-24765 |
| Alpine Linux 3.20 | git | Fixed | 2.35.2-r0 | ALPINE-CVE-2022-24765 |
| Alpine Linux 3.20 | libgit2 | Fixed | 1.4.4-r0 | ALPINE-CVE-2022-24765 |
| Alpine Linux 3.19 | git | Fixed | 2.35.2-r0 | ALPINE-CVE-2022-24765 |
| Alpine Linux 3.19 | libgit2 | Fixed | 1.4.4-r0 | ALPINE-CVE-2022-24765 |
| Alpine Linux 3.18 | git | Fixed | 2.35.2-r0 | ALPINE-CVE-2022-24765 |
| Alpine Linux 3.18 | libgit2 | Fixed | 1.4.4-r0 | ALPINE-CVE-2022-24765 |
| Alpine Linux 3.17 | git | Fixed | 2.35.2-r0 | ALPINE-CVE-2022-24765 |
| Alpine Linux 3.17 | libgit2 | Fixed | 1.4.4-r0 | ALPINE-CVE-2022-24765 |
| Alpine Linux 3.16 | git | Fixed | 2.35.2-r0 | ALPINE-CVE-2022-24765 |
| Alpine Linux 3.15 | git | Fixed | 2.34.2-r0 | ALPINE-CVE-2022-24765 |
| Alpine Linux 3.14 | git | Fixed | 2.32.1-r0 | ALPINE-CVE-2022-24765 |
| Alpine Linux 3.13 | git | Fixed | 2.30.3-r0 | ALPINE-CVE-2022-24765 |
What the vendor says
As published in the CVE record by GitHub_M, the CVE's assigner (usually the vendor). Check the vendor's advisory before acting.
- git-for-windows git: affected: < 2.35.2
Vendor advisories:
- https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/… (vendor-advisory)
- https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/… (vendor-advisory)
- https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/… (vendor-advisory)
- https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/… (vendor-advisory)
- https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/… (vendor-advisory)
- https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/… (vendor-advisory)
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/
About this page
Compiled by CVEfocus from the CVE List, the security data and VEX statements of Ubuntu, Debian, Red Hat, AlmaLinux, Rocky Linux and Microsoft, CISA's Known Exploited Vulnerabilities catalog and FIRST EPSS, refreshed several times a day (data status). Information only; see the disclaimer. Official record: cve.org · NVD.