CVE-2022-41903: git-scm git Integer Overflow or Wraparound
Vulnerability summary
CVE-2022-41903 is a critical (CVSS 9.8) Integer Overflow or Wraparound vulnerability in git-scm git. EPSS estimates a 44.27% chance of exploitation in the next 30 days, higher than 98.7% of scored vulnerabilities.
Advisory lineage
Upstream 0 · Downstream 20 · Related 10Timeline
- 17-01-2023PublishedVulnerability first disclosed.
- 10-03-2025Last modifiedVulnerability information updated.
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 metrics
7 scores · 7 sources · 1 version- OSV · AlpineEcosystem advisory · calculated9.8CriticalCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
- OSV · UbuntuEcosystem advisory · calculated9.8CriticalCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
- OSV · DebianEcosystem advisory · calculated9.8CriticalCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
- OSV · WolfiEcosystem advisory · calculated9.8CriticalCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
- OSV · ChainguardEcosystem advisory · calculated9.8CriticalCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
- NVDNIST9.8CriticalCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
EPSS trend
Probability
44.27%
Chance of exploitation in the next 30 days
Percentile
99%
Versus all other CVEs
30-day change
0.00 pp
From 44.27% on 18-09-2026
Known exploited
Compare KEV catalogsNot in any of the 3 tracked catalogs.
Public exploits
0 foundNo public exploits indexed.
Weaknesses
CWE · root causeAffected systems
Alpine1 product
- git≥ 2.31.0, < 2.32.5-r0 | ≥ 2.31.0, < 2.34.6-r0 | ≥ 2.31.0, < 2.36.4-r0 | ≥ 2.31.0, < 2.38.3-r0 | ≥ 2.31.0, < 2.39.1-r0
Chainguard1 product
- git< 2.39.1-r0
Debian1 product
- git< 1:2.39.1-0.1
Git1 product
- 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
Git-scm1 product
- git≤ 2.30.6 | ≥ 2.31.0, ≤ 2.31.5 | ≥ 2.32.0, ≤ 2.32.4 | ≥ 2.33.0, ≤ 2.33.5 | ≥ 2.34.0, ≤ 2.34.5 | ≥ 2.35.0, ≤ 2.35.5 | ≥ 2.36.0, ≤ 2.36.3 | ≥ 2.37.0, ≤ 2.37.4 | ≥ 2.38.0, ≤ 2.38.2 | 2.39.0
Ubuntu1 product
- git< 1:1.9.1-1ubuntu0.10+esm1 | < 1:2.7.4-0ubuntu1.10+esm4 | < 1:2.17.1-1ubuntu0.15 | < 1:2.25.1-1ubuntu3.8 | < 1:2.34.1-1ubuntu1.6
Wolfi1 product
- git< 2.39.1-r0
7 vendors · 7 products
References
15 links- github.com/git/git/security/advisories/GHSA-475x-2q3q-hvwqX Refsource CONFIRMREPORTAdvisoryThird Party Advisory
- github.com/git/git/commit/508386c6c5857b4faa2c3e491f422c98cc69ae76X Refsource MISCFIXPatchRelease NotesThird Party Advisory