CVE-2022-23521
git: gitattributes parsing integer overflow
Severity by source
Trivy's own label is CRITICAL. Rated critical by NVD, CBL-Mariner, Photon OS. Rated lower by Red Hat (high), AlmaLinux (high), Amazon (high), Oracle (high), Rocky Linux (high), Ubuntu (medium).
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.
Affected packages and fixed versions
| Source | Package | Fixed in |
|---|---|---|
| CBL-Mariner 1.0 | git | 0:2.33.6-1.cm1 |
| CBL-Mariner 2.0 | git | 0:2.33.8-2.cm2 |
| Photon OS 3.0 | git | 2.35.6-1.ph3 |
| Photon OS 4.0 | git, git-extras, git-lang | 2.35.6-1.ph4 |
| Photon OS 5.0 | git, git-extras, git-lang | 2.43.7-1.ph5 |
| alma 8 | git, git-all, git-core and 12 more | 2.31.1-3.el8_7 |
| alma 9 | git, git-all, git-core and 12 more | 2.31.1-3.el9_1 |
| alpine 3.14 | git | 2.32.5-r0 |
| alpine 3.15 | git | 2.34.6-r0 |
| alpine 3.16 | git | 2.36.4-r0 |
| alpine 3.17 | git | 2.38.3-r0 |
| alpine 3.18 | git | 2.39.1-r0 |
Show all 227 entries from 52 sources
| Source | Package | Fixed in |
|---|---|---|
| CBL-Mariner 1.0 | git | 0:2.33.6-1.cm1 |
| CBL-Mariner 2.0 | git | 0:2.33.8-2.cm2 |
| Photon OS 3.0 | git | 2.35.6-1.ph3 |
| Photon OS 4.0 | git | 2.35.6-1.ph4 |
| Photon OS 4.0 | git-extras | 2.35.6-1.ph4 |
| Photon OS 4.0 | git-lang | 2.35.6-1.ph4 |
| Photon OS 5.0 | git | 2.43.7-1.ph5 |
| Photon OS 5.0 | git-extras | 2.43.7-1.ph5 |
| Photon OS 5.0 | git-lang | 2.43.7-1.ph5 |
| alma 8 | git | 2.31.1-3.el8_7 |
| alma 8 | git-all | 2.31.1-3.el8_7 |
| alma 8 | git-core | 2.31.1-3.el8_7 |
| alma 8 | git-core-doc | 2.31.1-3.el8_7 |
| alma 8 | git-credential-libsecret | 2.31.1-3.el8_7 |
| alma 8 | git-daemon | 2.31.1-3.el8_7 |
| alma 8 | git-email | 2.31.1-3.el8_7 |
| alma 8 | git-gui | 2.31.1-3.el8_7 |
| alma 8 | git-instaweb | 2.31.1-3.el8_7 |
| alma 8 | git-subtree | 2.31.1-3.el8_7 |
| alma 8 | git-svn | 2.31.1-3.el8_7 |
| alma 8 | gitk | 2.31.1-3.el8_7 |
| alma 8 | gitweb | 2.31.1-3.el8_7 |
| alma 8 | perl-Git | 2.31.1-3.el8_7 |
| alma 8 | perl-Git-SVN | 2.31.1-3.el8_7 |
| alma 9 | git | 2.31.1-3.el9_1 |
| alma 9 | git-all | 2.31.1-3.el9_1 |
| alma 9 | git-core | 2.31.1-3.el9_1 |
| alma 9 | git-core-doc | 2.31.1-3.el9_1 |
| alma 9 | git-credential-libsecret | 2.31.1-3.el9_1 |
| alma 9 | git-daemon | 2.31.1-3.el9_1 |
| alma 9 | git-email | 2.31.1-3.el9_1 |
| alma 9 | git-gui | 2.31.1-3.el9_1 |
| alma 9 | git-instaweb | 2.31.1-3.el9_1 |
| alma 9 | git-subtree | 2.31.1-3.el9_1 |
| alma 9 | git-svn | 2.31.1-3.el9_1 |
| alma 9 | gitk | 2.31.1-3.el9_1 |
| alma 9 | gitweb | 2.31.1-3.el9_1 |
| alma 9 | perl-Git | 2.31.1-3.el9_1 |
| alma 9 | perl-Git-SVN | 2.31.1-3.el9_1 |
| alpine 3.14 | git | 2.32.5-r0 |
| alpine 3.15 | git | 2.34.6-r0 |
| alpine 3.16 | git | 2.36.4-r0 |
| alpine 3.17 | git | 2.38.3-r0 |
| alpine 3.18 | git | 2.39.1-r0 |
| alpine 3.19 | git | 2.39.1-r0 |
| alpine 3.20 | git | 2.39.1-r0 |
| alpine 3.21 | git | 2.39.1-r0 |
| alpine 3.22 | git | 2.39.1-r0 |
| alpine 3.23 | git | 2.39.1-r0 |
| alpine 3.24 | git | 2.39.1-r0 |
| alpine edge | git | 2.39.1-r0 |
| amazon linux 1 | emacs-git | 2.38.3-1.78.amzn1 |
| amazon linux 1 | emacs-git-el | 2.38.3-1.78.amzn1 |
| amazon linux 1 | git | 2.38.3-1.78.amzn1 |
| amazon linux 1 | git-all | 2.38.3-1.78.amzn1 |
| amazon linux 1 | git-bzr | 2.38.3-1.78.amzn1 |
| amazon linux 1 | git-core | 2.38.3-1.78.amzn1 |
| amazon linux 1 | git-core-doc | 2.38.3-1.78.amzn1 |
| amazon linux 1 | git-cvs | 2.38.3-1.78.amzn1 |
| amazon linux 1 | git-daemon | 2.38.3-1.78.amzn1 |
| amazon linux 1 | git-debuginfo | 2.38.3-1.78.amzn1 |
| amazon linux 1 | git-email | 2.38.3-1.78.amzn1 |
| amazon linux 1 | git-hg | 2.38.3-1.78.amzn1 |
| amazon linux 1 | git-instaweb | 2.38.3-1.78.amzn1 |
| amazon linux 1 | git-p4 | 2.38.3-1.78.amzn1 |
| amazon linux 1 | git-subtree | 2.38.3-1.78.amzn1 |
| amazon linux 1 | git-svn | 2.38.3-1.78.amzn1 |
| amazon linux 1 | gitweb | 2.38.3-1.78.amzn1 |
| amazon linux 1 | perl-Git | 2.38.3-1.78.amzn1 |
| amazon linux 1 | perl-Git-SVN | 2.38.3-1.78.amzn1 |
| amazon linux 2 | git | 2.39.1-1.amzn2.0.1 |
| amazon linux 2 | git-all | 2.39.1-1.amzn2.0.1 |
| amazon linux 2 | git-core | 2.39.1-1.amzn2.0.1 |
| amazon linux 2 | git-core-doc | 2.39.1-1.amzn2.0.1 |
| amazon linux 2 | git-credential-libsecret | 2.39.1-1.amzn2.0.1 |
| amazon linux 2 | git-cvs | 2.39.1-1.amzn2.0.1 |
| amazon linux 2 | git-daemon | 2.39.1-1.amzn2.0.1 |
| amazon linux 2 | git-debuginfo | 2.39.1-1.amzn2.0.1 |
| amazon linux 2 | git-email | 2.39.1-1.amzn2.0.1 |
| amazon linux 2 | git-gui | 2.39.1-1.amzn2.0.1 |
| amazon linux 2 | git-instaweb | 2.39.1-1.amzn2.0.1 |
| amazon linux 2 | git-p4 | 2.39.1-1.amzn2.0.1 |
| amazon linux 2 | git-subtree | 2.39.1-1.amzn2.0.1 |
| amazon linux 2 | git-svn | 2.39.1-1.amzn2.0.1 |
| amazon linux 2 | gitk | 2.39.1-1.amzn2.0.1 |
| amazon linux 2 | gitweb | 2.39.1-1.amzn2.0.1 |
| amazon linux 2 | perl-Git | 2.39.1-1.amzn2.0.1 |
| amazon linux 2 | perl-Git-SVN | 2.39.1-1.amzn2.0.1 |
| amazon linux 2023 | git | 2.39.1-1.amzn2023.0.2 |
| amazon linux 2023 | git-all | 2.39.1-1.amzn2023.0.2 |
| amazon linux 2023 | git-core | 2.39.1-1.amzn2023.0.2 |
| amazon linux 2023 | git-core-debuginfo | 2.39.1-1.amzn2023.0.2 |
| amazon linux 2023 | git-core-doc | 2.39.1-1.amzn2023.0.2 |
| amazon linux 2023 | git-credential-libsecret | 2.39.1-1.amzn2023.0.2 |
| amazon linux 2023 | git-credential-libsecret-debuginfo | 2.39.1-1.amzn2023.0.2 |
| amazon linux 2023 | git-cvs | 2.39.1-1.amzn2023.0.2 |
| amazon linux 2023 | git-daemon | 2.39.1-1.amzn2023.0.2 |
| amazon linux 2023 | git-daemon-debuginfo | 2.39.1-1.amzn2023.0.2 |
| amazon linux 2023 | git-debuginfo | 2.39.1-1.amzn2023.0.2 |
| amazon linux 2023 | git-debugsource | 2.39.1-1.amzn2023.0.2 |
| amazon linux 2023 | git-email | 2.39.1-1.amzn2023.0.2 |
| amazon linux 2023 | git-gui | 2.39.1-1.amzn2023.0.2 |
| amazon linux 2023 | git-instaweb | 2.39.1-1.amzn2023.0.2 |
| amazon linux 2023 | git-p4 | 2.39.1-1.amzn2023.0.2 |
| amazon linux 2023 | git-subtree | 2.39.1-1.amzn2023.0.2 |
| amazon linux 2023 | git-svn | 2.39.1-1.amzn2023.0.2 |
| amazon linux 2023 | gitk | 2.39.1-1.amzn2023.0.2 |
| amazon linux 2023 | gitweb | 2.39.1-1.amzn2023.0.2 |
| amazon linux 2023 | perl-Git | 2.39.1-1.amzn2023.0.2 |
| amazon linux 2023 | perl-Git-SVN | 2.39.1-1.amzn2023.0.2 |
| chainguard | git | 2.39.1-r0 |
| debian 10 | git | 1:2.20.1-2+deb10u7 |
| debian 11 | git | 1:2.30.2-1+deb11u1 |
| debian 12 | git | 1:2.39.1-0.1 |
| debian 13 | git | 1:2.39.1-0.1 |
| debian 14 | git | 1:2.39.1-0.1 |
| echo | git | 1:2.39.1-0.1 |
| Oracle Linux 7 | emacs-git | 1.8.3.1-24.el7_9 |
| Oracle Linux 7 | emacs-git-el | 1.8.3.1-24.el7_9 |
| Oracle Linux 7 | git | 1.8.3.1-24.el7_9 |
| Oracle Linux 7 | git-all | 1.8.3.1-24.el7_9 |
| Oracle Linux 7 | git-bzr | 1.8.3.1-24.el7_9 |
| Oracle Linux 7 | git-cvs | 1.8.3.1-24.el7_9 |
| Oracle Linux 7 | git-daemon | 1.8.3.1-24.el7_9 |
| Oracle Linux 7 | git-email | 1.8.3.1-24.el7_9 |
| Oracle Linux 7 | git-gnome-keyring | 1.8.3.1-24.el7_9 |
| Oracle Linux 7 | git-gui | 1.8.3.1-24.el7_9 |
| Oracle Linux 7 | git-hg | 1.8.3.1-24.el7_9 |
| Oracle Linux 7 | git-instaweb | 1.8.3.1-24.el7_9 |
| Oracle Linux 7 | git-p4 | 1.8.3.1-24.el7_9 |
| Oracle Linux 7 | git-svn | 1.8.3.1-24.el7_9 |
| Oracle Linux 7 | gitk | 1.8.3.1-24.el7_9 |
| Oracle Linux 7 | gitweb | 1.8.3.1-24.el7_9 |
| Oracle Linux 7 | perl-Git | 1.8.3.1-24.el7_9 |
| Oracle Linux 7 | perl-Git-SVN | 1.8.3.1-24.el7_9 |
| Oracle Linux 8 | git | 2.31.1-3.el8_7 |
| Oracle Linux 8 | git-all | 2.31.1-3.el8_7 |
| Oracle Linux 8 | git-core | 2.31.1-3.el8_7 |
| Oracle Linux 8 | git-core-doc | 2.31.1-3.el8_7 |
| Oracle Linux 8 | git-credential-libsecret | 2.31.1-3.el8_7 |
| Oracle Linux 8 | git-daemon | 2.31.1-3.el8_7 |
| Oracle Linux 8 | git-email | 2.31.1-3.el8_7 |
| Oracle Linux 8 | git-gui | 2.31.1-3.el8_7 |
| Oracle Linux 8 | git-instaweb | 2.31.1-3.el8_7 |
| Oracle Linux 8 | git-subtree | 2.31.1-3.el8_7 |
| Oracle Linux 8 | git-svn | 2.31.1-3.el8_7 |
| Oracle Linux 8 | gitk | 2.31.1-3.el8_7 |
| Oracle Linux 8 | gitweb | 2.31.1-3.el8_7 |
| Oracle Linux 8 | perl-Git | 2.31.1-3.el8_7 |
| Oracle Linux 8 | perl-Git-SVN | 2.31.1-3.el8_7 |
| Oracle Linux 9 | git | 2.31.1-3.el9_1 |
| Oracle Linux 9 | git-all | 2.31.1-3.el9_1 |
| Oracle Linux 9 | git-core | 2.31.1-3.el9_1 |
| Oracle Linux 9 | git-core-doc | 2.31.1-3.el9_1 |
| Oracle Linux 9 | git-credential-libsecret | 2.31.1-3.el9_1 |
| Oracle Linux 9 | git-daemon | 2.31.1-3.el9_1 |
| Oracle Linux 9 | git-email | 2.31.1-3.el9_1 |
| Oracle Linux 9 | git-gui | 2.31.1-3.el9_1 |
| Oracle Linux 9 | git-instaweb | 2.31.1-3.el9_1 |
| Oracle Linux 9 | git-subtree | 2.31.1-3.el9_1 |
| Oracle Linux 9 | git-svn | 2.31.1-3.el9_1 |
| Oracle Linux 9 | gitk | 2.31.1-3.el9_1 |
| Oracle Linux 9 | gitweb | 2.31.1-3.el9_1 |
| Oracle Linux 9 | perl-Git | 2.31.1-3.el9_1 |
| Oracle Linux 9 | perl-Git-SVN | 2.31.1-3.el9_1 |
| rapidfort ubuntu 20.04 | git | 1:2.34.1-1ubuntu1.6 |
| rapidfort ubuntu 20.04 | rf-git | 1:2.34.1-1ubuntu1.6 |
| rapidfort ubuntu 22.04 | git | 1:2.34.1-1ubuntu1.6 |
| rapidfort ubuntu 22.04 | rf-git | 1:2.34.1-1ubuntu1.6 |
| rapidfort ubuntu 24.04 | git | 1:2.34.1-1ubuntu1.6 |
| rapidfort ubuntu 24.04 | rf-git | 1:2.34.1-1ubuntu1.6 |
| Red Hat | emacs-git | no fix listed |
| Red Hat | emacs-git-el | no fix listed |
| Red Hat | git | no fix listed |
| Red Hat | git-all | no fix listed |
| Red Hat | git-cvs | no fix listed |
| Red Hat | git-daemon | no fix listed |
| Red Hat | git-email | no fix listed |
| Red Hat | git-gui | no fix listed |
| Red Hat | git-svn | no fix listed |
| Red Hat | gitk | no fix listed |
| Red Hat | gitweb | no fix listed |
| Red Hat | perl-Git | no fix listed |
| rocky 8 | git | 2.31.1-3.el8_7 |
| rocky 8 | git-all | 2.31.1-3.el8_7 |
| rocky 8 | git-core | 2.31.1-3.el8_7 |
| rocky 8 | git-core-doc | 2.31.1-3.el8_7 |
| rocky 8 | git-credential-libsecret | 2.31.1-3.el8_7 |
| rocky 8 | git-daemon | 2.31.1-3.el8_7 |
| rocky 8 | git-email | 2.31.1-3.el8_7 |
| rocky 8 | git-gui | 2.31.1-3.el8_7 |
| rocky 8 | git-instaweb | 2.31.1-3.el8_7 |
| rocky 8 | git-subtree | 2.31.1-3.el8_7 |
| rocky 8 | git-svn | 2.31.1-3.el8_7 |
| rocky 8 | gitk | 2.31.1-3.el8_7 |
| rocky 8 | gitweb | 2.31.1-3.el8_7 |
| rocky 8 | perl-Git | 2.31.1-3.el8_7 |
| rocky 8 | perl-Git-SVN | 2.31.1-3.el8_7 |
| rocky 9 | git | 2.31.1-3.el9_1 |
| rocky 9 | git-all | 2.31.1-3.el9_1 |
| rocky 9 | git-core | 2.31.1-3.el9_1 |
| rocky 9 | git-core-doc | 2.31.1-3.el9_1 |
| rocky 9 | git-credential-libsecret | 2.31.1-3.el9_1 |
| rocky 9 | git-daemon | 2.31.1-3.el9_1 |
| rocky 9 | git-email | 2.31.1-3.el9_1 |
| rocky 9 | git-gui | 2.31.1-3.el9_1 |
| rocky 9 | git-instaweb | 2.31.1-3.el9_1 |
| rocky 9 | git-subtree | 2.31.1-3.el9_1 |
| rocky 9 | git-svn | 2.31.1-3.el9_1 |
| rocky 9 | gitk | 2.31.1-3.el9_1 |
| rocky 9 | gitweb | 2.31.1-3.el9_1 |
| rocky 9 | perl-Git | 2.31.1-3.el9_1 |
| rocky 9 | perl-Git-SVN | 2.31.1-3.el9_1 |
| root.io debian 11 | rootio-git | 1:2.30.2-1+deb11u1 |
| root.io debian 12 | rootio-git | 1:2.39.1-0.1 |
| root.io debian 13 | rootio-git | 1:2.39.1-0.1 |
| root.io ubuntu 22.04 | rootio-git | 1:2.34.1-1ubuntu1.6 |
| ubuntu 14.04-ESM | git | 1:1.9.1-1ubuntu0.10+esm1 |
| ubuntu 16.04-ESM | git | 1:2.7.4-0ubuntu1.10+esm4 |
| ubuntu 18.04 | git | 1:2.17.1-1ubuntu0.15 |
| ubuntu 18.04-ESM | git | 1:2.17.1-1ubuntu0.15 |
| ubuntu 20.04 | git | 1:2.25.1-1ubuntu3.8 |
| ubuntu 20.04-ESM | git | 1:2.25.1-1ubuntu3.8 |
| ubuntu 22.04 | git | 1:2.34.1-1ubuntu1.6 |
| ubuntu 22.10 | git | 1:2.37.2-1ubuntu1.2 |
| ubuntu 23.04 | git | 1:2.39.1-0.1ubuntu1 |
| wolfi | git | 2.39.1-r0 |
References
- https://access.redhat.com/errata/RHSA-2023:0611
- https://access.redhat.com/security/cve/CVE-2022-23521
- https://bugzilla.redhat.com/2162055
- https://bugzilla.redhat.com/2162056
- https://bugzilla.redhat.com/show_bug.cgi?id=2162055
- https://bugzilla.redhat.com/show_bug.cgi?id=2162056
- https://creativecommons.org/licenses/by/4.0/
- https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2022-23521
All 25 references
- https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2022-41903
- https://errata.almalinux.org/9/ALSA-2023-0611.html
- https://errata.rockylinux.org/RLSA-2023:0611
- https://github.blog/2023-01-17-git-security-vulnerabilities-announced-2/
- https://github.com/git/git/commit/508386c6c5857b4faa2c3e491f422c98cc69ae76
- https://github.com/git/git/files/10430260/X41-OSTIF-Gitlab-Git-Security-Audit-20230117-public.pdf
- https://github.com/git/git/security/advisories/GHSA-c738-c5qq-xg89
- https://linux.oracle.com/cve/CVE-2022-23521.html
- https://linux.oracle.com/errata/ELSA-2023-0978.html
- https://nvd.nist.gov/vuln/detail/CVE-2022-23521
- https://security.gentoo.org/glsa/202312-15
- 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://www.openwall.com/lists/oss-security/2023/01/17/4