CVE Vulnerabilities

CVE-2023-22490

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

Published: Feb 14, 2023 | Modified: Dec 27, 2023
CVSS 3.x
5.5
MEDIUM
Source:
NVD
CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:N/A:N
CVSS 2.x
RedHat/V2
RedHat/V3
5.5 MODERATE
CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:N/A:N
Ubuntu
MEDIUM

Git is a revision control system. Using a specially-crafted repository, Git prior to versions 2.39.2, 2.38.4, 2.37.6, 2.36.5, 2.35.7, 2.34.7, 2.33.7, 2.32.6, 2.31.7, and 2.30.8 can be tricked into using its local clone optimization even when using a non-local transport. Though Git will abort local clones whose source $GIT_DIR/objects directory contains symbolic links, the objects directory itself may still be a symbolic link. These two may be combined to include arbitrary files based on known paths on the victims filesystem within the malicious repositorys working copy, allowing for data exfiltration in a similar manner as CVE-2022-39253.

A fix has been prepared and will appear in v2.39.2 v2.38.4 v2.37.6 v2.36.5 v2.35.7 v2.34.7 v2.33.7 v2.32.6, v2.31.7 and v2.30.8. If upgrading is impractical, two short-term workarounds are available. Avoid cloning repositories from untrusted sources with --recurse-submodules. Instead, consider cloning repositories without recursively cloning their submodules, and instead run git submodule update at each layer. Before doing so, inspect each new .gitmodules file to ensure that it does not contain suspicious module URLs.

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-scm * 2.30.8 (excluding)
Git Git-scm 2.31.0 (including) 2.31.7 (excluding)
Git Git-scm 2.32.0 (including) 2.32.6 (excluding)
Git Git-scm 2.33.0 (including) 2.33.7 (excluding)
Git Git-scm 2.34.0 (including) 2.34.7 (excluding)
Git Git-scm 2.35.0 (including) 2.35.7 (excluding)
Git Git-scm 2.36.0 (including) 2.36.5 (excluding)
Git Git-scm 2.37.0 (including) 2.37.6 (excluding)
Git Git-scm 2.38.0 (including) 2.38.4 (excluding)
Git Git-scm 2.39.0 (including) 2.39.2 (excluding)
Git Ubuntu bionic *
Git Ubuntu devel *
Git Ubuntu esm-infra/xenial *
Git Ubuntu focal *
Git Ubuntu jammy *
Git Ubuntu kinetic *
Git Ubuntu lunar *
Git Ubuntu trusty *
Git Ubuntu xenial *
Red Hat Enterprise Linux 8 RedHat git-0:2.39.3-1.el8_8 *
Red Hat Enterprise Linux 8.6 Extended Update Support RedHat git-0:2.31.8-1.el8_6 *
Red Hat Enterprise Linux 9 RedHat git-0:2.39.3-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