CVE-2023-22490 Git vulnerable to local clone-based data exfiltration with non-local transports
Attackers can exfiltrate arbitrary local files by tricking Git into using local clone optimizations with symbolic links in malicious repositories.
- Exploited in the wild
- Not known
- Login needed
- Not needed
- Attackable
- Local or same network only
- Victim action needed
- A user has to click or open something
- Fix
- Available
What is CVE-2023-22490?
CVE-2023-22490 is a medium-severity path traversal vulnerability in git, published on 14 Feb 2023. It can only be exploited from the same machine or local network, and only if a user opens a file or follows a link.
Official description
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 victim's filesystem within the malicious repository's 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: CWE-59
Which versions are affected by CVE-2023-22490?
It affects 1 product.
Products include Git-Scm Git.
How do I fix CVE-2023-22490?
Upgrade to a fixed version.
Upgrade, and resolve every user-supplied path against an allowed base folder before opening it. More about Path traversal.
Is CVE-2023-22490 being exploited?
There is no known exploitation of CVE-2023-22490 in the wild and no public exploit code.
Public exploit code: 1 proofs of concept on GitHub.
Other vulnerabilities in git
Sources
Also known as ALPINE-CVE-2023-22490, CLEANSTART-2026-YR55229, DEBIAN-CVE-2023-22490, UBUNTU-CVE-2023-22490, USN-5871-2.