CVE-2022-41903 | Integer overflow in `git archive`, `git log --format` leading to RCE in 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`.

Published: 2023-01-17 Last update: 2024-11-21 Assigner: [email protected] Source: [email protected]

Conclusion & alert: CVE-2022-41903 is rated High Risk (67.9/100): CVSS Critical severity, with high exploitation likelihood (EPSS 17.80%, 95th percentile). Core evidence: EPSS ranks this CVE among the most likely to be exploited in the near term. Mandatory action: High exploitation likelihood—assess exposure and prioritize remediation.

Risk is dynamic; we continuously reassess and refresh what is shown on this page as upstream context changes.

Exploit prediction scoring system (EPSS) score for CVE-2022-41903

EPSS lead: Daily EPSS estimates relative likelihood of exploitation; percentile ranks this CVE among scored vulnerabilities (higher = more severe relative rank).

# Date Old EPSS score New EPSS score Delta (New - Old)
1 2026-05-22 22.42% 17.80% -4.62%
2 2026-04-09 25.73% 22.42% -3.31%
3 2026-02-23 25.73%

Full EPSS history (35 records total)

Common vulnerability scoring system (CVSS) metrics for CVE-2022-41903

CVSS metrics for this CVE.

Base score Version Severity Vector Exploitability Impact Score source
9.8 3.1 CRITICAL
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H Click to expand
Attack vector (AV:N)
Could be attacked over the internet or any normal routed network—not just someone sitting at the machine.
Attack complexity (AC:L)
Once they can reach the bug, pulling it off is straightforward—no weird race conditions or rare setup.
Privileges required (PR:N)
No account or special rights needed—anonymous or random user is enough.
User interaction (UI:N)
Nobody has to click “OK” or open a trap file; it can work without a victim helping.
Scope (S:U)
Damage stays in the same “trust bubble” as the broken component—no big spill into unrelated systems.
Confidentiality (C:H)
Serious risk that confidential data gets exposed in a big way.
Integrity (I:H)
They could widely tamper with or forge data—trust in the data is badly hurt.
Availability (A:H)
Could take the service down hard or make it unusable for people who depend on it.
3.9 5.9 [email protected]
9.8 3.1 CRITICAL
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H Click to expand
Attack vector (AV:N)
Could be attacked over the internet or any normal routed network—not just someone sitting at the machine.
Attack complexity (AC:L)
Once they can reach the bug, pulling it off is straightforward—no weird race conditions or rare setup.
Privileges required (PR:N)
No account or special rights needed—anonymous or random user is enough.
User interaction (UI:N)
Nobody has to click “OK” or open a trap file; it can work without a victim helping.
Scope (S:U)
Damage stays in the same “trust bubble” as the broken component—no big spill into unrelated systems.
Confidentiality (C:H)
Serious risk that confidential data gets exposed in a big way.
Integrity (I:H)
They could widely tamper with or forge data—trust in the data is badly hurt.
Availability (A:H)
Could take the service down hard or make it unusable for people who depend on it.
3.9 5.9 [email protected]

Weakness enumeration for CVE-2022-41903

OS Trackers for CVE-2022-41903

vendor priority summary link
alpine CVE-2022-41903: 1 source package rows (git); 58 state rows across 7 repos (3.17-main, 3.18-main, 3.19-main, 3.20-main, 3.21-main, 3.22-main, edge-main); fixed 7, open 51. https://security.alpinelinux.org/vuln/CVE-2022-41903
debian not yet assigned CVE-2022-41903 not yet assigned priority: Debian including 1 source packages (git), 5 status rows across 5 suites (bookworm, bullseye, forky, sid, trixie): resolved 5. https://security-tracker.debian.org/tracker/CVE-2022-41903
gentoo high CVE-2022-41903: 1 GLSA(s) (202312-15), 1 atom(s) (dev-vcs/git); latest impact high. https://bugs.gentoo.org/buglist.cgi?quicksearch=CVE-2022-41903
redhat high https://access.redhat.com/security/cve/CVE-2022-41903
suse high CVE-2022-41903 severity important: SUSE including 168 source package names (1.18-19.18:git-core-2.35.3-150300.10.21.1, 1.20-openssl:git-core-2.35.3-150300.10.21.1, …), 540 product×package rows across 75 product lines (Container bci/golang, Container bci/nodejs, … (75 product lines)): Fixed 462, Known Not Affected 78. https://www.suse.com/security/cve/CVE-2022-41903/
ubuntu medium CVE-2022-41903 medium priority: Ubuntu including 1 source packages (git), 8 status rows across 8 suites (bionic, focal, jammy, kinetic, lunar, trusty, upstream, xenial): released 7, needs-triage 1. https://ubuntu.com/security/CVE-2022-41903

Affected software / configurations for CVE-2022-41903

Vendor Product Version Raw CPE
git-scm git <= 2.30.6 cpe:2.3:a:git-scm:git:*:*:*:*:*:*:*:*
git-scm git >= 2.31.0, <= 2.31.5 cpe:2.3:a:git-scm:git:*:*:*:*:*:*:*:*
git-scm git >= 2.32.0, <= 2.32.4 cpe:2.3:a:git-scm:git:*:*:*:*:*:*:*:*
git-scm git >= 2.33.0, <= 2.33.5 cpe:2.3:a:git-scm:git:*:*:*:*:*:*:*:*
git-scm git >= 2.34.0, <= 2.34.5 cpe:2.3:a:git-scm:git:*:*:*:*:*:*:*:*
git-scm git >= 2.35.0, <= 2.35.5 cpe:2.3:a:git-scm:git:*:*:*:*:*:*:*:*
git-scm git >= 2.36.0, <= 2.36.3 cpe:2.3:a:git-scm:git:*:*:*:*:*:*:*:*
git-scm git >= 2.37.0, <= 2.37.4 cpe:2.3:a:git-scm:git:*:*:*:*:*:*:*:*
git-scm git >= 2.38.0, <= 2.38.2 cpe:2.3:a:git-scm:git:*:*:*:*:*:*:*:*
git-scm git 2.39.0 cpe:2.3:a:git-scm:git:2.39.0:*:*:*:*:*:*:*

References for CVE-2022-41903

cvelogic Threat Intelligence