CVE-2022-41903CWE-190

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

Critical · published January 17, 2023

CVSS v3.1
9.8
EPSS
44%
Percentile
98.8
In the wild
Unconfirmed
What it is

🔥 An integer overflow in Git could let attackers execute arbitrary code with just a crafty command – no superheroes required! Think of it like a factory line where an oversized package gets misrouted; instead of fitting into the right slot, it causes chaos throughout the entire facility. Here, the mishandling of size limits can lead to unexpected (and unwanted) consequences in your system. An attacker could exploit this overflow, causing arbitrary code execution that could compromise your entire repository. This is like a sneaky intruder slipping into your workshop and taking control of the machinery, potentially leading to disastrous results for your code and systems. It’s absolutely devastating!

Put simply

Think of it like a factory line where an oversized package gets misrouted; instead of fitting into the right slot, it causes chaos throughout the entire facility. Here, the mishandling of size limits can lead to unexpected (and unwanted) consequences in your system. This vulnerability arises from `git log` and `git archive` mishandling `size_t` values as `int`, leading to integer overflows and allowing attackers to perform arbitrary heap writes. This could result in remote code execution if not swiftly mitigated.

What to do

An attacker could exploit this overflow, causing arbitrary code execution that could compromise your entire repository. This is like a sneaky intruder slipping into your workshop and taking control of the machinery, potentially leading to disastrous results for your code and systems. It’s absolutely devastating! Upgrade your Git to versions released after 2023-01-17, starting from v2.30.7. If an upgrade isn’t possible, be sure to disable `git archive` in untrusted repositories or run `git config --global daemon.uploadArch false` to protect your system. You've got this! Follow these steps to secure your Git environment and keep those intruders at bay! 🛡️

The record
Technical detail
CVSS v3.1
9.8 · CRITICAL
Vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
CVSS v4.0
Not supplied
EPSS
0.44268 · 98.8th percentile
Weakness
CWE-190 · Integer Overflow or Wraparound
Published
2023-01-17T22:17Z
EPSS history
Timeline
  • 17 JAN 22:17Z
    Integer overflow in `git archive`, `git log --format` leading to RCE in git
    cvelistv5