Git vulnerable to Remote Code Execution via Heap overflow in `git shell`
Key facts
- Attack vector
- Network
- Privileges required
- None
- User interaction
- Required
- Attack complexity
- Low
- Impact type
- Code execution
- Confidentiality · integrity · availability
- High · High · High
- Fix status
- Partial Red Hat: 3 fixed, 3 without a fix
Attack profile from CVSS 3.1 · NVD. Fix status from CNA and Red Hat. Impact type from CWE-122 and the CVSS impact.
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.
Why it matters now
SSVC decision points
Not available: CISA has not published SSVC decision points for this record.
Affected products
| Vendor | Product | Affected versions | Fixed in | Status | Source |
|---|---|---|---|---|---|
| Git | git | before 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 | 2.30.6 | Patch available | CNA |
- git VendorGit Affected before 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 Fixed in 2.30.6 Patch available CNA
CPE configurations NVD · 7
| CPE | Versions | Role | Vendor |
|---|---|---|---|
| cpe:2.3:a:git-scm:git:*:*:*:*:*:*:*:* | before 2.30.6; 2.31.0 to before 2.31.5; 2.32.0 to before 2.32.4; 2.33.0 to before 2.33.5; 2.34.0 to before 2.34.5; 2.35.0 to before 2.35.5; 2.36.0 to before 2.36.3; 2.37.0 to before 2.37.4 | Vulnerable | Git-scm |
| cpe:2.3:a:git-scm:git:2.38.0:*:*:*:*:*:*:* | 2.38.0 | Vulnerable | Git-scm |
| cpe:2.3:o:fedoraproject:fedora:35:*:*:*:*:*:*:* | 35 | Vulnerable | Fedoraproject |
| cpe:2.3:o:fedoraproject:fedora:36:*:*:*:*:*:*:* | 36 | Vulnerable | Fedoraproject |
| cpe:2.3:o:fedoraproject:fedora:37:*:*:*:*:*:*:* | 37 | Vulnerable | Fedoraproject |
| cpe:2.3:a:apple:xcode:*:*:*:*:*:*:*:* | before 14.1 | Vulnerable | Apple |
| cpe:2.3:o:debian:debian_linux:10.0:*:*:*:*:*:*:* | 10.0 | Vulnerable | Debian |
- cpe:2.3:a:git-scm:git:*:*:*:*:*:*:*:* Versions before 2.30.6; 2.31.0 to before 2.31.5; 2.32.0 to before 2.32.4; 2.33.0 to before 2.33.5; 2.34.0 to before 2.34.5; 2.35.0 to before 2.35.5; 2.36.0 to before 2.36.3; 2.37.0 to before 2.37.4 Vulnerable ·Git-scm
- cpe:2.3:a:git-scm:git:2.38.0:*:*:*:*:*:*:* Versions 2.38.0 Vulnerable ·Git-scm
- cpe:2.3:o:fedoraproject:fedora:35:*:*:*:*:*:*:* Versions 35 Vulnerable ·Fedoraproject
- cpe:2.3:o:fedoraproject:fedora:36:*:*:*:*:*:*:* Versions 36 Vulnerable ·Fedoraproject
- cpe:2.3:o:fedoraproject:fedora:37:*:*:*:*:*:*:* Versions 37 Vulnerable ·Fedoraproject
- cpe:2.3:a:apple:xcode:*:*:*:*:*:*:*:* Versions before 14.1 Vulnerable ·Apple
- cpe:2.3:o:debian:debian_linux:10.0:*:*:*:*:*:*:* Versions 10.0 Vulnerable ·Debian
Remediation
- Fix · CNA git (git) Fixed in 2.30.6
Red Hat 3 advisories
- RHSA-2024:0407 Released 2024-01-25 · Red Hat rating Moderategit security update
- Red Hat Enterprise Linux AppStream EUS (v.8.6) git-2.31.8-1.el8_6, git-all-2.31.8-1.el8_6, git-core-2.31.8-1.el8_6 +12
- RHSA-2023:2859 Released 2023-05-16 · Red Hat rating Moderategit security and bug fix update
- Red Hat Enterprise Linux AppStream (v. 8) git-2.39.1-1.el8, git-all-2.39.1-1.el8, git-core-2.39.1-1.el8 +12
- RHSA-2023:2319 Released 2023-05-09 · Red Hat rating Moderategit security and bug fix update
- Red Hat Enterprise Linux AppStream (v. 9) git-2.39.1-1.el9, git-all-2.39.1-1.el9, git-core-2.39.1-1.el9 +12
Fixed in the same release
Records fixed by the same vendor advisory or release, as the CNA lists them.
- Advisory ·
git — FEDORA-2022-fb088df94c
2 records Highest priority Priority MEDIUM 1 MEDIUM, 1 LOW
Other records, highest priority first
- TI-2022-18629 Git subject to exposure of sensitive information via local clone of symbolic linksPriority LOW 28
- Advisory ·
git — FEDORA-2022-53aadd995f
2 records Highest priority Priority MEDIUM 1 MEDIUM, 1 LOW
Other records, highest priority first
- TI-2022-18629 Git subject to exposure of sensitive information via local clone of symbolic linksPriority LOW 28
Show 1 more group
- Advisory ·
git — FEDORA-2022-8b58806840
2 records Highest priority Priority MEDIUM 1 MEDIUM, 1 LOW
Other records, highest priority first
- TI-2022-18629 Git subject to exposure of sensitive information via local clone of symbolic linksPriority LOW 28
Vendor assessments
Red Hat
Red Hat rating: Moderate. Red Hat's page for this CVE →
| Product | Status | Plan or fix |
|---|---|---|
| Red Hat Enterprise Linux 6 | Affected | No fix planned: Out of support scope |
| Red Hat Enterprise Linux 7 | Affected | No fix planned: Out of support scope |
| Red Hat Software Collections | Affected | No fix planned: Will not fix |
| Red Hat Enterprise Linux AppStream (v. 8) | Fixed | RHSA-2023:2859 |
| Red Hat Enterprise Linux AppStream (v. 9) | Fixed | RHSA-2023:2319 |
| Red Hat Enterprise Linux AppStream EUS (v.8.6) | Fixed | RHSA-2024:0407 |
Timeline
- 2026-10-02 Threatist record created from CVE-2022-39260
- 2026-10-16 EPSS moved to the 90th–95th percentile
References
Advisory 8
More Git vulnerabilities
- TI-2025-30709 Git allows arbitrary code execution through broken config quoting KEVCVSS 3.1HIGH 8.1
- TI-2022-07580 gitattributes parsing integer overflow in git CVSS 3.1CRITICAL 9.8
- TI-2022-20244 Integer overflow in `git archive`, `git log --format` leading to RCE in git CVSS 3.1CRITICAL 9.8
- TI-2021-04400 malicious repositories can execute remote code while cloning CVSS 3.1HIGH 8.0
- TI-2024-21101 Git's recursive clones on case-insensitive filesystems that support symlinks are susceptible to Remote Code Execution CVSS 3.1CRITICAL 9.1
- TI-2023-10933 "git apply --reject" partially-controlled arbitrary file write CVSS 3.1HIGH 7.5
Sources
- CVE-2022-39260 · CVE Program
- CVE-2022-39260 · NVD
- FIRST EPSS
- CVE-2022-39260 · Red Hat security data · CC BY 4.0
This product uses the NVD API but is not endorsed or certified by the NVD. Sources and licences