← Vulnerability feed

Vulnerability record · CVE-2022-41903 · published 17 January 2023

CVE-2022-41903: Git-scm git integer overflow vulnerability

Git Scm · Git

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

9.8 CVSS 3.1 Critical EPSS 44% · top 1.3% CWE-190 · Integer overflow
9.8CVSS 3.1 base score
44%EPSS exploitation probability, 30 days
NoNot in CISA KEV
1Affected product versions listed by NVD
10References
17 Jun 2026Last modified by NVD

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

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

Affected products

1 vulnerable configurations from NVD's CPE data, grouped by vendor and product.

References

Track CVE-2022-41903 inside VULONE

Watch it alongside the ransomware crews, C2 infrastructure and forum chatter that reference it, query it through the API and pull it into your SIEM over TAXII.

Start free Open in platform

Related vulnerabilities

Same products first, then exploited flaws of the same weakness class.

8.0CVE-2025-48384Git config CRLF handling allows submodule path link-following code executionGit mishandles trailing carriage returns when writing config values, so a submodule path ending in CR is read back altered during submodule initializ…KEVEPSS 4.1%analysed9.8CVE-2022-23521Git gitattributes parsing integer overflow enables heap corruptionGit's gitattributes parser suffers multiple integer overflows when handling a huge number of path patterns, many attributes for one pattern, or very …EPSS 56%analysed9.8CVE-2014-9390Git clients execute commands via crafted .git/config on case-insensitive filesystemsGit, Mercurial, libgit2, JGit, EGit and Xcode mishandle crafted .git/config paths on Windows and OS X, allowing a remote repository to place a file t…EPSS 76%analysed9.8CVE-2019-1353Git-scm git vulnerabilityAn issue was found in Git before v2.24.1, v2.23.1, v2.22.2, v2.21.1, v2.20.2, v2.19.3, v2.18.2, v2.17.3, v2.16.6, v2.15.4, and v2.14.6. When running …EPSS 2.2%9.8CVE-2018-19486Git-scm git untrusted search path vulnerabilityGit before 2.19.2 on Linux and UNIX executes commands from the current working directory (as if '.' were at the end of $PATH) in certain cases involv…EPSS 4.1%9.8CVE-2018-17456Git recursive clone argument injection enables remote code executionGit versions before the fixed releases mishandle a .gitmodules URL field that begins with a '-' character during recursive 'git clone' of a superproj…EPSS 97%analysed9.8CVE-2016-2324Suse linux enterprise debuginfo memory buffer overflow vulnerabilityInteger overflow in Git before 2.7.4 allows remote attackers to execute arbitrary code via a (1) long filename or (2) many nested trees, which trigge…EPSS 18%9.8CVE-2016-2315Suse linux enterprise debuginfo memory buffer overflow vulnerabilityrevision.c in git before 2.7.4 uses an incorrect integer data type, which allows remote attackers to execute arbitrary code via a (1) long filename o…EPSS 17%

Source: NIST National Vulnerability Database (record CVE-2022-41903), CISA KEV, FIRST EPSS (scores of 2026-09-27). This page is refreshed as NVD updates the record.