Integer Overflow or Wraparound Affecting git/git package, versions [2.30.7,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,2.39.1)


Severity

Recommended
0.0
high
0
10

CVSS assessment made by Snyk's Security Team. Learn more

Threat Intelligence

EPSS
0.49% (76th percentile)

Do your applications use this vulnerable package?

In a few clicks we can analyze your entire application and see what components are vulnerable in your application, and suggest you quick fixes.

Test your applications
  • Snyk IDSNYK-UNMANAGED-GITGIT-3237235
  • published19 Jan 2023
  • disclosed17 Jan 2023
  • creditmarkusx41, joernchen

Introduced: 17 Jan 2023

CVE-2022-41903  (opens in a new tab)
CWE-190  (opens in a new tab)

How to fix?

Upgrade git/git to version 2.31.6, 2.32.5, 2.33.6, 2.34.6, 2.35.6, 2.36.4, 2.37.5, 2.38.3, 2.39.1 or higher.

Overview

Affected versions of this package are vulnerable to Integer Overflow or Wraparound when processing the padding operators (e.g., %<(, %<|(, %>(, %>>(, or %><( ), an integer overflow can occur in pretty.c::format_and_pad_commit()where asize_tis improperly stored as an int, and then added as an offset to a subsequentmemcpy()` call.

Workarounds

If users are not able to upgrade to the fixed version, it is recommended to disable git archive in untrusted repositories:

  1. If you expose git archive via git daemon, disable it by running git config --global daemon.uploadArch false.

  2. Avoid running git archive directly on untrusted repositories if you do not.

CVSS Scores

version 3.1