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

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.

Published: 2022-10-19 Last update: 2024-11-21 Assigner: [email protected] Source: [email protected]

Conclusion & alert: CVE-2022-39260 is rated Moderate Risk (64.5/100): CVSS High severity, with medium exploitation likelihood (EPSS 2.23%). Mandatory action: Review affected assets and schedule remediation.

Risk is dynamic; we continuously reassess and refresh what is shown on this page as upstream context changes.

Exploit prediction scoring system (EPSS) score for CVE-2022-39260

EPSS lead: Daily EPSS estimates relative likelihood of exploitation; percentile ranks this CVE among scored vulnerabilities (higher = more severe relative rank).

# Date Old EPSS score New EPSS score Delta (New - Old)
1 2026-04-04 1.27% 2.23% +0.96%
2 2026-02-16 1.09% 1.27% +0.18%
3 2025-12-28 1.09%

Full EPSS history (35 records total)

Common vulnerability scoring system (CVSS) metrics for CVE-2022-39260

CVSS metrics for this CVE.

Base score Version Severity Vector Exploitability Impact Score source
8.5 3.1 HIGH
CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:C/C:H/I:H/A:H Click to expand
Attack vector (AV:N)
Could be attacked over the internet or any normal routed network—not just someone sitting at the machine.
Attack complexity (AC:H)
Even with access, the exploit needs extra luck, timing, or a fussy environment to actually work.
Privileges required (PR:L)
A normal user session is enough; they don’t have to be admin.
User interaction (UI:N)
Nobody has to click “OK” or open a trap file; it can work without a victim helping.
Scope (S:C)
Breaking this can reach past the original component and bite other resources—bigger blast radius.
Confidentiality (C:H)
Serious risk that confidential data gets exposed in a big way.
Integrity (I:H)
They could widely tamper with or forge data—trust in the data is badly hurt.
Availability (A:H)
Could take the service down hard or make it unusable for people who depend on it.
1.8 6.0 [email protected]
8.8 3.1 HIGH
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H Click to expand
Attack vector (AV:N)
Could be attacked over the internet or any normal routed network—not just someone sitting at the machine.
Attack complexity (AC:L)
Once they can reach the bug, pulling it off is straightforward—no weird race conditions or rare setup.
Privileges required (PR:N)
No account or special rights needed—anonymous or random user is enough.
User interaction (UI:R)
A real person has to do something—click, install, enable—otherwise it doesn’t land.
Scope (S:U)
Damage stays in the same “trust bubble” as the broken component—no big spill into unrelated systems.
Confidentiality (C:H)
Serious risk that confidential data gets exposed in a big way.
Integrity (I:H)
They could widely tamper with or forge data—trust in the data is badly hurt.
Availability (A:H)
Could take the service down hard or make it unusable for people who depend on it.
2.8 5.9 [email protected]

Weakness enumeration for CVE-2022-39260

OS Trackers for CVE-2022-39260

vendor priority summary link
alpine CVE-2022-39260: 1 source package rows (git); 53 state rows across 7 repos (3.17-main, 3.18-main, 3.19-main, 3.20-main, 3.21-main, 3.22-main, edge-main); fixed 7, open 46. https://security.alpinelinux.org/vuln/CVE-2022-39260
debian not yet assigned CVE-2022-39260 not yet assigned priority: Debian including 1 source packages (git), 5 status rows across 5 suites (bookworm, bullseye, forky, sid, trixie): resolved 5. https://security-tracker.debian.org/tracker/CVE-2022-39260
gentoo high CVE-2022-39260: 1 GLSA(s) (202312-15), 1 atom(s) (dev-vcs/git); latest impact high. https://bugs.gentoo.org/buglist.cgi?quicksearch=CVE-2022-39260
redhat medium https://access.redhat.com/security/cve/CVE-2022-39260
suse medium CVE-2022-39260 severity moderate: SUSE including 152 source package names (1.16-30.77:git-core-2.35.3-150300.10.18.1, 1.17-29.77:git-core-2.35.3-150300.10.18.1, …), 397 product×package rows across 65 product lines (Container bci/golang, Container bci/nodejs, … (65 product lines)): Fixed 321, Known Not Affected 76. https://www.suse.com/security/cve/CVE-2022-39260/
ubuntu medium CVE-2022-39260 medium priority: Ubuntu including 1 source packages (git), 8 status rows across 8 suites (bionic, focal, jammy, kinetic, lunar, trusty, upstream, xenial): released 6, ignored 1, needs-triage 1. https://ubuntu.com/security/CVE-2022-39260

Affected software / configurations for CVE-2022-39260

Vendor Product Version Raw CPE
git-scm git < 2.30.6 cpe:2.3:a:git-scm:git:*:*:*:*:*:*:*:*
git-scm git >= 2.31.0, < 2.31.5 cpe:2.3:a:git-scm:git:*:*:*:*:*:*:*:*
git-scm git >= 2.32.0, < 2.32.4 cpe:2.3:a:git-scm:git:*:*:*:*:*:*:*:*
git-scm git >= 2.33.0, < 2.33.5 cpe:2.3:a:git-scm:git:*:*:*:*:*:*:*:*
git-scm git >= 2.34.0, < 2.34.5 cpe:2.3:a:git-scm:git:*:*:*:*:*:*:*:*
git-scm git >= 2.35.0, < 2.35.5 cpe:2.3:a:git-scm:git:*:*:*:*:*:*:*:*
git-scm git >= 2.36.0, < 2.36.3 cpe:2.3:a:git-scm:git:*:*:*:*:*:*:*:*
git-scm git >= 2.37.0, < 2.37.4 cpe:2.3:a:git-scm:git:*:*:*:*:*:*:*:*
git-scm git 2.38.0 cpe:2.3:a:git-scm:git:2.38.0:*:*:*:*:*:*:*
fedoraproject fedora 35 cpe:2.3:o:fedoraproject:fedora:35:*:*:*:*:*:*:*
fedoraproject fedora 36 cpe:2.3:o:fedoraproject:fedora:36:*:*:*:*:*:*:*
fedoraproject fedora 37 cpe:2.3:o:fedoraproject:fedora:37:*:*:*:*:*:*:*
apple xcode < 14.1 cpe:2.3:a:apple:xcode:*:*:*:*:*:*:*:*
debian debian_linux 10.0 cpe:2.3:o:debian:debian_linux:10.0:*:*:*:*:*:*:*

References for CVE-2022-39260

cvelogic Threat Intelligence