VDB

CVE-2022-39260

CVE-2022-39260 PUBLISHED CVSS 8.5 HIGH

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

Reported by github_m · Published October 19, 2022

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.

Fixed versions

Upgrade to a fixed version or later. Language registries are listed first, then Linux distributions, then vendor products.

PackageEcosystemFixed in
gitkAmazon Linux2.39.1-1.amzn2023.0.2
gitAmazon Linux2.39.1-1.amzn2023.0.2, 2.38.1-1.amzn2.0.1
git-instawebAmazon Linux2.39.1-1.amzn2023.0.2, 2.38.1-1.amzn2.0.1
git-coreAmazon Linux2.39.1-1.amzn2023.0.2, 2.38.1-1.amzn2.0.1
perl-GitAmazon Linux2.39.1-1.amzn2023.0.2
git-cvsAmazon Linux2.39.1-1.amzn2023.0.2
gitwebAmazon Linux2.39.1-1.amzn2023.0.2, 2.38.1-1.amzn2.0.1
git-emailAmazon Linux2.39.1-1.amzn2023.0.2, 2.38.1-1.amzn2.0.1
git-credential-libsecretAmazon Linux2.38.1-1.amzn2.0.1
perl-Git-SVNAmazon Linux2.38.1-1.amzn2.0.1
git-allAmazon Linux2.39.1-1.amzn2023.0.2
git-svnAmazon Linux2.39.1-1.amzn2023.0.2

7 more packages have a fixed version. See every fix in Lookup.

Risk scores

CVSS 3.1
8.5
CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:C/C:H/I:H/A:H

Affected products

VendorProductVersions
gitgit< 2.30.6, > 2.31.0, < 2.31.5, > 2.32.0, < 2.32.4
amazon:2023gitk0
amazon:2023git0
amazon:2git-instaweb0
amazon:2git-core0
amazon:2023perl-Git0
amazon:2023git-cvs0
amazon:2git0
amazon:2023gitweb0
amazon:2git-email0
amazon:2git-credential-libsecret0
amazon:2gitweb0
amazon:2023git-instaweb0
amazon:2perl-Git-SVN0
amazon:2023git-all0
amazon:2023git-svn0
amazon:2023git-core0
amazon:2023git-subtree0
amazon:2023git-daemon0
amazon:2git-p40

…and 19 more

Timeline

  • Oct 18, 2022 CVE Published
  • Oct 22, 2022 EPSS Score (30 in total, the first dated here)
  • Mar 10, 2026 Security Advisory (8 in total, the first dated here)
  • Jun 17, 2026 Coalition ESS Score
  • Nov 22, 2026 Distribution Patch (6 in total, the first dated here)

Query this with the API

The same record, from the CLI:

vulnetix vdb vuln CVE-2022-39260
vulnetix vdb fixes CVE-2022-39260

Or with curl, using the org id and key from your account page:

curl -s -H "Authorization: ApiKey ${VULNETIX_ORG_ID}:${VULNETIX_API_KEY}" \
  "https://api.vdb.vulnetix.com/v2/vuln/CVE-2022-39260/fixes/registry"

The Community plan is free and allows 50 queries a day. Get a free API key · API quickstart

Look up in the Resolve Platform →
$ Lookup Community · 50/day Open Lookup ›