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

- Severity: High 8.5 (CVSS:3.1, scored by GitHub_M) `CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:C/C:H/I:H/A:H`
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Likelihood of exploitation in the next 30 days (EPSS): 3.96%, higher than 90% of CVEs (2026-12-01)
- Published: 2022-10-19T00:00:00.000Z
- Modified: 2026-06-17T04:58:01.303Z
- Weaknesses: CWE-122, CWE-787
- Assigned by: GitHub_M

## Description

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.

(As written by CVE List.)

## Affected

- 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
- git-scm git: before 2.30.6; from 2.31.0 before 2.31.5; from 2.32.0 before 2.32.4; from 2.33.0 before 2.33.5; from 2.34.0 before 2.34.5; from 2.35.0 before 2.35.5; from 2.36.0 before 2.36.3; from 2.37.0 before 2.37.4; 2.38.0
- fedoraproject fedora: 35; 36; 37
- apple xcode: before 14.1
- debian debian_linux: 10.0

## Every score

- GitHub_M: CVSS:3.1 8.5 High `CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:C/C:H/I:H/A:H`
- NVD: CVSS:3.1 8.8 High `CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H`

## References

- <https://github.com/git/git/security/advisories/GHSA-rjr6-wcq6-83p6> (mitigation, third-party-advisory)
- <https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/UKFHE4KVD7EKS5J3KTDFVBEKU3CLXGVV/> (vendor-advisory)
- <https://support.apple.com/kb/HT213496> (third-party-advisory)
- <https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/OHNO2FB55CPX47BAXMBWUBGWHO6N6ZZH/> (vendor-advisory)
- <http://seclists.org/fulldisclosure/2022/Nov/1> (mailing-list, third-party-advisory)
- <https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/C7B6JPKX5CGGLAHXJVQMIZNNEEB72FHD/> (vendor-advisory)
- <https://lists.debian.org/debian-lts-announce/2022/12/msg00025.html> (mailing-list, third-party-advisory)
- <https://security.gentoo.org/glsa/202312-15> (vendor-advisory)

## Sources

- CVE List: [CVE-2022-39260](https://www.cve.org/CVERecord?id=CVE-2022-39260), CVE Terms of Use, modified 2024-08-03
- NVD: [CVE-2022-39260](https://nvd.nist.gov/vuln/detail/CVE-2022-39260), Public domain, modified 2026-06-17

---

Page: https://cve.day/CVE-2022-39260 · Whole record: https://cve.day/CVE-2022-39260.json · Rebuilt by cve.day 2026-11-25T22:58:15.893Z
