9.8

CVE-2022-41903: git-scm git Integer Overflow or Wraparound

CVSS: 9.8v3.1CriticalModified
AliasesALPINE-CVE-2022-41903UBUNTU-CVE-2022-41903DEBIAN-CVE-2022-41903
Published 17-01-2023Last modified 10-03-2025

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.

Overall risk
70/100
0100
High · default modelHow is this calculated?
CVSS score
9.8/10
010
Critical · v3.1 (CVE.org)
EPSS score
44.27%
0%100%
High · 0.00 pp in 30 days
KEVNot listedIn no KEV catalog
RansomwareNone recordedNo known use recorded
Public exploits0No public exploits recorded

Advisory lineage

Upstream 0 · Downstream 20 · Related 10

Timeline

  1. 17-01-2023
    PublishedVulnerability first disclosed.
  2. 10-03-2025
    Last 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

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

18-09-202618-10-2026
EPSS score
44.27%

Known exploited

Compare KEV catalogs

Not in any of the 3 tracked catalogs.

Public exploits

0 found

No public exploits indexed.

Weaknesses

CWE · root cause

Affected 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
Show all 15 references