# CVE-2022-23521: gitattributes parsing integer overflow in git

- Priority: **Prioritise**
- Reason: Severe, CVSS 9.8 (CVE.org); no exploitation reported by the 5 checked sources; EPSS 56% (FIRST, 04-12-2026)
- Next step: Check applicability: affected before 2.30.7, 2.31.6, 2.32.5, 2.33.6, 2.34.6, 2.35.6, 2.36.4, 2.37.5, 2.38.3 (CNA); fix release not confirmed
- Status: published
- Published: 2023-01-17 · Modified: 2025-02-13
- Aliases: ALPINE-CVE-2022-23521, UBUNTU-CVE-2022-23521, DEBIAN-CVE-2022-23521, CGA-g67f-w65x-gc3w, CGA-vg9m-2fc2-xv7w
- Record: https://cvemate.com/vulnerability/CVE-2022-23521 · JSON: https://cvemate.com/vulnerability/CVE-2022-23521/json

## Description

```text
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.
```

## Signals

- CVSS: 9.8 critical (v3.1, CVE.org) CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
- EPSS: 56.334%, percentile 99.072%, as of 2026-12-04
- Known exploited (KEV): CISA not listed, ENISA not listed, CIRCL not listed
- Ransomware use: none recorded
- Public exploits: 0

## Affected

- alpine git (Alpine Linux): ≥ 2.31.0, \< 2.32.5-r0 \| ≥ 2.31.0, \< 2.34.6-r0 \| ≥ 2.31.0, \< 2.36.4-r0 \| ≥ 2.31.0, \< 2.38.3-r0 \| ≥ 2.31.0, \< 2.39.1-r0 \| ≥ 2.32.0, \< 2.32.5-r0 \| ≥ 2.34.0, \< 2.34.6-r0 \| ≥ 2.36.0, \< 2.36.4-r0 \| ≥ 2.38.0, \< 2.38.3-r0 \| ≥ 2.38.0, \< 2.39.1-r0
- chainguard git (Chainguard): \< 2.39.1-r0
- wolfi git (Wolfi): \< 2.39.1-r0
- debian git (Debian): \< 1:2.39.1-0.1
- ubuntu git (Ubuntu): \< 1:1.9.1-1ubuntu0.10+esm1 \| \< 1:2.7.4-0ubuntu1.10+esm4 \| \< 1:2.17.1-1ubuntu0.15 \| \< 1:2.25.1-1ubuntu3.8 \| \< 1:2.34.1-1ubuntu1.6
- git-scm git: ≤ 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, ≤ 2.38.2 \| 2.39.0
- git git: \< 2.30.7 \| ≥ 2.31.0, \< 2.31.6 \| ≥ 2.32.0, \< 2.32.5 \| ≥ 2.33.0, \< 2.33.6 \| ≥ 2.34.0, \< 2.34.6 \| ≥ 2.35.0, \< 2.35.6 \| ≥ 2.36.0, \< 2.36.4 \| ≥ 2.37.0, \< 2.37.5 \| ≥ 2.38.0, \< 2.38.3 \| = 2.39.0

## References

- <https://github.com/git/git/security/advisories/GHSA-c738-c5qq-xg89>
- <https://github.com/git/git/commit/508386c6c5857b4faa2c3e491f422c98cc69ae76>
- <https://security.gentoo.org/glsa/202312-15>
- <https://security.alpinelinux.org/vuln/CVE-2022-23521>
- <https://ubuntu.com/security/CVE-2022-23521>
- <https://ubuntu.com/security/notices/USN-5810-1>
- <https://ubuntu.com/security/notices/USN-5810-2>
- <https://ubuntu.com/security/notices/USN-5810-3>
- <https://ubuntu.com/security/notices/USN-5810-4>
- <https://www.cve.org/CVERecord?id=CVE-2022-23521>
- <https://security-tracker.debian.org/tracker/CVE-2022-23521>
- <https://github.com/CVEProject/cvelistV5/tree/main/cves/2022/23xxx/CVE-2022-23521.json>
- <https://nvd.nist.gov/vuln/detail/CVE-2022-23521>

---

Data as of 2026-12-05T03:05:08.127Z. The priority label is CveMate's own model from public evidence, not an official rating, and it knows nothing about your assets. How labels are decided: https://cvemate.com/faq#priority
