CyberSecBulletin
CVE-2024-32021NVD status: Analyzed

git: Use of Hard-coded, Security-relevant Constants

CVE-2024-32021 is a high-severity use of hard-coded, security-relevant constants vulnerability in git, with a CVSS 3.1 base score of 7.1 out of 10. It can be exploited with local access to the system by an unauthenticated attacker, but only if a user takes part, for example by opening a link or file. The record lists versions 2.39.4, 2.40.2, 2.41.1 as the first without the flaw, so updating git to one of those releases or later removes the exposure. There is no confirmed exploitation so far. EPSS estimates a 1.02% chance of exploitation within 30 days, higher than 64% of scored CVEs.

Next patch cycle

High severity with no evidence of exploitation so far.

What to do

  1. Update git to 2.39.4 or 2.40.2 or 2.41.1 or 2.42.2, whichever matches your release line, or a later version.
  2. Read the advisory on github.com for workarounds and exact fixed builds.
  3. Because the attack needs a user to take part, warn users about unexpected links and files related to this product until it is patched.

Affected products and versions

VendorProductAffected versionsFixed in
Gitgit= 2.45.0; = 2.44.0; >= 2.43.0, < 2.43.4; >= 2.42.0, < 2.42.2; = 2.41.0; >= 2.40.0, < 2.40.2; < 2.39.4; before 2.39.4; and 6 more ranges2.39.4, 2.40.2, 2.41.1, 2.42.2, 2.43.4, 2.44.1
Fedora ProjectFedora40Not stated
DebianDebian Linux10.0; 11.0Not stated

Version data comes from the organisation that assigned the CVE. Confirm against the vendor advisory before deciding you are unaffected.

How the severity score breaks down

Attack vector
LocalThe attacker needs local access or must trick a user into running something.
Attack complexity
LowNo special conditions are needed; the attack works reliably.
Privileges required
NoneNo account or login is needed.
User interaction
RequiredA user must take an action such as opening a file or link.
Scope
UnchangedImpact stays within the vulnerable component.
Confidentiality
HighAll data handled by the component can be read.
Integrity
HighData or code can be modified at will.
Availability
NoneAvailability is not affected.

Vector: CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:N. Scored by NVD.

Scoring systemScoreSeverityScored by
CVSS 3.13.9LowCNA (github.com)
CVSS 3.17.1HighNVD

Official description

Git is a revision control system. Prior to versions 2.45.1, 2.44.1, 2.43.4, 2.42.2, 2.41.1, 2.40.2, and 2.39.4, when cloning a local source repository that contains symlinks via the filesystem, Git may create hardlinks to arbitrary user-readable files on the same filesystem as the target repository in the `objects/` directory. Cloning a local repository over the filesystem may creating hardlinks to arbitrary user-owned files on the same filesystem in the target Git repository's `objects/` directory. When cloning a repository over the filesystem (without explicitly specifying the `file://` protocol or `--no-local`), the optimizations for local cloning will be used, which include attempting to hard link the object files instead of copying them. While the code includes checks against symbolic links in the source repository, which were added during the fix for CVE-2022-39253, these checks can still be raced because the hard link operation ultimately follows symlinks. If the object on the filesystem appears as a file during the check, and then a symlink during the operation, this will allow the adversary to bypass the check and create hardlinks in the destination objects directory to arbitrary, user-readable files. The problem has been patched in versions 2.45.1, 2.44.1, 2.43.4, 2.42.2, 2.41.1, 2.40.2, and 2.39.4.

Source: the CVE record as published by its numbering authority, via NVD and CVE.org.

The underlying weakness: Use of Hard-coded, Security-relevant Constants

The product uses hard-coded constants instead of symbolic names for security-critical values, which increases the likelihood of mistakes during code maintenance or security policy change.

How developers prevent this class of flaw

  • Avoid using hard-coded constants. Configuration files offer a more flexible solution.

More Use of Hard-coded, Security-relevant Constants vulnerabilities (CWE-547)

Timeline

  1. CVE record published.
  2. CISA published its SSVC assessment (exploitation: poc, automatable: no, technical impact: partial).
  3. Record last changed materially (score, affected products, status or references).

References

Third-party and government advisories

Other vulnerabilities in git

All git vulnerabilities

Spotted an error? Tell us.