GitApplication · Git Scm

CVE-2022-39260

HIGH · 8.8 CVSS v3.1 Published 2022-10-19
Fix available
A fix is available. Upgrade to 2.30.6 / 2.31.5 or later.
See remediation →
95/100
Remediation priority · Urgent
Remotely reachable No privileges

Official description Straight from the sourceThe vendor's or NVD's own wording, published unedited. Authoritative, but often terse — it says what broke, rarely what to do.

NVD · unedited
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.

Technical summary Written by usOur analysis, written from the advisory, the CVSS vector and the affected-version data. It adds context the advisory leaves out, and never invents facts that are not in the source.

dbcve analysis · high confidence

In git shell, the function that parses command arguments into an array uses an `int` to store the number of entries. A malicious actor can overflow this value, causing arbitrary heap writes. Since the resulting array is passed to `execv()`, this enables remote code execution on systems where git shell is enabled as a login shell.

MitigationUpgrade Git to patched versions (2.30.6+, 2.31.5+, 2.32.4+, 2.33.5+, 2.34.5+, 2.35.5+, 2.36.3+, or 2.37.4+), or disable git shell access via SSH as a workaround.

Verify against the referenced sources before acting — the references below are authoritative for this CVE, this summary is not.

Affected products & versions What the vendor confirmedThe version ranges the vendor confirmed as vulnerable. If your version sits inside a range here, treat yourself as exposed until you have upgraded.

NVD · CPE data
GitApplication
Affected:< 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.35.0, < 2.35.5>= 2.36.0, < 2.36.3>= 2.37.0, < 2.37.4= 2.38.0
FedoraOperating system
Affected:= 35= 36= 37
Debian LinuxOperating system
Affected:= 10.0
XcodeApplication
Affected:< 14.1

CVSS breakdown How the score is builtThe industry scoring standard. It rates how the flaw is reached, what it takes to exploit, and what an attacker gains — the score is derived from those, not the other way round.

From the vector
Attack vector
Network
Complexity
Low
Privileges
None
User interaction
Required
Scope
Unchanged
Confidentiality
High
Integrity
High
Availability
High

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

Am I affected? How to checkSteps we derive from the advisory and the affected-version data, so you can decide whether this CVE reaches your setup. They are a guide, not a scan — your own configuration is the authority.

dbcve checks

Work through these to decide whether this CVE applies to you.

  1. Check if git-shell is enabled as a login shell
    Inspect /etc/passwd for users with git-shell as their login shell, or check SSH configuration files (typically /etc/ssh/sshd_config) for any ForceCommand or Match blocks that invoke git-shell
    Affected if Any user account has git-shell set as their login shell or is forced to run git-shell over SSH
  2. Determine the installed git version
    Run `git --version` to retrieve the version number of the installed git binary
    Affected if The reported version falls within any of the affected ranges: < 2.30.6, >= 2.31.0 and < 2.31.5, >= 2.32.0 and < 2.32.4, >= 2.33.0 and < 2.33.5, >= 2.34.0 and < 2.34.5, >= 2.35.0 and < 2.35.5, >= 2.36.0 and < 2.36.3, >= 2.37.0 and < 2.37.4, or = 2.38.0
  3. Check git-shell binary version on Fedora
    On Fedora systems, run `rpm -q git` to query the installed RPM package version
    Affected if The package version corresponds to Fedora 35, 36, or 37 as listed in the affected products
  4. Check git package version on Debian
    On Debian systems, run `dpkg -l git` or `apt show git` to retrieve the installed package version
    Affected if The installed version corresponds to Debian 10.0
  5. Check Xcode version on macOS
    On macOS, run `xcodebuild -version` or check /Applications/Xcode.app/Contents/version.plist for the Xcode version
    Affected if Xcode version is lower than 14.1

You are affected only if git-shell is enabled as a login shell AND your installed git/Xcode version matches the affected version ranges for your platform.

Generated from the published advisory. Verify against your own configuration.

Check your environment

Paste your version and any relevant configuration and it will be compared against the affected criteria above. Do not include secrets or credentials.

AI-assisted, checked against the advisory. Informational, not a guarantee.

Remediation Closing itWhat it takes to close this. Where a vendor fix exists we point at it; where none exists we say so plainly, and can build one. Effort estimates are scoped from the advisory, not from your codebase.

dbcve · scoped
Upgrade available Upgrade to 2.30.6 / 2.31.5 / 2.32.4 or later
Fixed in 2.30.62.31.52.32.4
Interim mitigation

Upgrade Git to patched versions (2.30.6+, 2.31.5+, 2.32.4+, 2.33.5+, 2.34.5+, 2.35.5+, 2.36.3+, or 2.37.4+), or disable git shell access via SSH as a workaround.

Recommended fix High confidence

Upgrade to Git version 2.37.4 or later (or the latest available version). For Xcode, upgrade to 14.1 or later.

  1. Identify the current installed version of Git using: git --version
  2. Determine the appropriate upgrade path based on your current version from the affected versions list
  3. Upgrade Git to a fixed version (2.30.6, 2.31.5, 2.32.4, 2.33.5, 2.34.5, 2.35.5, 2.36.3, or 2.37.4 or later)
  4. On Linux/Fedora/Debian, use package manager: dnf update git or apt-get update && apt-get install git
  5. On macOS with Xcode, update Xcode to 14.1 or later via App Store or developer.apple.com
  6. Verify the upgrade was successful by running: git --version
  7. As an additional mitigation, verify that git shell is not enabled as a login shell for any user: check /etc/shells and users' login shell settings
  8. If git shell is not required, restrict SSH access to prevent git shell from being used as a login shell
Caveat Minor: Upgrading Git may introduce minor command-line behavior changes; ensure any custom scripts are tested after upgrade.

Generated from the published advisory — verify against the referenced sources before acting.

Fix this in Git Scoped from the published advisory
  • Consultation2.0 h
  • Implementation4.0 h
  • Testing2.0 h
  • Review / QA1.0 h
9.0 hours of engineering $1,600
Get the upgrade done

An estimate, not a bill — we confirm scope with you before any work starts. Need it this week? Rush from $2,560.

Scan for this in your stack

Free · runs locally
dbcve dependency scanner

Check whether your project pulls in CVE-2022-39260 — or any other known-vulnerable package — straight from your lock files. Free and open source; it runs locally and uploads nothing.

References Go to the primary sourcePrimary sources — vendor advisories, patches and trackers. Where our summary and a reference disagree, the reference wins.

Primary sources

Practitioner notes

Contributed

Peer-ranked notes from engineers who’ve handled CVE-2022-39260 in production — separate from our analysis above.

No notes yet

Be the first to add a field note for this CVE — a mitigation you’ve verified, a version caveat, or a link to a working fix. Sign in above to contribute.

What this is

A place for practitioners to share what actually worked: a mitigation you’ve tested, a configuration change, a version- or environment-specific caveat, or a link to a verified patch. The most useful notes rise to the top as peers upvote them, so the signal stays high.

What belongs here
  • Verified mitigations, workarounds, and config changes
  • Version or environment caveats, and links to real fixes
  • No weaponised exploit code, or anything meant to cause harm
  • No spam, self-promotion, credentials, or personal data