Skip to content
Heist/ feed
Back to feed
HighFix available

git — security advisory

Type: advisorySources: OSVAdvisory ID: ALPINE-CVE-2022-39260

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.

Products
git
Affected versions
Not specified
Fixed versions
2.30.6-r0, 2.32.4-r0, 2.34.5-r0, 2.36.3-r0, 2.38.1-r0
CVEs
CVE-2022-39260
Confirmed fixed CVEs
Not specified
Updated in this feed
30 Oct 2026, 14:17 UTC · Revision 1

Source evidence

ALPINE-CVE-2022-39260

core-osv · Original source

Published 19 Oct 2022, 12:15 UTC

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.

osv:ALPINE-CVE-2022-39260

git

Fixed versions: 2.30.6-r0

git

Fixed versions: 2.32.4-r0

git

Fixed versions: 2.34.5-r0

git

Fixed versions: 2.36.3-r0

git

Fixed versions: 2.38.1-r0

git

Fixed versions: 2.38.1-r0

git

Fixed versions: 2.38.1-r0

git

Fixed versions: 2.38.1-r0

git

Fixed versions: 2.38.1-r0

git

Fixed versions: 2.38.1-r0

git

Fixed versions: 2.38.1-r0

git

Fixed versions: 2.38.1-r0

Complete source record
{
  "id": "65bdc1037d639ba292bccc825d9d328845c16ec78ca4ab3432131bacc32bea48",
  "url": "https://osv.dev/vulnerability/ALPINE-CVE-2022-39260",
  "method": "structured",
  "payload": {
    "kind": "advisory",
    "title": "ALPINE-CVE-2022-39260",
    "summary": "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.",
    "evidence": "osv:ALPINE-CVE-2022-39260",
    "products": [
      {
        "name": {
          "value": "git",
          "evidence": "/affected/0/package/name"
        },
        "prerequisites": [],
        "fixed_versions": [
          {
            "value": "2.30.6-r0",
            "evidence": "/affected/0/ranges"
          }
        ],
        "affected_versions": []
      },
      {
        "name": {
          "value": "git",
          "evidence": "/affected/1/package/name"
        },
        "prerequisites": [],
        "fixed_versions": [
          {
            "value": "2.32.4-r0",
            "evidence": "/affected/1/ranges"
          }
        ],
        "affected_versions": []
      },
      {
        "name": {
          "value": "git",
          "evidence": "/affected/2/package/name"
        },
        "prerequisites": [],
        "fixed_versions": [
          {
            "value": "2.34.5-r0",
            "evidence": "/affected/2/ranges"
          }
        ],
        "affected_versions": []
      },
      {
        "name": {
          "value": "git",
          "evidence": "/affected/3/package/name"
        },
        "prerequisites": [],
        "fixed_versions": [
          {
            "value": "2.36.3-r0",
            "evidence": "/affected/3/ranges"
          }
        ],
        "affected_versions": []
      },
      {
        "name": {
          "value": "git",
          "evidence": "/affected/4/package/name"
        },
        "prerequisites": [],
        "fixed_versions": [
          {
            "value": "2.38.1-r0",
            "evidence": "/affected/4/ranges"
          }
        ],
        "affected_versions": []
      },
      {
        "name": {
          "value": "git",
          "evidence": "/affected/5/package/name"
        },
        "prerequisites": [],
        "fixed_versions": [
          {
            "value": "2.38.1-r0",
            "evidence": "/affected/5/ranges"
          }
        ],
        "affected_versions": []
      },
      {
        "name": {
          "value": "git",
          "evidence": "/affected/6/package/name"
        },
        "prerequisites": [],
        "fixed_versions": [
          {
            "value": "2.38.1-r0",
            "evidence": "/affected/6/ranges"
          }
        ],
        "affected_versions": []
      },
      {
        "name": {
          "value": "git",
          "evidence": "/affected/7/package/name"
        },
        "prerequisites": [],
        "fixed_versions": [
          {
            "value": "2.38.1-r0",
            "evidence": "/affected/7/ranges"
          }
        ],
        "affected_versions": []
      },
      {
        "name": {
          "value": "git",
          "evidence": "/affected/8/package/name"
        },
        "prerequisites": [],
        "fixed_versions": [
          {
            "value": "2.38.1-r0",
            "evidence": "/affected/8/ranges"
          }
        ],
        "affected_versions": []
      },
      {
        "name": {
          "value": "git",
          "evidence": "/affected/9/package/name"
        },
        "prerequisites": [],
        "fixed_versions": [
          {
            "value": "2.38.1-r0",
            "evidence": "/affected/9/ranges"
          }
        ],
        "affected_versions": []
      },
      {
        "name": {
          "value": "git",
          "evidence": "/affected/10/package/name"
        },
        "prerequisites": [],
        "fixed_versions": [
          {
            "value": "2.38.1-r0",
            "evidence": "/affected/10/ranges"
          }
        ],
        "affected_versions": []
      },
      {
        "name": {
          "value": "git",
          "evidence": "/affected/11/package/name"
        },
        "prerequisites": [],
        "fixed_versions": [
          {
            "value": "2.38.1-r0",
            "evidence": "/affected/11/ranges"
          }
        ],
        "affected_versions": []
      }
    ],
    "severity": "high",
    "structured": {
      "id": "ALPINE-CVE-2022-39260",
      "aliases": [
        "ALPINE-CVE-2022-39260"
      ],
      "metrics": [
        {
          "type": "CVSS_V3",
          "score": "CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H"
        }
      ],
      "affected": [
        {
          "ranges": [
            {
              "type": "ECOSYSTEM",
              "events": [
                {
                  "introduced": "2.31.0"
                },
                {
                  "fixed": "2.30.6-r0"
                }
              ]
            }
          ],
          "package": {
            "name": "git",
            "purl": "pkg:apk/alpine/git?arch=source",
            "ecosystem": "Alpine:v3.13"
          },
          "database_specific": {
            "source": "https://storage.googleapis.com/cve-osv-conversion/alpine/ALPINE-CVE-2022-39260.json"
          },
          "ecosystem_specific": {}
        },
        {
          "ranges": [
            {
              "type": "ECOSYSTEM",
              "events": [
                {
                  "introduced": "2.31.0"
                },
                {
                  "fixed": "2.32.4-r0"
                }
              ]
            }
          ],
          "package": {
            "name": "git",
            "purl": "pkg:apk/alpine/git?arch=source",
            "ecosystem": "Alpine:v3.14"
          },
          "database_specific": {
            "source": "https://storage.googleapis.com/cve-osv-conversion/alpine/ALPINE-CVE-2022-39260.json"
          },
          "ecosystem_specific": {}
        },
        {
          "ranges": [
            {
              "type": "ECOSYSTEM",
              "events": [
                {
                  "introduced": "2.31.0"
                },
                {
                  "fixed": "2.34.5-r0"
                }
              ]
            }
          ],
          "package": {
            "name": "git",
            "purl": "pkg:apk/alpine/git?arch=source",
            "ecosystem": "Alpine:v3.15"
          },
          "database_specific": {
            "source": "https://storage.googleapis.com/cve-osv-conversion/alpine/ALPINE-CVE-2022-39260.json"
          },
          "ecosystem_specific": {}
        },
        {
          "ranges": [
            {
              "type": "ECOSYSTEM",
              "events": [
                {
                  "introduced": "2.31.0"
                },
                {
                  "fixed": "2.36.3-r0"
                }
              ]
            }
          ],
          "package": {
            "name": "git",
            "purl": "pkg:apk/alpine/git?arch=source",
            "ecosystem": "Alpine:v3.16"
          },
          "database_specific": {
            "source": "https://storage.googleapis.com/cve-osv-conversion/alpine/ALPINE-CVE-2022-39260.json"
          },
          "ecosystem_specific": {}
        },
        {
          "ranges": [
            {
              "type": "ECOSYSTEM",
              "events": [
                {
                  "introduced": "2.31.0"
                },
                {
                  "fixed": "2.38.1-r0"
                }
              ]
            }
          ],
          "package": {
            "name": "git",
            "purl": "pkg:apk/alpine/git?arch=source",
            "ecosystem": "Alpine:v3.17"
          },
          "database_specific": {
            "source": "https://storage.googleapis.com/cve-osv-conversion/alpine/ALPINE-CVE-2022-39260.json"
          },
          "ecosystem_specific": {}
        },
        {
          "ranges": [
            {
              "type": "ECOSYSTEM",
              "events": [
                {
                  "introduced": "2.31.0"
                },
                {
                  "fixed": "2.38.1-r0"
                }
              ]
            }
          ],
          "package": {
            "name": "git",
            "purl": "pkg:apk/alpine/git?arch=source",
            "ecosystem": "Alpine:v3.18"
          },
          "database_specific": {
            "source": "https://storage.googleapis.com/cve-osv-conversion/alpine/ALPINE-CVE-2022-39260.json"
          },
          "ecosystem_specific": {}
        },
        {
          "ranges": [
            {
              "type": "ECOSYSTEM",
              "events": [
                {
                  "introduced": "2.31.0"
                },
                {
                  "fixed": "2.38.1-r0"
                }
              ]
            }
          ],
          "package": {
            "name": "git",
            "purl": "pkg:apk/alpine/git?arch=source",
            "ecosystem": "Alpine:v3.19"
          },
          "database_specific": {
            "source": "https://storage.googleapis.com/cve-osv-conversion/alpine/ALPINE-CVE-2022-39260.json"
          },
          "ecosystem_specific": {}
        },
        {
          "ranges": [
            {
              "type": "ECOSYSTEM",
              "events": [
                {
                  "introduced": "2.31.0"
                },
                {
                  "fixed": "2.38.1-r0"
                }
              ]
            }
          ],
          "package": {
            "name": "git",
            "purl": "pkg:apk/alpine/git?arch=source",
            "ecosystem": "Alpine:v3.20"
          },
          "database_specific": {
            "source": "https://storage.googleapis.com/cve-osv-conversion/alpine/ALPINE-CVE-2022-39260.json"
          },
          "ecosystem_specific": {}
        },
        {
          "ranges": [
            {
              "type": "ECOSYSTEM",
              "events": [
                {
                  "introduced": "2.31.0"
                },
                {
                  "fixed": "2.38.1-r0"
                }
              ]
            }
          ],
          "package": {
            "name": "git",
            "purl": "pkg:apk/alpine/git?arch=source",
            "ecosystem": "Alpine:v3.21"
          },
          "database_specific": {
            "source": "https://storage.googleapis.com/cve-osv-conversion/alpine/ALPINE-CVE-2022-39260.json"
          },
          "ecosystem_specific": {}
        },
        {
          "ranges": [
            {
              "type": "ECOSYSTEM",
              "events": [
                {
                  "introduced": "2.31.0"
                },
                {
                  "fixed": "2.38.1-r0"
                }
              ]
            }
          ],
          "package": {
            "name": "git",
            "purl": "pkg:apk/alpine/git?arch=source",
            "ecosystem": "Alpine:v3.22"
          },
          "database_specific": {
            "source": "https://storage.googleapis.com/cve-osv-conversion/alpine/ALPINE-CVE-2022-39260.json"
          },
          "ecosystem_specific": {}
        },
        {
          "ranges": [
            {
              "type": "ECOSYSTEM",
              "events": [
                {
                  "introduced": "2.31.0"
                },
                {
                  "fixed": "2.38.1-r0"
                }
              ]
            }
          ],
          "package": {
            "name": "git",
            "purl": "pkg:apk/alpine/git?arch=source",
            "ecosystem": "Alpine:v3.23"
          },
          "database_specific": {
            "source": "https://storage.googleapis.com/cve-osv-conversion/alpine/ALPINE-CVE-2022-39260.json"
          },
          "ecosystem_specific": {}
        },
        {
          "ranges": [
            {
              "type": "ECOSYSTEM",
              "events": [
                {
                  "introduced": "2.31.0"
                },
                {
                  "fixed": "2.38.1-r0"
                }
              ]
            }
          ],
          "package": {
            "name": "git",
            "purl": "pkg:apk/alpine/git?arch=source",
            "ecosystem": "Alpine:v3.24"
          },
          "database_specific": {
            "source": "https://storage.googleapis.com/cve-osv-conversion/alpine/ALPINE-CVE-2022-39260.json"
          },
          "ecosystem_specific": {}
        }
      ],
      "modified": "2026-10-15T07:17:54.246035969Z",
      "provider": "osv",
      "upstream": [
        "CVE-2022-39260"
      ],
      "references": [
        "https://security.alpinelinux.org/vuln/CVE-2022-39260"
      ]
    },
    "related_cves": [
      {
        "value": "CVE-2022-39260",
        "evidence": "/upstream"
      }
    ],
    "security_relevant": true,
    "severity_evidence": "/severity/0/score"
  },
  "source_id": "core-osv",
  "document_id": 321951,
  "published_at": "2022-10-19T12:15:10.16+00:00"
}