# CVE-2022-39260: Git vulnerable to Remote Code Execution via Heap overflow in \`git shell\`

- Priority: **Routine**
- Reason: Not severe (CVSS 8.5, network access); no exploitation reported by the 5 checked sources
- Next step: Fix in the normal cadence
- Status: published
- Published: 2022-10-19 · Modified: 2024-08-03
- Aliases: ALPINE-CVE-2022-39260, UBUNTU-CVE-2022-39260, USN-5686-2, DEBIAN-CVE-2022-39260, CGA-ffj7-6wph-82qp, CGA-pm42-q8fw-wjw7
- Record: https://cvemate.com/vulnerability/CVE-2022-39260 · JSON: https://cvemate.com/vulnerability/CVE-2022-39260/json

## Description

```text
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.
```

## Signals

- CVSS: 8.8 high (v3.1, NVD) CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H
- EPSS: 3.955%, percentile 90.74%, as of 2026-12-04
- Known exploited (KEV): CISA not listed, ENISA not listed, CIRCL not listed
- Ransomware use: none recorded
- Public exploits: 0

## Affected

- alpine git (Alpine Linux): ≥ 2.31.0, \< 2.30.6-r0 \| ≥ 2.31.0, \< 2.32.4-r0 \| ≥ 2.31.0, \< 2.34.5-r0 \| ≥ 2.31.0, \< 2.36.3-r0 \| ≥ 2.31.0, \< 2.38.1-r0 \| \< 2.30.6-r0 \| ≥ 2.32.0, \< 2.32.4-r0 \| ≥ 2.34.0, \< 2.34.5-r0 \| ≥ 2.36.0, \< 2.36.3-r0 \| ≥ 2.37.0, \< 2.38.1-r0
- chainguard git (Chainguard): \< 2.38.1-r0
- wolfi git (Wolfi): \< 2.38.1-r0
- apple xcode: \< 14.1
- debian git (Debian): \< 1:2.38.1-1
- ubuntu git (Ubuntu): \< 1:2.7.4-0ubuntu1.10+esm3 \| \< 1:2.17.1-1ubuntu0.13 \| \< 1:2.25.1-1ubuntu3.6 \| \< 1:2.34.1-1ubuntu1.5
- debian debian\_linux: 10.0
- fedoraproject fedora: 35 \| 36 \| 37
- git-scm git: \< 2.30.6 \| ≥ 2.31.0, \< 2.31.5 \| ≥ 2.32.0, \< 2.32.4 \| ≥ 2.33.0, \< 2.33.5 \| ≥ 2.34.0, \< 2.34.5 \| ≥ 2.35.0, \< 2.35.5 \| ≥ 2.36.0, \< 2.36.3 \| ≥ 2.37.0, \< 2.37.4 \| 2.38.0
- git git: \< 2.30.6 \| \> 2.31.0, \< 2.31.5 \| \> 2.32.0, \< 2.32.4 \| \> 2.33.0, \< 2.33.5 \| \> 2.34.0, \< 2.34.5 \| \> 2.34.0, \< 2.35.5 \| \> 2.35.0, \< 2.36.3 \| \> 2.37.0, \< 2.37.4

## References

- <https://github.com/git/git/security/advisories/GHSA-rjr6-wcq6-83p6>
- <https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/UKFHE4KVD7EKS5J3KTDFVBEKU3CLXGVV/>
- <https://support.apple.com/kb/HT213496>
- <https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/OHNO2FB55CPX47BAXMBWUBGWHO6N6ZZH/>
- <http://seclists.org/fulldisclosure/2022/Nov/1>
- <https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/C7B6JPKX5CGGLAHXJVQMIZNNEEB72FHD/>
- <https://lists.debian.org/debian-lts-announce/2022/12/msg00025.html>
- <https://security.gentoo.org/glsa/202312-15>
- <https://security.alpinelinux.org/vuln/CVE-2022-39260>
- <https://ubuntu.com/security/CVE-2022-39260>
- <https://ubuntu.com/security/notices/USN-5686-1>
- <https://ubuntu.com/security/notices/USN-5686-2>
- <https://ubuntu.com/security/notices/USN-5686-3>
- <https://www.cve.org/CVERecord?id=CVE-2022-39260>
- <https://security-tracker.debian.org/tracker/CVE-2022-39260>
- <https://github.com/CVEProject/cvelistV5/tree/main/cves/2022/39xxx/CVE-2022-39260.json>
- <https://nvd.nist.gov/vuln/detail/CVE-2022-39260>

---

Data as of 2026-12-05T02:45:59.605Z. The priority label is CveMate's own model from public evidence, not an official rating, and it knows nothing about your assets. How labels are decided: https://cvemate.com/faq#priority
