Wiz Agents & Workflows are here

CVE-2022-39260
Git vulnerability analysis and mitigation

Overview

CVE-2022-39260 is a security vulnerability discovered in Git's shell functionality that affects versions up to 2.30.5, 2.31.4, 2.32.3, 2.33.4, 2.34.4, 2.35.4, 2.36.2, 2.37.3, and 2.38.0. The vulnerability was discovered by Kevin Backhouse of the GitHub Security Lab and was disclosed on October 18, 2022 (GitHub Advisory).

Technical details

The vulnerability exists in the git shell function that splits command arguments into an array. The function improperly uses an int to represent the number of entries (argc) in the argv array, allowing a malicious actor to intentionally overflow the return value. This can lead to arbitrary heap writes when the resulting argv array is passed to execv() (GitHub Advisory).

Impact

If exploited, this vulnerability could lead to remote code execution on a victim machine when git shell is exposed and the directory $HOME/git-shell-commands exists. The impact is particularly severe in environments where git shell is used as a restricted login shell (GitHub Advisory).

Mitigation and workarounds

The vulnerability has been patched in versions 2.30.6, 2.31.5, 2.32.4, 2.33.5, 2.34.5, 2.35.5, 2.36.3, 2.37.4, and 2.38.1. The fix includes refusing interactive commands longer than 4MiB in size and hardening split_cmdline() to reject inputs larger than 2GiB. If upgrading is not immediately possible, users can disable git shell access via remote logins or remove the git-shell-commands directory to disable interactive mode (GitHub Advisory, Red Hat Advisory).

Additional resources


SourceThis report was generated using AI

Related Git vulnerabilities:

CVE ID

Severity

Score

Technologies

Component name

CISA KEV exploit

Has fix

Published date

CVE-2024-32465HIGH7.8
  • GitGit
  • cpe:2.3:a:git-scm:git
NoYesMay 14, 2024
CVE-2024-52005HIGH7.5
  • GitGit
  • perl-Git
NoYesJan 15, 2025
CVE-2024-52006LOW2.1
  • GitGit
  • git-all
NoYesJan 14, 2025
CVE-2024-50349LOW2.1
  • GitGit
  • git-core
NoYesJan 14, 2025
ELSA-2025-11534HIGHN/A
  • GitGit
  • git-credential-libsecret
NoYesJul 22, 2025

Free Vulnerability Assessment

Benchmark your Cloud Security Posture

Evaluate your cloud security practices across 9 security domains to benchmark your risk level and identify gaps in your defenses.

Request assessment

Get a personalized demo

Ready to see Wiz in action?

"Best User Experience I have ever seen, provides full visibility to cloud workloads."
David EstlickCISO
"Wiz provides a single pane of glass to see what is going on in our cloud environments."
Adam FletcherChief Security Officer
"We know that if Wiz identifies something as critical, it actually is."
Greg PoniatowskiHead of Threat and Vulnerability Management