cbcvebase.
CVE-2022-23521
published 2023-01-17

CVE-2022-23521: Git is distributed revision control system. gitattributes are a mechanism to allow defining attributes for paths. These attributes can be defined by adding a…

PriorityP275critical9.8CVSS 3.1
AVNACLPRNUINSUCHIHAH
EPSS
56.33%
98.9th percentile
Git is distributed revision control system. gitattributes are a mechanism to allow defining attributes for paths. These attributes can be defined by adding a `.gitattributes` file to the repository, which contains a set of file patterns and the attributes that should be set for paths matching this pattern. When parsing gitattributes, multiple integer overflows can occur when there is a huge number of path patterns, a huge number of attributes for a single pattern, or when the declared attribute names are huge. These overflows can be triggered via a crafted `.gitattributes` file that may be part of the commit history. Git silently splits lines longer than 2KB when parsing gitattributes from a file, but not when parsing them from the index. Consequentially, the failure mode depends on whether the file exists in the working tree, the index or both. This integer overflow can result in arbitrary heap reads and writes, which may result in remote code execution. The problem has been patched in the versions published on 2023-01-17, going back to v2.30.7. Users are advised to upgrade. There are no known workarounds for this issue.

Affected

37 ranges· showing 25
VendorProductVersion rangeFixed in
debiangit< git 1:2.39.1-0.1 (bookworm)git 1:2.39.1-0.1 (bookworm)
git-scmgit<= 2.30.6
git-scmgit
git-scmgit2.31.0 – 2.31.5
git-scmgit2.32.0 – 2.32.4
git-scmgit2.33.0 – 2.33.5
git-scmgit2.34.0 – 2.34.5
git-scmgit2.35.0 – 2.35.5
git-scmgit2.36.0 – 2.36.3
git-scmgit2.37.0 – 2.37.4
git-scmgit2.38.0 – 2.38.2
gitgit< 2.30.72.30.7
gitgit
gitgit
gitgit
gitgit
gitgit
gitgit
gitgit
gitgit
gitgit
gitgit>= 0 < 1:2.30.2-1+deb11u11:2.30.2-1+deb11u1
gitgit>= 0 < 1:2.39.1-0.11:2.39.1-0.1
gitgit>= 0 < 1:2.39.1-0.11:2.39.1-0.1
gitgit>= 0 < 1:2.39.1-0.11:2.39.1-0.1

Detection & IOCsextracted from sources · hover to see the quote

  • Trigger vector is a crafted `.gitattributes` file in the repository (commit history, working tree, or index) containing a huge number of path patterns, a huge number of attributes for a single pattern, or very large declared attribute names — causing integer overflows during parsing.
  • Distinguish failure mode by whether the malicious `.gitattributes` exists in the working tree vs. the index: Git silently splits lines >2 KB when reading from a file but NOT when reading from the index, so index-only payloads bypass the line-length split.
  • In Jenkins/CI environments, the exploit path is an attacker with commit access to a Git repository cloned on a Jenkins controller or agent — monitor for unexpected `.gitattributes` changes in repositories cloned by CI systems.
  • ·Vulnerable Git versions are all releases published before 2023-01-17; fixed versions begin at v2.30.7 and later patch releases (e.g., 2.36.4, 2.34.6, 2.32.5 for Windows/Alpine). Debian bullseye fix is 1:2.30.2-1+deb11u1; Debian bookworm/sid/trixie/forky fix is 1:2.39.1-0.1.

CVSS provenance

nvdv3.19.8CRITICALCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
osv9.8CRITICAL
vendor_debian9.8CRITICAL
vendor_msrc9.8HIGH
vendor_redhat9.8CRITICAL
vendor_ubuntu9.8CRITICAL
Stop checking back — get the weekly exploitation signal.

Every Monday: what got weaponized or added to CISA KEV in the last seven days — each CVE cross-linked to its PoC, Nuclei template, and detection rule. Free, one email a week, unsubscribe in one click.