Skip to content
OpenAdvisories
Critical · 9.8 CVE-2022-23521 EUVD-2022-28555

gitattributes parsing integer overflow in git

Published Jan 17, 2023 · Updated Feb 13, 2025 · Assigned by GitHub_M

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 products

VendorProductAffectedFixed
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 —

Fixed in Linux distributions

Distributions backport fixes, so the version that fixes this vulnerability differs per release — upgrade to at least the version shown. From the distributions' security trackers and advisories.

ReleasePackageFixed inAdvisory
Debian 14 git 1:2.39.1-0.1 —
Debian 13 git 1:2.39.1-0.1 —
Debian 12 git 1:2.39.1-0.1 —
Debian 11 git 1:2.30.2-1+deb11u1 DSA-5332-1
Debian 10 git 1:2.20.1-2+deb10u7 DLA-3282-1
ReleasePackageFixed inAdvisory
Ubuntu 22.04 LTS git 1:2.34.1-1ubuntu1.6 USN-5810-1
Ubuntu 20.04 LTS git 1:2.25.1-1ubuntu3.8 USN-5810-1
Ubuntu 18.04 LTS git 1:2.17.1-1ubuntu0.15 USN-5810-1
Show 2 more (older releases, extended support, other products)
ReleasePackageFixed inAdvisory
Ubuntu Pro 16.04 LTS git 1:2.7.4-0ubuntu1.10+esm4 USN-5810-3
Ubuntu Pro 14.04 LTS git 1:1.9.1-1ubuntu0.10+esm1 USN-5810-4
ReleasePackageFixed inAdvisory
RHEL 9 git +14 2.31.1-3.el9_1 RHSA-2023:0611
RHEL 8 git +14 2.31.1-3.el8_7 RHSA-2023:0610
RHEL 7 git +17 1.8.3.1-24.el7_9 RHSA-2023:0978
RHEL 3 rh-git227-git +16 2.27.0-4.el7 RHSA-2023:0597
Show 8 more (older releases, extended support, other products)
ReleasePackageFixed inAdvisory
Red Hat Rhev Hypervisor 4 redhat-virtualization-host +1 4.5.3-202304051438_8.6 RHSA-2023:1677
RHEL 9.0 EUS git +14 2.31.1-3.el9_0 RHSA-2023:0627
RHEL 8.6 EUS git +14 2.31.1-3.el8_6 RHSA-2023:0628
RHEL 8.4 EUS git +14 2.27.0-3.el8_4 RHSA-2023:0596
RHEL 8.2 TUS git +13 2.18.4-3.el8_2 RHSA-2023:0609
RHEL 8.2 E4S git +13 2.18.4-3.el8_2 RHSA-2023:0609
RHEL 8.2 AUS git +13 2.18.4-3.el8_2 RHSA-2023:0609
RHEL 8.1 E4S git +13 2.18.4-2.el8_1 RHSA-2023:0599

AlmaLinux

Errata ↗
ReleasePackageFixed inAdvisory
AlmaLinux 9 git +14 2.31.1-3.el9_1 ALSA-2023:0611
AlmaLinux 8 git +14 2.31.1-3.el8_7 ALSA-2023:0610

Rocky Linux

Errata ↗
ReleasePackageFixed inAdvisory
Rocky Linux 9 git 2.31.1-3.el9_1 RLSA-2023:0611
Rocky Linux 8 git 2.31.1-3.el8_7 RLSA-2023:0610
ReleasePackageFixed inAdvisory
SLES 15 SP4 git 2.35.3-150300.10.21.1 SUSE-SU-2023:0110-1
SLES 15 SP3 git 2.35.3-150300.10.21.1 SUSE-SU-2023:0110-1
SLES 15 SP2 git 2.26.2-150000.44.1 SUSE-SU-2023:0108-1
SLES 15 SP1 git 2.26.2-150000.44.1 SUSE-SU-2023:0108-1
SLES 12 SP5 git 2.26.2-27.63.2 SUSE-SU-2023:0109-1
Show 21 more (older releases, extended support, other products)
ReleasePackageFixed inAdvisory
SLES 12 SP4 git 2.26.2-27.63.2 SUSE-SU-2023:0109-1
SLES 12 SP2 git 2.26.2-27.63.2 SUSE-SU-2023:0109-1
SLES for SAP 15 SP3 git 2.35.3-150300.10.21.1 SUSE-SU-2023:0110-1
SLES for SAP 15 SP2 git 2.26.2-150000.44.1 SUSE-SU-2023:0108-1
SLES for SAP 15 SP1 git 2.26.2-150000.44.1 SUSE-SU-2023:0108-1
SLES for SAP 12 SP5 git 2.26.2-27.63.2 SUSE-SU-2023:0109-1
SLES for SAP 12 SP4 git 2.26.2-27.63.2 SUSE-SU-2023:0109-1
SLE Real Time 15 SP3 git 2.35.3-150300.10.21.1 SUSE-SU-2023:0110-1
SLE HPC 15 SP3 git 2.35.3-150300.10.21.1 SUSE-SU-2023:0110-1
SLE HPC 15 SP2 git 2.26.2-150000.44.1 SUSE-SU-2023:0108-1
SLE HPC 15 SP1 git 2.26.2-150000.44.1 SUSE-SU-2023:0108-1
SUSE OpenStack Cloud Crowbar 9 git 2.26.2-27.63.2 SUSE-SU-2023:0109-1
SUSE OpenStack Cloud 9 git 2.26.2-27.63.2 SUSE-SU-2023:0109-1
SUSE OpenStack Cloud 8 git 2.26.2-27.63.2 SUSE-SU-2023:0109-1
SUSE Manager Server 4.2 git 2.35.3-150300.10.21.1 SUSE-SU-2023:0110-1
SUSE Manager Retail Branch Server 4.2 git 2.35.3-150300.10.21.1 SUSE-SU-2023:0110-1
SUSE Manager Proxy 4.2 git 2.35.3-150300.10.21.1 SUSE-SU-2023:0110-1
SUSE HPE Helion OpenStack 8 git 2.26.2-27.63.2 SUSE-SU-2023:0109-1
SUSE Enterprise Storage 7.1 git 2.35.3-150300.10.21.1 SUSE-SU-2023:0110-1
SUSE Enterprise Storage 7 git 2.26.2-150000.44.1 SUSE-SU-2023:0108-1
SUSE Enterprise Storage 6 git 2.26.2-150000.44.1 SUSE-SU-2023:0108-1
ReleasePackageFixed inAdvisory
openSUSE Tumbleweed git 2.39.1-1.1 openSUSE-SU-2024:12625-1
openSUSE Leap 15.4 git 2.26.2-150000.44.1 SUSE-SU-2023:0110-1, SUSE-SU-2023:0108-1
ReleasePackageFixed inAdvisory
Alpine v3.24 git 2.39.1-r0 —
Alpine v3.23 git 2.39.1-r0 —
Alpine v3.22 git 2.39.1-r0 —
Alpine v3.21 git 2.39.1-r0 —
Alpine v3.20 git 2.39.1-r0 —
Show 6 more (older releases, extended support, other products)
ReleasePackageFixed inAdvisory
Alpine v3.19 git 2.39.1-r0 —
Alpine v3.18 git 2.39.1-r0 —
Alpine v3.17 git 2.38.3-r0 —
Alpine v3.16 git 2.36.4-r0 —
Alpine v3.15 git 2.34.6-r0 —
Alpine v3.14 git 2.32.5-r0 —

Amazon Linux

ReleasePackageFixed inAdvisory
Amazon Linux 2023 git +16 2.39.1-1.amzn2023.0.2 ALAS2023-2023-065
Amazon Linux 2 git +16 2.39.1-1.amzn2.0.1 ALAS2-2023-1923

Azure Linux

ReleasePackageFixed inAdvisory
Azure Linux 2 (CBL-Mariner) git 2.33.8-2 —

Oracle Linux

ReleasePackageFixed inAdvisory
Oracle Linux 9 git +14 2.31.1-3.el9_1 ELSA-2023-0611
Oracle Linux 8 git +14 2.31.1-3.el8_7 ELSA-2023-0610
Oracle Linux 7 git +17 1.8.3.1-24.el7_9 ELSA-2023-0978

Wolfi

ReleasePackageFixed inAdvisory
Wolfi rolling git 2.39.1-r0 —

Advisories 37

References