CVE-2022-24765 json
Uncontrolled search for the Git directory in Git for Windows
published 4y ago modified 2mo ago also BIT-git-2022-24765 , EUVD-2022-29592 , GHSA-vw2c-22j4-2fh2
- cvss
- 6.0
- version 3.1, CNA
- cisa kev
- Not listed
- not in CISA's catalog
- epss
- 1.0%
- EPSS 1.0% chance of exploitation in 30 days, percentile 63%
- public exploits
- 0
- none known
Summary
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`.
Patch / fix
- bitnami git 2.35.2
- git-scm git 2.35.2
- git git 2.35.2
- git_project git 2.35.2
- git_for_windows_project git_for_windows 2.35.2
- gitforwindows git 2.35.2
- apple xcode 13.4
- git Debian 14, Debian 13, Debian 12 1:2.35.2-1
debian advisories DEBIAN-CVE-2022-24765
- git Ubuntu 18.04 LTS 1:2.17.1-1ubuntu0.11
- git Ubuntu 20.04 LTS 1:2.25.1-1ubuntu3.4
- git Ubuntu 22.04 LTS 1:2.34.1-1ubuntu1.2
ubuntu advisories UBUNTU-CVE-2022-24765
Ubuntu security data © Canonical Ltd., from https://github.com/canonical/ubuntu-security-notices via OSV; changed: normalised to fixed package versions per release. CC BY-SA 4.0
- git RHEL 8 2.39.1-1.el8
- gitk RHEL 8 2.39.1-1.el8
- gitweb RHEL 8 2.39.1-1.el8
- git-all RHEL 8 2.39.1-1.el8
- git-gui RHEL 8 2.39.1-1.el8
- git-svn RHEL 8 2.39.1-1.el8
- git-core RHEL 8 2.39.1-1.el8
- perl-Git RHEL 8 2.39.1-1.el8
red hat advisories RHSA-2024:0407RHSA-2023:2859RHSA-2023:2319
- libgit2 SLES for SAP 15 SP2, SLES for SAP 15 SP1, SLES for SAP 15 +18 more 0.26.8-150000.3.15.1
- libgit2 SLES for SAP 15 SP2, SLES 15 SP2-LTSS, SLES 15 SP2-BCL +12 more 0.28.4-150200.3.3.1
- libgit2 SLE Module for Development Tools 15 SP4, openSUSE Leap 15.4 1.3.0-150400.3.3.1
- git SLE Module for Development Tools 15 SP3, SLE Module for Basesystem 15 SP3, openSUSE Leap 15.4 +1 more 2.35.3-150300.10.12.1
- git SLES for SAP 12 SP5, SLES for SAP 12 SP4, SLES for SAP 12 SP3 +11 more 2.26.2-27.52.1
- git SLES for SAP 15 SP2, SLES for SAP 15 SP1, SLES for SAP 15 +18 more 2.26.2-150000.36.1
suse advisories SUSE-SU-2022:3495-1SUSE-SU-2022:3494-1SUSE-SU-2022:3283-1SUSE-SU-2022:1484-1SUSE-SU-2022:1306-1SUSE-SU-2022:1260-1
- git openSUSE Tumbleweed 2.35.3-1.1
- libgit2 openSUSE Tumbleweed 1.4.3-1.1
- git-annex openSUSE Tumbleweed 10.20220624-1.1
opensuse advisories openSUSE-SU-2024:12003-1openSUSE-SU-2024:12005-1openSUSE-SU-2024:12223-1
- git AlmaLinux 8 2.39.1-1.el8
- gitk AlmaLinux 8 2.39.1-1.el8
- gitweb AlmaLinux 8 2.39.1-1.el8
- git-all AlmaLinux 8 2.39.1-1.el8
- git-gui AlmaLinux 8 2.39.1-1.el8
- git-svn AlmaLinux 8 2.39.1-1.el8
- git-core AlmaLinux 8 2.39.1-1.el8
- perl-Git AlmaLinux 8 2.39.1-1.el8
almalinux advisories ALSA-2023:2859ALSA-2023:2319
- git Alpine 3.13 2.30.3-r0
- git Alpine 3.14 2.32.1-r0
- git Alpine 3.15 2.34.2-r0
- git Alpine 3.24, Alpine 3.23, Alpine 3.22 +6 more 2.35.2-r0
- libgit2 Alpine 3.24, Alpine 3.23, Alpine 3.22 +5 more 1.4.4-r0
alpine advisories ALPINE-CVE-2022-24765
Alpine secdb © Alpine Linux, from https://secdb.alpinelinux.org via OSV; changed: normalised to fixed package versions per release. CC BY-SA 4.0
- git Arch Linux 2.35.3-1
arch linux advisories AVG-2679
Is CVE-2022-24765 in your dependencies? Fencer shows which of your repositories are affected as soon as an advisory lands, and opens the fix as a pull request.
Check with FencerVendor advisories
What the vendors themselves say about their products: affected, fixed or not affected, and what to do.
red hat product security vex CVE-2022-24765 updated cvss 7.8
git: On multi-user machines Git users might find themselves unexpectedly in a Git worktree
-
Red Hat Enterprise Linux 6 git, gitk, gitweb, git-all, git-cvs, git-gui, +6 more Red Hat Enterprise Linux 7 git, gitk, git-hg, git-p4, gitweb, git-all, +12 moreaffected: no fix planned “Out of support scope”
-
Red Hat Software Collections rh-git227-git, rh-git227-gitk, rh-git227-git-p4, rh-git227-gitweb, rh-git227-git-all, rh-git227-git-cvs, +10 moreaffected: no fix planned “Will not fix”
-
Red Hat Enterprise Linux AppStream (v. 8) git 2.39.1-1.el8, gitk 2.39.1-1.el8, gitweb 2.39.1-1.el8, git-all 2.39.1-1.el8, git-gui 2.39.1-1.el8, git-svn 2.39.1-1.el8, +8 morefixed: vendor fix RHSA-2023:2859
-
Red Hat Enterprise Linux AppStream (v. 9) git 2.39.1-1.el9, gitk 2.39.1-1.el9, gitweb 2.39.1-1.el9, git-all 2.39.1-1.el9, git-gui 2.39.1-1.el9, git-svn 2.39.1-1.el9, +8 morefixed: vendor fix RHSA-2023:2319
-
Red Hat Enterprise Linux AppStream EUS (v.8.6) git 2.31.8-1.el8_6, gitk 2.31.8-1.el8_6, gitweb 2.31.8-1.el8_6, git-all 2.31.8-1.el8_6, git-gui 2.31.8-1.el8_6, git-svn 2.31.8-1.el8_6, +8 morefixed: vendor fix RHSA-2024:0407
Red Hat CSAF VEX © Red Hat, Inc., from https://security.access.redhat.com/data/csaf/v2/vex/; changed: reduced to product statuses and remediations. CC BY 4.0 · csaf
CISA SSVC
- Exploitation
- none
- Automatable
- no
- Technical impact
- total
- Assessed
- 10mo ago
Exploit prediction
1.01% chance of exploitation in the next 30 days, higher than 63% of all scored CVEs (FIRST EPSS, 2026-11-09).
CVSS scores
| assigned by | version | score | vector |
|---|---|---|---|
| CNA | 3.1 | 6.0 | CVSS:3.1/AV:L/AC:H/PR:L/UI:R/S:U/C:H/I:H/A:N |
| NVD | 3.1 | 7.8 | CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H |
| NVD | 2.0 | 6.9 | AV:L/AC:M/Au:N/C:C/I:C/A:C |
| OSV | 3.1 | 7.8 | CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H |
Affected packages
| ecosystem | package | affected | fixed in |
|---|---|---|---|
| bitnami | git | <2.35.2 |
2.35.2 |
Affected products
- git-for-windows git
Classification
- Weakness
-
- CWE-427 Uncontrolled Search Path Element
References
-
lists.fedoraproject.org
/archives/list/package-announce%40lists.fedoraproject.org/message/5PTN5NYEHYN2OQSHSAMCNICZNK2U4QH6/
vendor-advisory, web
-
lists.fedoraproject.org
/archives/list/package-announce%40lists.fedoraproject.org/message/BENQYTDGUL6TF3UALY6GSIEXIHUIYNWM/
vendor-advisory, web
-
lists.fedoraproject.org
/archives/list/package-announce%40lists.fedoraproject.org/message/SLP42KIZ6HACTVZMZLJLFJQ4W2XYT27M/
vendor-advisory, web
-
lists.fedoraproject.org
/archives/list/package-announce%40lists.fedoraproject.org/message/TRZG5CDUQ27OWTPC5MQOR4UASNXHWEZS/
vendor-advisory, web
-
lists.fedoraproject.org
/archives/list/package-announce%40lists.fedoraproject.org/message/DDI325LOO2XBDDKLINOAQJEG6MHAURZE/
vendor-advisory, web
-
lists.fedoraproject.org
/archives/list/package-announce%40lists.fedoraproject.org/message/DIKWISWUDFT2FAITYIA6372BVLH3OOOC/
vendor-advisory, web
-
lists.fedoraproject.org
/archives/list/package-announce%40lists.fedoraproject.org/message/YROCMBWYFKRSS64PO6FUNM6L7LKBUKVW/
vendor-advisory, web
-
lists.fedoraproject.org
/archives/list/package-announce%40lists.fedoraproject.org/message/HVOLER2PIGMHPQMDGG4RDE2KZB74QLA2/
vendor-advisory, web
-
lists.fedoraproject.org
/archives/list/package-announce%40lists.fedoraproject.org/message/UDZRZAL7QULOB6V7MKT66MOMWJLBJPX4/
vendor-advisory, web
-
security.gentoo.org
/glsa/202312-15
vendor-advisory, web
-
git-scm.com
/book/en/v2/Appendix-A%3A-Git-in-Other-Environments-Git-in-Bash
vendor-advisory, advisory
-
git-scm.com
/docs/git#Documentation/git.txt-codeGITCEILINGDIRECTORIEScode
vendor-advisory, advisory
-
github.com
/git-for-windows/git/security/advisories/GHSA-vw2c-22j4-2fh2
mitigation, third-party-advisory, advisory
-
openwall.com
/lists/oss-security/2022/04/12/7
mailing-list, third-party-advisory, advisory
-
support.apple.com
/kb/HT213261
third-party-advisory, advisory
-
seclists.org
/fulldisclosure/2022/May/31
mailing-list, third-party-advisory, advisory
-
lists.debian.org
/debian-lts-announce/2022/12/msg00025.html
mailing-list, third-party-advisory, advisory
-
nvd.nist.gov
/vuln/detail/CVE-2022-24765
web
Sources
- CVE List CVE-2022-24765
- NVD CVE-2022-24765
- OSV BIT-git-2022-24765
Fencer Intel keeps one entry per vulnerability: the CVE id wins, then GHSA, and records that alias each other are merged, except that two CVEs always keep separate entries. The same data is available as JSON.
CPEs and fixed versions use Anchore's correction of NVD's data: git for windows improved version ranges, cpes, etc, and added upstream git since it does appear to affect normal git when using on multi-user machines.