Skip to content
FlawDB
Sign in
Archived entry. Full-text search covers entries since 2026-11-10; exact IDs work for all years.

CVE-2022-39260

HIGH 8.5EPSS 83%

Git vulnerable to Remote Code Execution via Heap overflow in `git shell`

Mitigation

  • Upgrade git to 2.37.4 or later.

Who should check

  • Anyone running 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

Vulnerability facts

Affected
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
Fixed in
git 2.30.6, git 2.31.5, git 2.32.4, git 2.33.5, git 2.34.5, git 2.35.5, git 2.36.3, git 2.37.4
Exploited in the wild
Not in CISA KEV
Public exploit / PoC
None known
Remote exploitation
Remote, login needed
CVSS
8.5 (v3.1, CNA)CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:C/C:H/I:H/A:HOpen in CVSS calculator
Show all 8 CVSS metrics
  • Attack vector: Network
  • Attack complexity: High
  • Privileges required: Low
  • User interaction: None
  • Scope: Changed (impact reaches other components)
  • Confidentiality impact: High
  • Integrity impact: High
  • Availability impact: High
EPSS
2.22% chance of exploitation in 30 days (percentile 83, 2026-11-26)
CWE
CWE-787, CWE-122
Published
Modified

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.

Affected and fixed versions

Package / productAffectedFixedSource
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—cvelist

Check your systems with an agent

Paste this into Claude Code, Cursor or another coding agent. It only reads; it changes nothing.

Check whether anything I run is affected by CVE-2022-39260. Work read-only: do not install, upgrade, delete or change anything.

Details: https://flawdb.com/CVE-2022-39260.md
Affected: 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
Fixed in: git 2.30.6, git 2.31.5, git 2.32.4, git 2.33.5, git 2.34.5, git 2.35.5, git 2.36.3, git 2.37.4

Steps:
1. Search this machine and project for git: dependency manifests and lockfiles, installed packages, container images and running services.
2. For each match, note the installed version and whether it is inside the affected range.
3. Report a table: location, installed version, affected (yes / no / unsure), evidence. If affected, say which fixed version or mitigation from the details link applies, but don't apply it.

References

FAQ

Is CVE-2022-39260 being exploited?

There is no confirmed exploitation: CVE-2022-39260 is not in the CISA Known Exploited Vulnerabilities catalog. No public exploit code is known. EPSS estimates a 2.22% chance of exploitation in the next 30 days (as of 2026-11-26).

How serious is CVE-2022-39260?

High: CVSS 8.5 (v3.1, scored by CNA). Remote, login needed. The attack needs conditions outside the attacker's control, which makes it harder.

Which versions are affected by CVE-2022-39260?

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.

Is there a fix for CVE-2022-39260?

Yes. Fixed in git 2.30.6, git 2.31.5, git 2.32.4, git 2.33.5, git 2.34.5, git 2.35.5, git 2.36.3, git 2.37.4. Upgrade git to 2.37.4 or later.

How do I check if I'm affected by CVE-2022-39260?

Find where you use the affected software (dependency lockfiles, installed packages, container images, servers) and compare the installed version with the affected range above. The agent prompt on this page does this read-only.

Sponsors