Vulnerability · Published May 14, 2024 · Assigned by GitHub_M

CVE-2024-32021Local Git clone may hardlink arbitrary user-readable files into the new repository's "objects/" directory

Low 3.9

In plain English

A low-severity security flaw in git from git. Proof-of-concept exploit code is public. The chance it is exploited in the next 30 days is estimated at 1.0% (higher than 64% of all known vulnerabilities). Fixed versions are available - upgrade the affected package.

Severity (CVSS 3.1)3.9Low
Exploit odds (30 days)1.0%top 36.3% of all CVEs
Exploited in the wildNo reportsCISA SSVC: poc
Attack toolingNoneno public tooling known

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.

Affected packages & fixed versions

EcosystemPackageFixed inAdvisory
AlmaLinux:8git2.43.5-1.el8_10ALSA-2024:4084
AlmaLinux:9git2.43.5-1.el9_4ALSA-2024:4083
AlmaLinux:8git-all2.43.5-1.el8_10ALSA-2024:4084
AlmaLinux:9git-all2.43.5-1.el9_4ALSA-2024:4083
AlmaLinux:8git-core2.43.5-1.el8_10ALSA-2024:4084
AlmaLinux:9git-core2.43.5-1.el9_4ALSA-2024:4083
AlmaLinux:8git-core-doc2.43.5-1.el8_10ALSA-2024:4084
AlmaLinux:9git-core-doc2.43.5-1.el9_4ALSA-2024:4083
AlmaLinux:8git-credential-libsecret2.43.5-1.el8_10ALSA-2024:4084
AlmaLinux:9git-credential-libsecret2.43.5-1.el9_4ALSA-2024:4083
AlmaLinux:8git-daemon2.43.5-1.el8_10ALSA-2024:4084
AlmaLinux:9git-daemon2.43.5-1.el9_4ALSA-2024:4083
AlmaLinux:8git-email2.43.5-1.el8_10ALSA-2024:4084
AlmaLinux:9git-email2.43.5-1.el9_4ALSA-2024:4083
AlmaLinux:8git-gui2.43.5-1.el8_10ALSA-2024:4084
AlmaLinux:9git-gui2.43.5-1.el9_4ALSA-2024:4083
AlmaLinux:8git-instaweb2.43.5-1.el8_10ALSA-2024:4084
AlmaLinux:9git-instaweb2.43.5-1.el9_4ALSA-2024:4083
AlmaLinux:8git-subtree2.43.5-1.el8_10ALSA-2024:4084
AlmaLinux:9git-subtree2.43.5-1.el9_4ALSA-2024:4083
AlmaLinux:8git-svn2.43.5-1.el8_10ALSA-2024:4084
AlmaLinux:9git-svn2.43.5-1.el9_4ALSA-2024:4083
AlmaLinux:8gitk2.43.5-1.el8_10ALSA-2024:4084
AlmaLinux:9gitk2.43.5-1.el9_4ALSA-2024:4083
AlmaLinux:8gitweb2.43.5-1.el8_10ALSA-2024:4084
AlmaLinux:9gitweb2.43.5-1.el9_4ALSA-2024:4083
AlmaLinux:8perl-Git2.43.5-1.el8_10ALSA-2024:4084
AlmaLinux:9perl-Git2.43.5-1.el9_4ALSA-2024:4083
AlmaLinux:8perl-Git-SVN2.43.5-1.el8_10ALSA-2024:4084
AlmaLinux:9perl-Git-SVN2.43.5-1.el9_4ALSA-2024:4083
Alpine:v3.20git2.45.1-r0ALPINE-CVE-2024-32021
Alpine:v3.21git2.45.1-r0ALPINE-CVE-2024-32021
Alpine:v3.22git2.45.1-r0ALPINE-CVE-2024-32021
Alpine:v3.23git2.45.1-r0ALPINE-CVE-2024-32021
Alpine:v3.24git2.45.1-r0ALPINE-CVE-2024-32021
Debian:12git1:2.39.5-0+deb12u1DEBIAN-CVE-2024-32021
Debian:12git1:2.39.5-0+deb12u1DSA-5769-1
Debian:13git1:2.45.1-1DEBIAN-CVE-2024-32021
Debian:14git1:2.45.1-1DEBIAN-CVE-2024-32021
Rocky Linux:8git0:2.43.5-1.el8_10RLSA-2024:4084
Rocky Linux:9git0:2.43.5-1.el9_4RLSA-2024:4083
Ubuntu:22.04:LTSgit1:2.34.1-1ubuntu1.11USN-6793-1
Ubuntu:22.04:LTSgit1:2.34.1-1ubuntu1.11UBUNTU-CVE-2024-32021
Ubuntu:24.04:LTSgit1:2.43.0-1ubuntu7.1USN-6793-1
Ubuntu:24.04:LTSgit1:2.43.0-1ubuntu7.1UBUNTU-CVE-2024-32021

Affected products (as reported)

VendorProductVersions
git git = 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

Weakness: CWE-547 · Vector: CVSS:3.1/AV:L/AC:H/PR:L/UI:R/S:C/C:N/I:L/A:L

References