CVE-2022-39260 json
Git vulnerable to Remote Code Execution via Heap overflow in `git shell`
published 2022-10-19 4 y ago modified 2026-06-17 4 mo ago also EUVD-2022-41771
- cvss
- 8.5
- version 3.1, CNA
- cisa kev
- Not listed
- not in CISA's catalog
- epss
- 4.0%
- EPSS 4.0% chance of exploitation in 30 days, percentile 90%
- public exploits
- 0
- none known
Summary
Git is an open source, scalable, distributed revision control system. `git shell` is a restricted login shell that can be used to implement Git's push/pull functionality via SSH. In versions prior to 2.30.6, 2.31.5, 2.32.4, 2.33.5, 2.34.5, 2.35.5, 2.36.3, and 2.37.4, the function that splits the command arguments into an array improperly uses an `int` to represent the number of entries in the array, allowing a malicious actor to intentionally overflow the return value, leading to arbitrary heap writes. Because the resulting array is then passed to `execv()`, it is possible to leverage this attack to gain remote code execution on a victim machine. Note that a victim must first allow access to `git shell` as a login shell in order to be vulnerable to this attack. This problem is patched in versions 2.30.6, 2.31.5, 2.32.4, 2.33.5, 2.34.5, 2.35.5, 2.36.3, and 2.37.4 and users are advised to upgrade to the latest version. Disabling `git shell` access via remote logins is a viable short-term workaround.
Patch / fix
- git-scm git 2.30.6, 2.31.5, 2.32.4, 2.33.5, 2.34.5, 2.35.5, 2.36.3, 2.37.4
- apple xcode 14.1
- git Debian 14, Debian 13, Debian 12 1:2.38.1-1
debian advisories DEBIAN-CVE-2022-39260
- git Ubuntu 18.04 LTS 1:2.17.1-1ubuntu0.13
- git Ubuntu 20.04 LTS 1:2.25.1-1ubuntu3.6
- git Ubuntu 22.04 LTS 1:2.34.1-1ubuntu1.5
- git Ubuntu Pro 16.04 LTS 1:2.7.4-0ubuntu1.10+esm3
ubuntu advisories UBUNTU-CVE-2022-39260
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
- git SLES for SAP 15 SP2, SLES for SAP 15 SP1, SLES 15 SP2-LTSS +5 more 2.26.2-150000.47.1
- git SLES for SAP 12 SP5, SLES 12 SP5, SLE Software Development Kit 12 SP5 +2 more 2.26.2-27.60.1
- git SLE Module for Development Tools 15 SP4, SLE Module for Development Tools 15 SP3, SLE Module for Basesystem 15 SP4 +3 more 2.35.3-150300.10.18.1
suse advisories SUSE-SU-2023:0418-1SUSE-SU-2022:4271-1SUSE-SU-2022:3931-1
- git openSUSE Tumbleweed 2.38.1-1.1
opensuse advisories openSUSE-SU-2024:12487-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.6-r0
- git Alpine 3.14 2.32.4-r0
- git Alpine 3.15 2.34.5-r0
- git Alpine 3.16 2.36.3-r0
- git Alpine 3.24, Alpine 3.23, Alpine 3.22 +5 more 2.38.1-r0
alpine advisories ALPINE-CVE-2022-39260
Alpine secdb © Alpine Linux, from https://secdb.alpinelinux.org via OSV; changed: normalised to fixed package versions per release. CC BY-SA 4.0
Vendor 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-39260 updated cvss 8.8
git: git shell function that splits command arguments can lead to arbitrary heap writes.
-
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 more 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: workaround, no fix planned “Disabling `git shell` access via remote logins is a viable short-term workaround.”
-
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 “Disabling `git shell` access via remote logins is a viable short-term workaround.” 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 “Disabling `git shell` access via remote logins is a viable short-term workaround.” 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 “Disabling `git shell` access via remote logins is a viable short-term workaround.” 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 ICSA-24-046-11 updated cvss 8.5
Siemens SCALANCE XCM-/XRM-300
-
Siemens SCALANCE XCH328 (6GK5328-4TS01-2EC2) <V2.4 Siemens SCALANCE XCM324 (6GK5324-8TS01-2AC2) <V2.4 Siemens SCALANCE XCM328 (6GK5328-4TS01-2AC2) <V2.4 Siemens SCALANCE XCM332 (6GK5332-0GA01-2AC2) <V2.4 Siemens SCALANCE XRH334 (24 V DC, 8xFO, CC) (6GK5334-2TS01-2ER3) <V2.4 Siemens SCALANCE XRM334 (2x230 V AC, 8xFO) (6GK5334-2TS01-4AR3) <V2.4affected: fixed in V2.4 support.industry.siemens.com
+5 more productsfewer
Siemens SCALANCE XRM334 (2x230 V AC, 12xFO) (6GK5334-3TS01-4AR3) <V2.4 Siemens SCALANCE XRM334 (24 V DC, 8xFO) (6GK5334-2TS01-2AR3) <V2.4 Siemens SCALANCE XRM334 (24 V DC, 12xFO) (6GK5334-3TS01-2AR3) <V2.4 Siemens SCALANCE XRM334 (230 V AC, 8xFO) (6GK5334-2TS01-3AR3) <V2.4 Siemens SCALANCE XRM334 (230 V AC, 12xFO) (6GK5334-3TS01-3AR3) <V2.4
Facts from CISA's republication of the vendor's own advisory (CSAF); the linked advisory is the authoritative source. CISA notification · csaf
Exploit prediction
3.99% chance of exploitation in the next 30 days, higher than 90% of all scored CVEs (FIRST EPSS, 2026-11-08).
CVSS scores
| assigned by | version | score | vector |
|---|---|---|---|
| CNA | 3.1 | 8.5 | CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:C/C:H/I:H/A:H |
| NVD | 3.1 | 8.8 | CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H |
Affected products
- git git
Classification
References
-
lists.fedoraproject.org
/archives/list/package-announce%40lists.fedoraproject.org/message/UKFHE4KVD7EKS5J3KTDFVBEKU3CLXGVV/
vendor-advisory
-
lists.fedoraproject.org
/archives/list/package-announce%40lists.fedoraproject.org/message/OHNO2FB55CPX47BAXMBWUBGWHO6N6ZZH/
vendor-advisory
-
lists.fedoraproject.org
/archives/list/package-announce%40lists.fedoraproject.org/message/C7B6JPKX5CGGLAHXJVQMIZNNEEB72FHD/
vendor-advisory
-
security.gentoo.org
/glsa/202312-15
vendor-advisory
-
github.com
/git/git/security/advisories/GHSA-rjr6-wcq6-83p6
mitigation, third-party-advisory
-
support.apple.com
/kb/HT213496
third-party-advisory
-
seclists.org
/fulldisclosure/2022/Nov/1
mailing-list, third-party-advisory
-
lists.debian.org
/debian-lts-announce/2022/12/msg00025.html
mailing-list, third-party-advisory
Sources
- CVE List CVE-2022-39260
- NVD CVE-2022-39260
Fencer Vulns 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.