VDB

CVE-2022-23521

CVE-2022-23521 PUBLISHED CVSS 9.8 CRITICAL

gitattributes parsing integer overflow in git

Reported by github_m · Published January 17, 2023

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.

Fixed versions

Upgrade to a fixed version or later. Language registries are listed first, then Linux distributions, then vendor products.

PackageEcosystemFixed in
git-svnAmazon Linux2.39.1-1.amzn2023.0.2, 2.39.1-1.amzn2.0.1
perl-GitAmazon Linux2.39.1-1.amzn2023.0.2, 2.39.1-1.amzn2.0.1
git-cvsAmazon Linux2.39.1-1.amzn2023.0.2, 2.39.1-1.amzn2.0.1
git-instawebAmazon Linux2.39.1-1.amzn2023.0.2, 2.39.1-1.amzn2.0.1
git-coreAmazon Linux2.39.1-1.amzn2023.0.2, 2.39.1-1.amzn2.0.1
gitwebAmazon Linux2.39.1-1.amzn2023.0.2
git-subtreeAmazon Linux2.39.1-1.amzn2023.0.2, 2.39.1-1.amzn2.0.1
gitChainguard2.39.1-r0
git-core-docAmazon Linux2.39.1-1.amzn2023.0.2, 2.39.1-1.amzn2.0.1
git-guiAmazon Linux2.39.1-1.amzn2023.0.2, 2.39.1-1.amzn2.0.1
git-emailAmazon Linux2.39.1-1.amzn2023.0.2, 2.39.1-1.amzn2.0.1
perl-Git-SVNAmazon Linux2.39.1-1.amzn2.0.1

6 more packages have a fixed version. See every fix in Lookup.

Risk scores

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

Affected products

VendorProductVersions
gitgit< 2.30.7, >= 2.31.0, < 2.31.6, >= 2.32.0, < 2.32.5
amazon:2023git-svn0
amazon:2perl-Git0
amazon:2git-cvs0
amazon:2git-instaweb0
amazon:2git-core0
amazon:2023gitweb0
amazon:2git-subtree0
chainguardgit0
amazon:2git-core-doc0
amazon:2git-gui0
amazon:2git-email0
amazon:2perl-Git-SVN0
amazon:2023git-cvs0
amazon:2gitk0
amazon:2023git-core0
amazon:2git0
amazon:2023git-subtree0
amazon:2git-credential-libsecret0
amazon:2git-p40

…and 19 more

Timeline

  • Jan 17, 2023 CVE Published
  • Jan 18, 2023 EPSS Score (30 in total, the first dated here)
  • Feb 13, 2025 CVE Updated
  • Mar 10, 2026 Security Advisory (36 in total, the first dated here)
  • Jul 5, 2026 Coalition ESS Score
  • Aug 11, 2026 Distribution Patch (33 in total, the first dated here)

Query this with the API

The same record, from the CLI:

vulnetix vdb vuln CVE-2022-23521
vulnetix vdb fixes CVE-2022-23521

Or with curl, using the org id and key from your account page:

curl -s -H "Authorization: ApiKey ${VULNETIX_ORG_ID}:${VULNETIX_API_KEY}" \
  "https://api.vdb.vulnetix.com/v2/vuln/CVE-2022-23521/fixes/registry"

The Community plan is free and allows 50 queries a day. Get a free API key · API quickstart

Look up in the Resolve Platform →
$ Lookup Community · 50/day Open Lookup ›