← Vulnerability feed

Vulnerability record · CVE-2022-23521 · published 17 January 2023

CVE-2022-23521: Git gitattributes parsing integer overflow enables heap corruption

Git Scm · Git

Git's gitattributes parser suffers multiple integer overflows when handling a huge number of path patterns, many attributes for one pattern, or very long attribute names. A crafted .gitattributes file, including one already in commit history, can trigger the overflow, and because Git splits long lines only when reading from a file and not from the index, the failure mode varies by where the file exists. The flaw can cause arbitrary heap reads and writes, potentially leading to remote code execution.

9.8 CVSS 3.1 Critical EPSS 56% · top 1.0% CWE-190 · Integer overflow
9.8CVSS 3.1 base score
56%EPSS exploitation probability, 30 days
NoNot in CISA KEV
1Affected product versions listed by NVD
6References
17 Jun 2026Last modified by NVD

Description

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.

CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H

Automated analysis

Generated by VULONE's analysis model from the NVD record, CISA KEV and EPSS data on 19 September 2026. Confidence: high.

critical priorityCVSS 9.8 with network reachability, no authentication or user interaction, and potential remote code execution, combined with a very high EPSS score, makes this a critical patching priority.

What it is

Git's gitattributes parser suffers multiple integer overflows when handling a huge number of path patterns, many attributes for one pattern, or very long attribute names. A crafted .gitattributes file, including one already in commit history, can trigger the overflow, and because Git splits long lines only when reading from a file and not from the index, the failure mode varies by where the file exists. The flaw can cause arbitrary heap reads and writes, potentially leading to remote code execution.

Impact

An attacker can corrupt heap memory, leading to arbitrary reads and writes and potentially remote code execution in the context of the Git process. This can compromise the repository, the developer's machine, or any system processing the malicious repository.

Attack surface

The vulnerability is network-reachable with no privileges or user interaction required per the CVSS vector, and is triggered by processing a repository containing a crafted .gitattributes file. It can be reached through normal Git operations such as cloning, fetching, or checking out a malicious repository.

Exploitation

The CVE is not listed in CISA KEV and no ransomware use is documented; EPSS gives a 30-day exploitation probability of 0.563 (99th percentile), and the references include a patch and vendor advisory but no public exploit tag.

What to do

  • Upgrade Git to a version published on or after 2023-01-17, at minimum v2.30.7 or newer, as the issue is patched there.
  • Apply the vendor patch commit 508386c6c5857b4faa2c3e491f422c98cc69ae76 if building from source.
  • Treat untrusted repositories as hostile: avoid cloning or checking out repositories from untrusted sources until patched.
  • Monitor Git security advisories and distribution packages (for example Gentoo GLSA 202312-15) for updated builds.
  • There are no known workarounds, so patching is the only effective remediation.

Detection

  • Scan repositories for unusually large or malformed .gitattributes files, especially those with very long lines or an excessive number of patterns or attributes.
  • Monitor Git process crashes or memory errors during clone, fetch, or checkout operations, which may indicate exploitation attempts.
  • Audit commit history for .gitattributes files that were added or modified in unexpected ways, since the file may be part of the commit history.
  • Use endpoint detection to flag abnormal memory access patterns or code execution originating from Git processes handling untrusted repositories.

This assessment is produced automatically and is not human-reviewed. Verify against the vendor advisory before acting on it.

Affected products

1 vulnerable configurations from NVD's CPE data, grouped by vendor and product.

References

Track CVE-2022-23521 inside VULONE

Watch it alongside the ransomware crews, C2 infrastructure and forum chatter that reference it, query it through the API and pull it into your SIEM over TAXII.

Start free Open in platform

Related vulnerabilities

Same products first, then exploited flaws of the same weakness class.

8.0CVE-2025-48384Git config CRLF handling allows submodule path link-following code executionGit mishandles trailing carriage returns when writing config values, so a submodule path ending in CR is read back altered during submodule initializ…KEVEPSS 4.1%analysed9.8CVE-2022-41903Git-scm git integer overflow vulnerabilityGit is distributed revision control system. `git log` can display commits in an arbitrary format using its `--format` specifiers. This functionality …EPSS 44%9.8CVE-2014-9390Git clients execute commands via crafted .git/config on case-insensitive filesystemsGit, Mercurial, libgit2, JGit, EGit and Xcode mishandle crafted .git/config paths on Windows and OS X, allowing a remote repository to place a file t…EPSS 76%analysed9.8CVE-2019-1353Git-scm git vulnerabilityAn issue was found in Git before v2.24.1, v2.23.1, v2.22.2, v2.21.1, v2.20.2, v2.19.3, v2.18.2, v2.17.3, v2.16.6, v2.15.4, and v2.14.6. When running …EPSS 2.2%9.8CVE-2018-19486Git-scm git untrusted search path vulnerabilityGit before 2.19.2 on Linux and UNIX executes commands from the current working directory (as if '.' were at the end of $PATH) in certain cases involv…EPSS 4.1%9.8CVE-2018-17456Git recursive clone argument injection enables remote code executionGit versions before the fixed releases mishandle a .gitmodules URL field that begins with a '-' character during recursive 'git clone' of a superproj…EPSS 97%analysed9.8CVE-2016-2324Suse linux enterprise debuginfo memory buffer overflow vulnerabilityInteger overflow in Git before 2.7.4 allows remote attackers to execute arbitrary code via a (1) long filename or (2) many nested trees, which trigge…EPSS 18%9.8CVE-2016-2315Suse linux enterprise debuginfo memory buffer overflow vulnerabilityrevision.c in git before 2.7.4 uses an incorrect integer data type, which allows remote attackers to execute arbitrary code via a (1) long filename o…EPSS 17%

Source: NIST National Vulnerability Database (record CVE-2022-23521), CISA KEV, FIRST EPSS (scores of 2026-09-26). This page is refreshed as NVD updates the record.