CVE-2022-41903

Integer overflow in `git archive`, `git log --format` leading to RCE in git

CVE-2022-41903 is fixed in 28 products on 2 platforms, first by Git 2.39.0.2, released December 12, 2022. It is not reported as exploited. Patch Radar priority: High.

HighFixed on 2 platforms
CVSS
9.8
Important
Exploitation
None reported
No vendor assessment
CISA KEV
Not listed
Not in the Known Exploited Vulnerabilities catalog
EPSS
0.4427
98th percentile

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`.

Where it's fixed

ProductFixed inFixReleased
Windows apps
Git 2.39.0.2 Git 2.39.0.2 Dec 12, 2022
Linux
git · Debian 12.15 (bookworm) 1:2.39.1-0.1 DEBIAN-CVE-2022-41903 Jan 17, 2023
git · Debian 13.5 (trixie) 1:2.39.1-0.1 DEBIAN-CVE-2022-41903 Jan 17, 2023
git · Debian 14 1:2.39.1-0.1 DEBIAN-CVE-2022-41903 Jan 17, 2023
git · RHEL 8 0:2.31.1-3.el8_7 RHSA-2023:0610 Feb 6, 2023
git · RHEL 9 0:2.31.1-3.el9_1 RHSA-2023:0611 Feb 6, 2023
git · Ubuntu 18.04.6 LTS (bionic) 1:2.17.1-1ubuntu0.15 git 1:2.17.1-1ubuntu0.15 Jan 17, 2023
git · Ubuntu 20.04 LTS (focal) 1:2.25.1-1ubuntu3.8 git 1:2.25.1-1ubuntu3.8 Jan 17, 2023
git · Ubuntu 22.04.1 LTS (jammy) 1:2.34.1-1ubuntu1.6 git 1:2.34.1-1ubuntu1.6 Jan 17, 2023
git · almalinux 8 2.31.1-3.el8_7 ALSA-2023:0610 Feb 6, 2023
git · almalinux 9 2.31.1-3.el9_1 ALSA-2023:0611 Feb 6, 2023
git · amzn 2023 2.39.1-1.amzn2023.0.2 ALAS2023-2023-065 Feb 17, 2023
git · ol 8 0:2.31.1-3.el8_7 ELSA-2023-0610 Feb 7, 2023
git · ol 9 0:2.31.1-3.el9_1 ELSA-2023-0611 Feb 7, 2023
git · rocky 8 0:2.31.1-3.el8_7 RLSA-2023:0610 Feb 6, 2023
git · rocky 9 0:2.31.1-3.el9_1 RLSA-2023:0611 Feb 6, 2023
git-all · RHEL 8 0:2.31.1-3.el8_7 RHSA-2023:0610 Feb 6, 2023
git-all · RHEL 9 0:2.31.1-3.el9_1 RHSA-2023:0611 Feb 6, 2023
git-all · Ubuntu 18.04.6 LTS (bionic) 1:2.17.1-1ubuntu0.15 git-all 1:2.17.1-1ubuntu0.15 Jan 17, 2023
git-all · Ubuntu 20.04 LTS (focal) 1:2.25.1-1ubuntu3.8 git-all 1:2.25.1-1ubuntu3.8 Jan 17, 2023
git-all · Ubuntu 22.04.1 LTS (jammy) 1:2.34.1-1ubuntu1.6 git-all 1:2.34.1-1ubuntu1.6 Jan 17, 2023
git-all · almalinux 8 2.31.1-3.el8_7 ALSA-2023:0610 Feb 6, 2023
git-all · almalinux 9 2.31.1-3.el9_1 ALSA-2023:0611 Feb 6, 2023
git-all · amzn 2023 2.39.1-1.amzn2023.0.2 ALAS2023-2023-065 Feb 17, 2023
git-all · ol 8 0:2.31.1-3.el8_7 ELSA-2023-0610 Feb 7, 2023
git-all · ol 9 0:2.31.1-3.el9_1 ELSA-2023-0611 Feb 7, 2023
git-core · RHEL 8 0:2.31.1-3.el8_7 RHSA-2023:0610 Feb 6, 2023
git-core · RHEL 9 0:2.31.1-3.el9_1 RHSA-2023:0611 Feb 6, 2023
git-core · almalinux 8 2.31.1-3.el8_7 ALSA-2023:0610 Feb 6, 2023
git-core · almalinux 9 2.31.1-3.el9_1 ALSA-2023:0611 Feb 6, 2023
git-core · amzn 2023 2.39.1-1.amzn2023.0.2 ALAS2023-2023-065 Feb 17, 2023
git-core · ol 8 0:2.31.1-3.el8_7 ELSA-2023-0610 Feb 7, 2023
git-core · ol 9 0:2.31.1-3.el9_1 ELSA-2023-0611 Feb 7, 2023
git-core-debuginfo · amzn 2023 2.39.1-1.amzn2023.0.2 ALAS2023-2023-065 Feb 17, 2023
git-core-doc · RHEL 8 0:2.31.1-3.el8_7 RHSA-2023:0610 Feb 6, 2023
git-core-doc · RHEL 9 0:2.31.1-3.el9_1 RHSA-2023:0611 Feb 6, 2023
git-core-doc · almalinux 8 2.31.1-3.el8_7 ALSA-2023:0610 Feb 6, 2023
git-core-doc · almalinux 9 2.31.1-3.el9_1 ALSA-2023:0611 Feb 6, 2023
git-core-doc · amzn 2023 2.39.1-1.amzn2023.0.2 ALAS2023-2023-065 Feb 17, 2023
git-core-doc · ol 8 0:2.31.1-3.el8_7 ELSA-2023-0610 Feb 7, 2023
git-core-doc · ol 9 0:2.31.1-3.el9_1 ELSA-2023-0611 Feb 7, 2023
git-credential-libsecret · RHEL 8 0:2.31.1-3.el8_7 RHSA-2023:0610 Feb 6, 2023
git-credential-libsecret · RHEL 9 0:2.31.1-3.el9_1 RHSA-2023:0611 Feb 6, 2023
git-credential-libsecret · almalinux 8 2.31.1-3.el8_7 ALSA-2023:0610 Feb 6, 2023
git-credential-libsecret · almalinux 9 2.31.1-3.el9_1 ALSA-2023:0611 Feb 6, 2023
git-credential-libsecret · amzn 2023 2.39.1-1.amzn2023.0.2 ALAS2023-2023-065 Feb 17, 2023
git-credential-libsecret · ol 8 0:2.31.1-3.el8_7 ELSA-2023-0610 Feb 7, 2023
git-credential-libsecret · ol 9 0:2.31.1-3.el9_1 ELSA-2023-0611 Feb 7, 2023
git-credential-libsecret-debuginfo · amzn 2023 2.39.1-1.amzn2023.0.2 ALAS2023-2023-065 Feb 17, 2023
git-cvs · Ubuntu 18.04.6 LTS (bionic) 1:2.17.1-1ubuntu0.15 git-cvs 1:2.17.1-1ubuntu0.15 Jan 17, 2023
git-cvs · Ubuntu 20.04 LTS (focal) 1:2.25.1-1ubuntu3.8 git-cvs 1:2.25.1-1ubuntu3.8 Jan 17, 2023
git-cvs · Ubuntu 22.04.1 LTS (jammy) 1:2.34.1-1ubuntu1.6 git-cvs 1:2.34.1-1ubuntu1.6 Jan 17, 2023
git-cvs · amzn 2023 2.39.1-1.amzn2023.0.2 ALAS2023-2023-065 Feb 17, 2023
git-daemon · RHEL 8 0:2.31.1-3.el8_7 RHSA-2023:0610 Feb 6, 2023
git-daemon · RHEL 9 0:2.31.1-3.el9_1 RHSA-2023:0611 Feb 6, 2023
git-daemon · almalinux 8 2.31.1-3.el8_7 ALSA-2023:0610 Feb 6, 2023
git-daemon · almalinux 9 2.31.1-3.el9_1 ALSA-2023:0611 Feb 6, 2023
git-daemon · amzn 2023 2.39.1-1.amzn2023.0.2 ALAS2023-2023-065 Feb 17, 2023
git-daemon · ol 8 0:2.31.1-3.el8_7 ELSA-2023-0610 Feb 7, 2023
git-daemon · ol 9 0:2.31.1-3.el9_1 ELSA-2023-0611 Feb 7, 2023
git-daemon-debuginfo · amzn 2023 2.39.1-1.amzn2023.0.2 ALAS2023-2023-065 Feb 17, 2023
git-daemon-run · Ubuntu 18.04.6 LTS (bionic) 1:2.17.1-1ubuntu0.15 git-daemon-run 1:2.17.1-1ubuntu0.15 Jan 17, 2023
git-daemon-run · Ubuntu 20.04 LTS (focal) 1:2.25.1-1ubuntu3.8 git-daemon-run 1:2.25.1-1ubuntu3.8 Jan 17, 2023
git-daemon-run · Ubuntu 22.04.1 LTS (jammy) 1:2.34.1-1ubuntu1.6 git-daemon-run 1:2.34.1-1ubuntu1.6 Jan 17, 2023
git-daemon-sysvinit · Ubuntu 18.04.6 LTS (bionic) 1:2.17.1-1ubuntu0.15 git-daemon-sysvinit 1:2.17.1-1ubuntu0.15 Jan 17, 2023
git-daemon-sysvinit · Ubuntu 20.04 LTS (focal) 1:2.25.1-1ubuntu3.8 git-daemon-sysvinit 1:2.25.1-1ubuntu3.8 Jan 17, 2023
git-daemon-sysvinit · Ubuntu 22.04.1 LTS (jammy) 1:2.34.1-1ubuntu1.6 git-daemon-sysvinit 1:2.34.1-1ubuntu1.6 Jan 17, 2023
git-debuginfo · amzn 2023 2.39.1-1.amzn2023.0.2 ALAS2023-2023-065 Feb 17, 2023
git-debugsource · amzn 2023 2.39.1-1.amzn2023.0.2 ALAS2023-2023-065 Feb 17, 2023
git-el · Ubuntu 18.04.6 LTS (bionic) 1:2.17.1-1ubuntu0.15 git-el 1:2.17.1-1ubuntu0.15 Jan 17, 2023
git-el · Ubuntu 20.04 LTS (focal) 1:2.25.1-1ubuntu3.8 git-el 1:2.25.1-1ubuntu3.8 Jan 17, 2023
git-email · RHEL 8 0:2.31.1-3.el8_7 RHSA-2023:0610 Feb 6, 2023
git-email · RHEL 9 0:2.31.1-3.el9_1 RHSA-2023:0611 Feb 6, 2023
git-email · Ubuntu 18.04.6 LTS (bionic) 1:2.17.1-1ubuntu0.15 git-email 1:2.17.1-1ubuntu0.15 Jan 17, 2023
git-email · Ubuntu 20.04 LTS (focal) 1:2.25.1-1ubuntu3.8 git-email 1:2.25.1-1ubuntu3.8 Jan 17, 2023
git-email · Ubuntu 22.04.1 LTS (jammy) 1:2.34.1-1ubuntu1.6 git-email 1:2.34.1-1ubuntu1.6 Jan 17, 2023
git-email · almalinux 8 2.31.1-3.el8_7 ALSA-2023:0610 Feb 6, 2023
git-email · almalinux 9 2.31.1-3.el9_1 ALSA-2023:0611 Feb 6, 2023
git-email · amzn 2023 2.39.1-1.amzn2023.0.2 ALAS2023-2023-065 Feb 17, 2023
git-email · ol 8 0:2.31.1-3.el8_7 ELSA-2023-0610 Feb 7, 2023
git-email · ol 9 0:2.31.1-3.el9_1 ELSA-2023-0611 Feb 7, 2023
git-gui · RHEL 8 0:2.31.1-3.el8_7 RHSA-2023:0610 Feb 6, 2023
git-gui · RHEL 9 0:2.31.1-3.el9_1 RHSA-2023:0611 Feb 6, 2023
git-gui · Ubuntu 18.04.6 LTS (bionic) 1:2.17.1-1ubuntu0.15 git-gui 1:2.17.1-1ubuntu0.15 Jan 17, 2023
git-gui · Ubuntu 20.04 LTS (focal) 1:2.25.1-1ubuntu3.8 git-gui 1:2.25.1-1ubuntu3.8 Jan 17, 2023
git-gui · Ubuntu 22.04.1 LTS (jammy) 1:2.34.1-1ubuntu1.6 git-gui 1:2.34.1-1ubuntu1.6 Jan 17, 2023
git-gui · almalinux 8 2.31.1-3.el8_7 ALSA-2023:0610 Feb 6, 2023
git-gui · almalinux 9 2.31.1-3.el9_1 ALSA-2023:0611 Feb 6, 2023
git-gui · amzn 2023 2.39.1-1.amzn2023.0.2 ALAS2023-2023-065 Feb 17, 2023
git-gui · ol 8 0:2.31.1-3.el8_7 ELSA-2023-0610 Feb 7, 2023
git-gui · ol 9 0:2.31.1-3.el9_1 ELSA-2023-0611 Feb 7, 2023
git-instaweb · RHEL 8 0:2.31.1-3.el8_7 RHSA-2023:0610 Feb 6, 2023
git-instaweb · RHEL 9 0:2.31.1-3.el9_1 RHSA-2023:0611 Feb 6, 2023
git-instaweb · almalinux 8 2.31.1-3.el8_7 ALSA-2023:0610 Feb 6, 2023
git-instaweb · almalinux 9 2.31.1-3.el9_1 ALSA-2023:0611 Feb 6, 2023
git-instaweb · amzn 2023 2.39.1-1.amzn2023.0.2 ALAS2023-2023-065 Feb 17, 2023
git-instaweb · ol 8 0:2.31.1-3.el8_7 ELSA-2023-0610 Feb 7, 2023
git-instaweb · ol 9 0:2.31.1-3.el9_1 ELSA-2023-0611 Feb 7, 2023
git-man · Ubuntu 18.04.6 LTS (bionic) 1:2.17.1-1ubuntu0.15 git-man 1:2.17.1-1ubuntu0.15 Jan 17, 2023
git-man · Ubuntu 20.04 LTS (focal) 1:2.25.1-1ubuntu3.8 git-man 1:2.25.1-1ubuntu3.8 Jan 17, 2023
git-man · Ubuntu 22.04.1 LTS (jammy) 1:2.34.1-1ubuntu1.6 git-man 1:2.34.1-1ubuntu1.6 Jan 17, 2023
git-mediawiki · Ubuntu 18.04.6 LTS (bionic) 1:2.17.1-1ubuntu0.15 git-mediawiki 1:2.17.1-1ubuntu0.15 Jan 17, 2023
git-mediawiki · Ubuntu 20.04 LTS (focal) 1:2.25.1-1ubuntu3.8 git-mediawiki 1:2.25.1-1ubuntu3.8 Jan 17, 2023
git-mediawiki · Ubuntu 22.04.1 LTS (jammy) 1:2.34.1-1ubuntu1.6 git-mediawiki 1:2.34.1-1ubuntu1.6 Jan 17, 2023
git-p4 · amzn 2023 2.39.1-1.amzn2023.0.2 ALAS2023-2023-065 Feb 17, 2023
git-subtree · RHEL 8 0:2.31.1-3.el8_7 RHSA-2023:0610 Feb 6, 2023
git-subtree · RHEL 9 0:2.31.1-3.el9_1 RHSA-2023:0611 Feb 6, 2023
git-subtree · almalinux 8 2.31.1-3.el8_7 ALSA-2023:0610 Feb 6, 2023
git-subtree · almalinux 9 2.31.1-3.el9_1 ALSA-2023:0611 Feb 6, 2023
git-subtree · amzn 2023 2.39.1-1.amzn2023.0.2 ALAS2023-2023-065 Feb 17, 2023
git-subtree · ol 8 0:2.31.1-3.el8_7 ELSA-2023-0610 Feb 7, 2023
git-subtree · ol 9 0:2.31.1-3.el9_1 ELSA-2023-0611 Feb 7, 2023
git-svn · RHEL 8 0:2.31.1-3.el8_7 RHSA-2023:0610 Feb 6, 2023
git-svn · RHEL 9 0:2.31.1-3.el9_1 RHSA-2023:0611 Feb 6, 2023
git-svn · Ubuntu 18.04.6 LTS (bionic) 1:2.17.1-1ubuntu0.15 git-svn 1:2.17.1-1ubuntu0.15 Jan 17, 2023
git-svn · Ubuntu 20.04 LTS (focal) 1:2.25.1-1ubuntu3.8 git-svn 1:2.25.1-1ubuntu3.8 Jan 17, 2023
git-svn · Ubuntu 22.04.1 LTS (jammy) 1:2.34.1-1ubuntu1.6 git-svn 1:2.34.1-1ubuntu1.6 Jan 17, 2023
git-svn · almalinux 8 2.31.1-3.el8_7 ALSA-2023:0610 Feb 6, 2023
git-svn · almalinux 9 2.31.1-3.el9_1 ALSA-2023:0611 Feb 6, 2023
git-svn · amzn 2023 2.39.1-1.amzn2023.0.2 ALAS2023-2023-065 Feb 17, 2023
git-svn · ol 8 0:2.31.1-3.el8_7 ELSA-2023-0610 Feb 7, 2023
git-svn · ol 9 0:2.31.1-3.el9_1 ELSA-2023-0611 Feb 7, 2023
gitk · RHEL 8 0:2.31.1-3.el8_7 RHSA-2023:0610 Feb 6, 2023
gitk · RHEL 9 0:2.31.1-3.el9_1 RHSA-2023:0611 Feb 6, 2023
gitk · Ubuntu 18.04.6 LTS (bionic) 1:2.17.1-1ubuntu0.15 gitk 1:2.17.1-1ubuntu0.15 Jan 17, 2023
gitk · Ubuntu 20.04 LTS (focal) 1:2.25.1-1ubuntu3.8 gitk 1:2.25.1-1ubuntu3.8 Jan 17, 2023
gitk · Ubuntu 22.04.1 LTS (jammy) 1:2.34.1-1ubuntu1.6 gitk 1:2.34.1-1ubuntu1.6 Jan 17, 2023
gitk · almalinux 8 2.31.1-3.el8_7 ALSA-2023:0610 Feb 6, 2023
gitk · almalinux 9 2.31.1-3.el9_1 ALSA-2023:0611 Feb 6, 2023
gitk · amzn 2023 2.39.1-1.amzn2023.0.2 ALAS2023-2023-065 Feb 17, 2023
gitk · ol 8 0:2.31.1-3.el8_7 ELSA-2023-0610 Feb 7, 2023
gitk · ol 9 0:2.31.1-3.el9_1 ELSA-2023-0611 Feb 7, 2023
gitweb · RHEL 8 0:2.31.1-3.el8_7 RHSA-2023:0610 Feb 6, 2023
gitweb · RHEL 9 0:2.31.1-3.el9_1 RHSA-2023:0611 Feb 6, 2023
gitweb · Ubuntu 18.04.6 LTS (bionic) 1:2.17.1-1ubuntu0.15 gitweb 1:2.17.1-1ubuntu0.15 Jan 17, 2023
gitweb · Ubuntu 20.04 LTS (focal) 1:2.25.1-1ubuntu3.8 gitweb 1:2.25.1-1ubuntu3.8 Jan 17, 2023
gitweb · Ubuntu 22.04.1 LTS (jammy) 1:2.34.1-1ubuntu1.6 gitweb 1:2.34.1-1ubuntu1.6 Jan 17, 2023
gitweb · almalinux 8 2.31.1-3.el8_7 ALSA-2023:0610 Feb 6, 2023
gitweb · almalinux 9 2.31.1-3.el9_1 ALSA-2023:0611 Feb 6, 2023
gitweb · amzn 2023 2.39.1-1.amzn2023.0.2 ALAS2023-2023-065 Feb 17, 2023
gitweb · ol 8 0:2.31.1-3.el8_7 ELSA-2023-0610 Feb 7, 2023
gitweb · ol 9 0:2.31.1-3.el9_1 ELSA-2023-0611 Feb 7, 2023
perl-Git · RHEL 8 0:2.31.1-3.el8_7 RHSA-2023:0610 Feb 6, 2023
perl-Git · RHEL 9 0:2.31.1-3.el9_1 RHSA-2023:0611 Feb 6, 2023
perl-Git · almalinux 8 2.31.1-3.el8_7 ALSA-2023:0610 Feb 6, 2023
perl-Git · almalinux 9 2.31.1-3.el9_1 ALSA-2023:0611 Feb 6, 2023
perl-Git · amzn 2023 2.39.1-1.amzn2023.0.2 ALAS2023-2023-065 Feb 17, 2023
perl-Git · ol 8 0:2.31.1-3.el8_7 ELSA-2023-0610 Feb 7, 2023
perl-Git · ol 9 0:2.31.1-3.el9_1 ELSA-2023-0611 Feb 7, 2023
perl-Git-SVN · RHEL 8 0:2.31.1-3.el8_7 RHSA-2023:0610 Feb 6, 2023
perl-Git-SVN · RHEL 9 0:2.31.1-3.el9_1 RHSA-2023:0611 Feb 6, 2023
perl-Git-SVN · almalinux 8 2.31.1-3.el8_7 ALSA-2023:0610 Feb 6, 2023
perl-Git-SVN · almalinux 9 2.31.1-3.el9_1 ALSA-2023:0611 Feb 6, 2023
perl-Git-SVN · amzn 2023 2.39.1-1.amzn2023.0.2 ALAS2023-2023-065 Feb 17, 2023
perl-Git-SVN · ol 8 0:2.31.1-3.el8_7 ELSA-2023-0610 Feb 7, 2023
perl-Git-SVN · ol 9 0:2.31.1-3.el9_1 ELSA-2023-0611 Feb 7, 2023

Patch Radar data is free to use with attribution. Terms and how to credit it.

Product names, logos and trademarks shown on Patch Radar belong to their respective owners. They are used only to identify the software each security fix applies to and to help readers find their platform. Their use does not imply any affiliation with, or endorsement by, those owners, and Patchblox is not affiliated with any of them.