CVE-2022-41903
published critical CVSS 3.1 · 9.8Integer overflow in `git archive`, `git log --format` leading to RCE in git
Package status and fixes
| Distro / vendor | Release | Package / product | Publisher status | Fixed build | Source |
|---|---|---|---|---|---|
| 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 | Affected | Not stated | GitHub_M |
| Amazon Linux | AL2 | Release evaluationALAS2-2023-1923 | Fixed | Not stated | Amazon Linux assessment |
| Amazon Linux | AL2023 | Release evaluationALAS2023-2023-065 | Fixed | Not stated | Amazon Linux assessment |
| AlmaLinux | 8 | git | Advisory build | 2.31.1-3.el8_7 | ALSA-2023:0610 |
| Alpine Linux | edge | git | Fixed | 2.39.1-r0 | Package fix record |
| Debian | bullseye | git | Advisory build | 1:2.30.2-1+deb11u1 | DSA-5332-1 |
| Oracle Linux | 7 | gitaarch64 | Advisory build | 0:1.8.3.1-24.el7_9 | ELSA-2023-0978 |
| Red Hat Enterprise Linux | RHEL-7 | gitppc64 | Advisory build | 1.8.3.1-24.el7_9 | RHSA-2023:0978 |
Show 95 more entries
| Distro / vendor | Release | Package / product | Publisher status | Fixed build | Source |
|---|---|---|---|---|---|
| SUSE / openSUSE | SLE-12-SP2 | gitx86_64 | Advisory build | 2.26.2-27.63.2 | SUSE-SU-2023:0109-1 |
| Ubuntu | esm | git | Advisory build | 1:1.9.1-1ubuntu0.10+esm1 | USN-5810-4 |
| AlmaLinux | 9 | git | Advisory build | 2.31.1-3.el9_1 | ALSA-2023:0611 |
| Alpine Linux | v3.14 | git | Fixed | 2.32.5-r0 | Package fix record |
| Alpine Linux | v3.15 | git | Fixed | 2.34.6-r0 | Package fix record |
| Alpine Linux | v3.16 | git | Fixed | 2.36.4-r0 | Package fix record |
| Alpine Linux | v3.17 | git | Fixed | 2.38.3-r0 | Package fix record |
| Alpine Linux | v3.18 | git | Fixed | 2.39.1-r0 | Package fix record |
| Alpine Linux | v3.19 | git | Fixed | 2.39.1-r0 | Package fix record |
| Alpine Linux | v3.20 | git | Fixed | 2.39.1-r0 | Package fix record |
| Alpine Linux | v3.21 | git | Fixed | 2.39.1-r0 | Package fix record |
| Alpine Linux | v3.22 | git | Fixed | 2.39.1-r0 | Package fix record |
| Alpine Linux | v3.23 | git | Fixed | 2.39.1-r0 | Package fix record |
| Alpine Linux | v3.24 | git | Fixed | 2.39.1-r0 | Package fix record |
| Debian | buster | git | Advisory build | 1:2.20.1-2+deb10u7 | DLA-3282-1 |
| Oracle Linux | 7 | gitx86_64 | Advisory build | 0:1.8.3.1-24.el7_9 | ELSA-2023-0978 |
| Oracle Linux | 8 | gitaarch64 | Advisory build | 0:2.31.1-3.el8_7 | ELSA-2023-0610 |
| Oracle Linux | 8 | gitx86_64 | Advisory build | 0:2.31.1-3.el8_7 | ELSA-2023-0610 |
| Oracle Linux | 9 | gitaarch64 | Advisory build | 0:2.31.1-3.el9_1 | ELSA-2023-0611 |
| Oracle Linux | 9 | gitx86_64 | Advisory build | 0:2.31.1-3.el9_1 | ELSA-2023-0611 |
| Red Hat Enterprise Linux | RHEL-7 | gitppc64le | Advisory build | 1.8.3.1-24.el7_9 | RHSA-2023:0978 |
| Red Hat Enterprise Linux | RHEL-7 | gits390x | Advisory build | 1.8.3.1-24.el7_9 | RHSA-2023:0978 |
| Red Hat Enterprise Linux | RHEL-7 | gitsrc | Advisory build | 1.8.3.1-24.el7_9 | RHSA-2023:0978 |
| Red Hat Enterprise Linux | RHEL-7 | gitx86_64 | Advisory build | 1.8.3.1-24.el7_9 | RHSA-2023:0978 |
| Red Hat Enterprise Linux | RHEL-8 | gitaarch64 | Advisory build | 2.27.0-3.el8_4 | RHSA-2023:0596 |
| Red Hat Enterprise Linux | RHEL-8 | gitaarch64 | Advisory build | 2.31.1-3.el8_6 | RHSA-2023:0628 |
| Red Hat Enterprise Linux | RHEL-8 | gitaarch64 | Advisory build | 2.31.1-3.el8_7 | RHSA-2023:0610 |
| Red Hat Enterprise Linux | RHEL-8 | gitppc64le | Advisory build | 2.18.4-2.el8_1 | RHSA-2023:0599 |
| Red Hat Enterprise Linux | RHEL-8 | gitppc64le | Advisory build | 2.18.4-3.el8_2 | RHSA-2023:0609 |
| Red Hat Enterprise Linux | RHEL-8 | gitppc64le | Advisory build | 2.27.0-3.el8_4 | RHSA-2023:0596 |
| Red Hat Enterprise Linux | RHEL-8 | gitppc64le | Advisory build | 2.31.1-3.el8_6 | RHSA-2023:0628 |
| Red Hat Enterprise Linux | RHEL-8 | gitppc64le | Advisory build | 2.31.1-3.el8_7 | RHSA-2023:0610 |
| Red Hat Enterprise Linux | RHEL-8 | gits390x | Advisory build | 2.27.0-3.el8_4 | RHSA-2023:0596 |
| Red Hat Enterprise Linux | RHEL-8 | gits390x | Advisory build | 2.31.1-3.el8_6 | RHSA-2023:0628 |
| Red Hat Enterprise Linux | RHEL-8 | gits390x | Advisory build | 2.31.1-3.el8_7 | RHSA-2023:0610 |
| Red Hat Enterprise Linux | RHEL-8 | gitsrc | Advisory build | 2.18.4-2.el8_1 | RHSA-2023:0599 |
| Red Hat Enterprise Linux | RHEL-8 | gitsrc | Advisory build | 2.18.4-3.el8_2 | RHSA-2023:0609 |
| Red Hat Enterprise Linux | RHEL-8 | gitsrc | Advisory build | 2.27.0-3.el8_4 | RHSA-2023:0596 |
| Red Hat Enterprise Linux | RHEL-8 | gitsrc | Advisory build | 2.31.1-3.el8_6 | RHSA-2023:0628 |
| Red Hat Enterprise Linux | RHEL-8 | gitsrc | Advisory build | 2.31.1-3.el8_7 | RHSA-2023:0610 |
| Red Hat Enterprise Linux | RHEL-8 | gitx86_64 | Advisory build | 2.18.4-2.el8_1 | RHSA-2023:0599 |
| Red Hat Enterprise Linux | RHEL-8 | gitx86_64 | Advisory build | 2.18.4-3.el8_2 | RHSA-2023:0609 |
| Red Hat Enterprise Linux | RHEL-8 | gitx86_64 | Advisory build | 2.27.0-3.el8_4 | RHSA-2023:0596 |
| Red Hat Enterprise Linux | RHEL-8 | gitx86_64 | Advisory build | 2.31.1-3.el8_6 | RHSA-2023:0628 |
| Red Hat Enterprise Linux | RHEL-8 | gitx86_64 | Advisory build | 2.31.1-3.el8_7 | RHSA-2023:0610 |
| Red Hat Enterprise Linux | RHEL-9 | gitaarch64 | Advisory build | 2.31.1-3.el9_0 | RHSA-2023:0627 |
| Red Hat Enterprise Linux | RHEL-9 | gitaarch64 | Advisory build | 2.31.1-3.el9_1 | RHSA-2023:0611 |
| Red Hat Enterprise Linux | RHEL-9 | gitppc64le | Advisory build | 2.31.1-3.el9_0 | RHSA-2023:0627 |
| Red Hat Enterprise Linux | RHEL-9 | gitppc64le | Advisory build | 2.31.1-3.el9_1 | RHSA-2023:0611 |
| Red Hat Enterprise Linux | RHEL-9 | gits390x | Advisory build | 2.31.1-3.el9_0 | RHSA-2023:0627 |
| Red Hat Enterprise Linux | RHEL-9 | gits390x | Advisory build | 2.31.1-3.el9_1 | RHSA-2023:0611 |
| Red Hat Enterprise Linux | RHEL-9 | gitsrc | Advisory build | 2.31.1-3.el9_0 | RHSA-2023:0627 |
| Red Hat Enterprise Linux | RHEL-9 | gitsrc | Advisory build | 2.31.1-3.el9_1 | RHSA-2023:0611 |
| Red Hat Enterprise Linux | RHEL-9 | gitx86_64 | Advisory build | 2.31.1-3.el9_0 | RHSA-2023:0627 |
| Red Hat Enterprise Linux | RHEL-9 | gitx86_64 | Advisory build | 2.31.1-3.el9_1 | RHSA-2023:0611 |
| SUSE / openSUSE | SLE-12-SP4 | gitaarch64 | Advisory build | 2.26.2-27.63.2 | SUSE-SU-2023:0109-1 |
| SUSE / openSUSE | SLE-12-SP4 | gitppc64le | Advisory build | 2.26.2-27.63.2 | SUSE-SU-2023:0109-1 |
| SUSE / openSUSE | SLE-12-SP4 | gits390x | Advisory build | 2.26.2-27.63.2 | SUSE-SU-2023:0109-1 |
| SUSE / openSUSE | SLE-12-SP4 | gitx86_64 | Advisory build | 2.26.2-27.63.2 | SUSE-SU-2023:0109-1 |
| SUSE / openSUSE | SLE-12-SP5 | gitaarch64 | Advisory build | 2.26.2-27.63.2 | SUSE-SU-2023:0109-1 |
| SUSE / openSUSE | SLE-12-SP5 | gitppc64le | Advisory build | 2.26.2-27.63.2 | SUSE-SU-2023:0109-1 |
| SUSE / openSUSE | SLE-12-SP5 | gits390x | Advisory build | 2.26.2-27.63.2 | SUSE-SU-2023:0109-1 |
| SUSE / openSUSE | SLE-12-SP5 | gitx86_64 | Advisory build | 2.26.2-27.63.2 | SUSE-SU-2023:0109-1 |
| SUSE / openSUSE | SLE-15-SP1 | gitaarch64 | Advisory build | 2.26.2-150000.44.1 | SUSE-SU-2023:0108-1 |
| SUSE / openSUSE | SLE-15-SP1 | gitppc64le | Advisory build | 2.26.2-150000.44.1 | SUSE-SU-2023:0108-1 |
| SUSE / openSUSE | SLE-15-SP1 | gits390x | Advisory build | 2.26.2-150000.44.1 | SUSE-SU-2023:0108-1 |
| SUSE / openSUSE | SLE-15-SP1 | gitx86_64 | Advisory build | 2.26.2-150000.44.1 | SUSE-SU-2023:0108-1 |
| SUSE / openSUSE | SLE-15-SP2 | gitaarch64 | Advisory build | 2.26.2-150000.44.1 | SUSE-SU-2023:0108-1 |
| SUSE / openSUSE | SLE-15-SP2 | gitppc64le | Advisory build | 2.26.2-150000.44.1 | SUSE-SU-2023:0108-1 |
| SUSE / openSUSE | SLE-15-SP2 | gits390x | Advisory build | 2.26.2-150000.44.1 | SUSE-SU-2023:0108-1 |
| SUSE / openSUSE | SLE-15-SP2 | gitx86_64 | Advisory build | 2.26.2-150000.44.1 | SUSE-SU-2023:0108-1 |
| SUSE / openSUSE | SLE-15-SP3 | gitaarch64 | Advisory build | 2.35.3-150300.10.21.1 | SUSE-SU-2023:0110-1 |
| SUSE / openSUSE | SLE-15-SP3 | gitppc64le | Advisory build | 2.35.3-150300.10.21.1 | SUSE-SU-2023:0110-1 |
| SUSE / openSUSE | SLE-15-SP3 | gits390x | Advisory build | 2.35.3-150300.10.21.1 | SUSE-SU-2023:0110-1 |
| SUSE / openSUSE | SLE-15-SP3 | gitx86_64 | Advisory build | 2.35.3-150300.10.21.1 | SUSE-SU-2023:0110-1 |
| SUSE / openSUSE | SLE-15-SP4 | gitaarch64 | Advisory build | 2.35.3-150300.10.21.1 | SUSE-SU-2023:0110-1 |
| SUSE / openSUSE | SLE-15-SP4 | gitppc64le | Advisory build | 2.35.3-150300.10.21.1 | SUSE-SU-2023:0110-1 |
| SUSE / openSUSE | SLE-15-SP4 | gits390x | Advisory build | 2.35.3-150300.10.21.1 | SUSE-SU-2023:0110-1 |
| SUSE / openSUSE | SLE-15-SP4 | gitx86_64 | Advisory build | 2.35.3-150300.10.21.1 | SUSE-SU-2023:0110-1 |
| SUSE / openSUSE | openSUSE-Leap-15.4 | gitaarch64 | Advisory build | 2.35.3-150300.10.21.1 | SUSE-SU-2023:0110-1 |
| SUSE / openSUSE | openSUSE-Leap-15.4 | gitppc64le | Advisory build | 2.35.3-150300.10.21.1 | SUSE-SU-2023:0110-1 |
| SUSE / openSUSE | openSUSE-Leap-15.4 | gits390x | Advisory build | 2.35.3-150300.10.21.1 | SUSE-SU-2023:0110-1 |
| SUSE / openSUSE | openSUSE-Leap-15.4 | gitx86_64 | Advisory build | 2.35.3-150300.10.21.1 | SUSE-SU-2023:0110-1 |
| SUSE / openSUSE | openSUSE-Tumbleweed | gitaarch64 | Advisory build | 2.39.1-1.1 | OPENSUSE-SU-2024:12625-1 |
| SUSE / openSUSE | openSUSE-Tumbleweed | gitppc64le | Advisory build | 2.39.1-1.1 | OPENSUSE-SU-2024:12625-1 |
| SUSE / openSUSE | openSUSE-Tumbleweed | gits390x | Advisory build | 2.39.1-1.1 | OPENSUSE-SU-2024:12625-1 |
| SUSE / openSUSE | openSUSE-Tumbleweed | gitx86_64 | Advisory build | 2.39.1-1.1 | OPENSUSE-SU-2024:12625-1 |
| Ubuntu | jammy | git | Advisory build | 1:2.34.1-1ubuntu1.6 | USN-5810-1 |
| Ubuntu | xenial | git | Advisory build | 1:2.7.4-0ubuntu1.10+esm4 | USN-5810-3 |
| AlmaLinux | 8 | git-all | Advisory build | 2.31.1-3.el8_7 | ALSA-2023:0610 |
| AlmaLinux | 8 | git-core | Advisory build | 2.31.1-3.el8_7 | ALSA-2023:0610 |
| AlmaLinux | 8 | git-core-doc | Advisory build | 2.31.1-3.el8_7 | ALSA-2023:0610 |
| AlmaLinux | 8 | git-credential-libsecret | Advisory build | 2.31.1-3.el8_7 | ALSA-2023:0610 |
| AlmaLinux | 8 | git-daemon | Advisory build | 2.31.1-3.el8_7 | ALSA-2023:0610 |
| AlmaLinux | 8 | git-email | Advisory build | 2.31.1-3.el8_7 | ALSA-2023:0610 |
Package entries are limited to the first 100 builds and 100 linked advisories.
Description
Git is distributed revision control system. `git log` can display commits in an arbitrary format using its `--format` specifiers. This functionality is also exposed to `git archive` via the `export-subst` gitattribute. When processing the padding operators, there is a integer overflow in `pretty.c::format_and_pad_commit()` where a `size_t` is stored improperly as an `int`, and then added as an offset to a `memcpy()`. This overflow can be triggered directly by a user running a command which invokes the commit formatting machinery (e.g., `git log --format=...`). It may also be triggered indirectly through git archive via the export-subst mechanism, which expands format specifiers inside of files within the repository during a git archive. This integer overflow can result in arbitrary heap writes, which may result in arbitrary 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. Users who are unable to upgrade should disable `git archive` in untrusted repositories. If you expose git archive via `git daemon`, disable it by running `git config --global daemon.uploadArch false`.
Related advisories
Vendor advisories explicitly linked to this CVE.
Assessment
CVSS risk assessment and additional context for this vulnerability.
- CVSS version
- 3.1
- Base score
- 9.8 / 10
- Severity
- critical
- Provider
- GitHub_M · cna
- Vector string
- CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
Publisher product statements
Version ranges and default statuses as reported by each provider.
| Vendor | Product | Version status | Source |
|---|---|---|---|
| git | git | < 2.30.7 (affected)>= 2.31.0, < 2.31.6 (affected)>= 2.32.0, < 2.32.5 (affected)>= 2.33.0, < 2.33.6 (affected)>= 2.34.0, < 2.34.6 (affected)>= 2.35.0, < 2.35.6 (affected)>= 2.36.0, < 2.36.4 (affected)>= 2.37.0, < 2.37.5 (affected)>= 2.38.0, < 2.38.3 (affected)= 2.39.0 (affected) | GitHub_M · cna |
Weaknesses
1- CWE-190 CWE-190: Integer Overflow or Wraparound
References
5- https://git-scm.com/book/en/v2/Customizing-Git-Git-Attributes#_export_subst
- https://git-scm.com/docs/pretty-formats#Documentation/pretty-formats.txt-emltltNgttruncltruncmtruncem
- https://github.com/git/git/commit/508386c6c5857b4faa2c3e491f422c98cc69ae76
- https://github.com/git/git/security/advisories/GHSA-475x-2q3q-hvwq
- https://security.gentoo.org/glsa/202312-15
Provider assertions
3GitHub_M · cna
Integer overflow in `git archive`, `git log --format` leading to RCE in git
CISA-ADP · adp
CISA ADP Vulnrichment
CVE · adp
CVE Program Container
Provenance
- Schema
- 5.1
- Searchable
- yes
- Content hash
- c57cc4ee92ea3c1ec2c52a56c0eeaed50f53836592cdc6fb9a11db195fb07b31
- Ingested
- 23 Sep 2026, 08:02:45 UTC
- Source record
- Official CVE record