Critical Remote Code Execution Vulnerability in Git Package

git Updated 02 Oct 2025

Summary

19/10/2022
N/A
Yes i
High
8.8

ALPINE-CVE-2022-39260: Git is an open source, scalable, distributed revision control system. Affects git versions < 2.30.6-r0. Fixed in 2.30.6-r0. How to fix ↓

Free scan

Check if this vulnerability affects your application

Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.

Check my app free

No signup required · Results in about 60 seconds

Upload your dependency manifest or SBOM

Drag & drop your file here or

Java Javascript PHP Python Go Rust Ruby Dart C/C++ Elixir CycloneDX SPDX

Upload a supported dependency manifest or SBOM. No installation or source-code access required.

See supported files and SBOM formats
SBOM sbom.json · bom.json · bom.xml · *.spdx.json · *.cdx.json · *.cdx.xml
Java pom.xml · gradle.lockfile · buildscript-gradle.lockfile
Javascript package-lock.json · yarn.lock · pnpm-lock.yaml
PHP composer.lock
Python poetry.lock · requirements.txt · Pipfile.lock
Go go.mod
Rust Cargo.lock
Ruby Gemfile.lock
Dart pubspec.lock
C/C++ conan.lock
Elixir mix.lock
Enter your work email to receive your report link.

Verify your email to view the full report and start 30 days of continuous monitoring. No credit card required.

Sponsored Devnack Penetration testing for web, API and mobile Manual testing by engineers who build software, not an auditor's checklist. Trusted by teams at Swift and Google Talk to Devnack

Background

Git is an open-source, scalable, distributed revision control system widely used for source code management. It allows multiple developers to work on a project simultaneously, tracking changes and facilitating collaboration. The Git shell provides a restricted login shell for executing Git commands over SSH. However, certain versions of Git are vulnerable to a severe security flaw that can lead to remote code execution if exploited.

Vulnerability Detail

The vulnerability arises from improper handling of command arguments in Git's shell functionality. Specifically, an integer is used to represent the number of entries in an array, which can be intentionally overflowed by a malicious actor. This overflow can lead to arbitrary heap writes, allowing the attacker to execute arbitrary code on the victim's machine. The affected versions include those 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. To be vulnerable, the victim must allow access to git shell as a login shell.

How To Fix

Minimum fixed version

2.30.6-r0

This is the first release that contains the fix.

sudo apk add --upgrade git

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Workaround

As a short-term workaround, it is advisable to disable git shell access via remote logins. This can be done by modifying the SSH configuration to restrict access to the Git shell for users.

Conclusion

In summary, a critical vulnerability in the Git package allows for remote code execution due to improper handling of command arguments. Users are strongly advised to update to the latest patched versions to mitigate this risk. Additionally, disabling git shell access can serve as a temporary workaround until the update is applied.

See every vulnerability recorded for git →

Share this vulnerability

FAQ

The CVSS score of this vulnerability is 8.8, indicating a critical level of severity.

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 are affected.

You can use the Vulert playground at Vulert Scanner to check if your application is affected by this vulnerability without any signup.

If you cannot update Git immediately, disable git shell access via remote logins as a temporary measure.

Exploitation of this vulnerability can lead to remote code execution, allowing attackers to gain control over the victim's machine.

Related vulnerabilities

Recent vulnerabilities recorded for git.

How To Fix

Minimum fixed version

2.30.6-r0

This is the first release that contains the fix.

sudo apk add --upgrade git

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Subscribe to Vulert on Telegram
Daily digest of new CVEs, critical and high severity, affected packages and fixes — plus a weekly roundup.
Join the channel →
Help improve this record
Report an issue or send feedback