Git up to 6.20170818 pretty.c format_and_pad_commit integer overflow

CVSS Meta Temp Score
CVSS is a standardized scoring system to determine possibilities of attacks. The Temp Score considers temporal factors like disclosure, exploit and countermeasures. The unique Meta Score calculates the average score of different sources to provide a normalized scoring system.
Current Exploit Price (≈)
Our analysts are monitoring exploit markets and are in contact with vulnerability brokers. The range indicates the observed or calculated exploit price to be seen on exploit markets. A good indicator to understand the monetary effort required for and the popularity of an attack.
CTI Interest Score
Our Cyber Threat Intelligence team is monitoring different web sites, mailing lists, exploit markets and social media networks. The CTI Interest Score identifies the interest of attackers and the security community for this specific vulnerability in real-time. A high score indicates an elevated risk to be targeted for this vulnerability.
8.4$0-$5k0.00

Summaryinfo

A vulnerability was found in Git and classified as critical. Affected is the function format_and_pad_commit of the file pretty.c. Executing a manipulation can lead to integer overflow. This vulnerability is handled as CVE-2022-41903. The attack can be executed remotely. There is not any exploit available. It is suggested to upgrade the affected component.

Detailsinfo

A vulnerability has been found in Git (Versioning Software) and classified as critical. This vulnerability affects the function format_and_pad_commit of the file pretty.c. The manipulation with an unknown input leads to a integer overflow vulnerability. The CWE definition for the vulnerability is CWE-190. The product performs a calculation that can produce an integer overflow or wraparound, when the logic assumes that the resulting value will always be larger than the original value. This can introduce other weaknesses when the calculation is used for resource management or execution control. As an impact it is known to affect confidentiality, integrity, and availability. CVE summarizes:

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

The weakness was released 01/18/2023 as GHSA-475x-2q3q-hvwq. The advisory is available at github.com. This vulnerability was named CVE-2022-41903 since 09/30/2022. Technical details are known, but there is no available exploit.

The vulnerability scanner Nessus provides a plugin with the ID 236669 (Alibaba Cloud Linux 3 : 0020: git (ALINUX3-SA-2023:0020)), which helps to determine the existence of the flaw in a target environment.

Upgrading to version 2023-01-17 eliminates this vulnerability. Applying the patch 508386c6c5857b4faa2c3e491f422c98cc69ae76 is able to eliminate this problem. The bugfix is ready for download at github.com. The best possible mitigation is suggested to be upgrading to the latest version. A possible mitigation has been published even before and not after the disclosure of the vulnerability.

The vulnerability is also documented in the vulnerability database at Tenable (236669). If you want to get best quality of vulnerability data, you may have to visit VulDB.

Productinfo

Type

Name

Version

License

Website

CPE 2.3info

CPE 2.2info

CVSSv4info

VulDB Vector: 🔍
VulDB Reliability: 🔍

CVSSv3info

VulDB Meta Base Score: 8.5
VulDB Meta Temp Score: 8.4

VulDB Base Score: 7.3
VulDB Temp Score: 7.0
VulDB Vector: 🔍
VulDB Reliability: 🔍

CNA Base Score: 9.8
CNA Vector (GitHub, Inc.): 🔍

CVSSv2info

AVACAuCIA
💳💳💳💳💳💳
💳💳💳💳💳💳
💳💳💳💳💳💳
VectorComplexityAuthenticationConfidentialityIntegrityAvailability
UnlockUnlockUnlockUnlockUnlockUnlock
UnlockUnlockUnlockUnlockUnlockUnlock
UnlockUnlockUnlockUnlockUnlockUnlock

VulDB Base Score: 🔍
VulDB Temp Score: 🔍
VulDB Reliability: 🔍

Exploitinginfo

Class: Integer overflow
CWE: CWE-190 / CWE-189
CAPEC: 🔍
ATT&CK: 🔍

Physical: No
Local: No
Remote: Yes

Availability: 🔍
Status: Not defined

EPSS Score: 🔍
EPSS Percentile: 🔍

Price Prediction: 🔍
Current Price Estimation: 🔍

0-DayUnlockUnlockUnlockUnlock
TodayUnlockUnlockUnlockUnlock

Nessus ID: 236669
Nessus Name: Alibaba Cloud Linux 3 : 0020: git (ALINUX3-SA-2023:0020)

Threat Intelligenceinfo

Interest: 🔍
Active Actors: 🔍
Active APT Groups: 🔍

Countermeasuresinfo

Recommended: Upgrade
Status: 🔍

0-Day Time: 🔍

Upgrade: Git 2023-01-17
Patch: 508386c6c5857b4faa2c3e491f422c98cc69ae76

Timelineinfo

09/30/2022 🔍
01/17/2023 +109 days 🔍
01/18/2023 +1 days 🔍
01/18/2023 +0 days 🔍
05/18/2025 +851 days 🔍

Sourcesinfo

Product: github.com

Advisory: GHSA-475x-2q3q-hvwq
Status: Confirmed

CVE: CVE-2022-41903 (🔍)
GCVE (CVE): GCVE-0-2022-41903
GCVE (VulDB): GCVE-100-218866

Entryinfo

Created: 01/18/2023 08:14
Updated: 05/18/2025 19:12
Changes: 01/18/2023 08:14 (52), 02/14/2023 19:43 (1), 05/18/2025 19:12 (18)
Complete: 🔍
Cache ID: 216::103

If you want to get best quality of vulnerability data, you may have to visit VulDB.

Discussion

No comments yet. Languages: en.

Please log in to comment.

Do you need the next level of professionalism?

Upgrade your account now!