CVE Vulnerabilities

CVE-2024-32002

Improper Link Resolution Before File Access ('Link Following')

Published: May 14, 2024 | Modified: Jun 26, 2024
CVSS 3.x
9
CRITICAL
Source:
NVD
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:C/C:H/I:H/A:H
CVSS 2.x
RedHat/V2
RedHat/V3
9 IMPORTANT
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:C/C:H/I:H/A:H
Ubuntu
MEDIUM

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, repositories with submodules can be crafted in a way that exploits a bug in Git whereby it can be fooled into writing files not into the submodules worktree but into a .git/ directory. This allows writing a hook that will be executed while the clone operation is still running, giving the user no opportunity to inspect the code that is being executed. 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. If symbolic link support is disabled in Git (e.g. via git config --global core.symlinks false), the described attack wont work. As always, it is best to avoid cloning repositories from untrusted sources.

Weakness

The product attempts to access a file based on the filename, but it does not properly prevent that filename from identifying a link or shortcut that resolves to an unintended resource.

Affected Software

Name Vendor Start Version End Version
Git Git * 2.39.4 (excluding)
Git Git 2.40.0 (including) 2.40.2 (excluding)
Git Git 2.42.0 (including) 2.42.2 (excluding)
Git Git 2.43.0 (including) 2.43.4 (excluding)
Git Git 2.41.0 (including) 2.41.0 (including)
Git Git 2.44.0 (including) 2.44.0 (including)
Git Git 2.45.0 (including) 2.45.0 (including)
Git Ubuntu devel *
Git Ubuntu esm-infra/bionic *
Git Ubuntu focal *
Git Ubuntu jammy *
Git Ubuntu mantic *
Git Ubuntu noble *
Git Ubuntu upstream *
Red Hat Enterprise Linux 8 RedHat git-0:2.43.5-1.el8_10 *
Red Hat Enterprise Linux 8.4 Advanced Mission Critical Update Support RedHat git-0:2.27.0-5.el8_4 *
Red Hat Enterprise Linux 8.4 Telecommunications Update Service RedHat git-0:2.27.0-5.el8_4 *
Red Hat Enterprise Linux 8.4 Update Services for SAP Solutions RedHat git-0:2.27.0-5.el8_4 *
Red Hat Enterprise Linux 8.6 Advanced Mission Critical Update Support RedHat git-0:2.31.8-3.el8_6 *
Red Hat Enterprise Linux 8.6 Telecommunications Update Service RedHat git-0:2.31.8-3.el8_6 *
Red Hat Enterprise Linux 8.6 Update Services for SAP Solutions RedHat git-0:2.31.8-3.el8_6 *
Red Hat Enterprise Linux 8.8 Extended Update Support RedHat git-0:2.39.5-1.el8_8 *
Red Hat Enterprise Linux 9 RedHat git-0:2.43.5-1.el9_4 *
Red Hat Enterprise Linux 9.0 Update Services for SAP Solutions RedHat git-0:2.31.1-6.el9_0 *
Red Hat Enterprise Linux 9.2 Extended Update Support RedHat git-0:2.39.5-1.el9_2 *

Potential Mitigations

  • Follow the principle of least privilege when assigning access rights to entities in a software system.
  • Denying access to a file can prevent an attacker from replacing that file with a link to a sensitive file. Ensure good compartmentalization in the system to provide protected areas that can be trusted.

References