CVE-2023-23946 involves a path traversal flaw in Git's 'git apply' function, impacting versions before 2.39.2. Learn about the impact, mitigation, and update requirements.
This CVE involves a vulnerability in Git's
git apply
function, allowing an attacker to overwrite paths outside the working tree, impacting versions prior to 2.39.2.
Understanding CVE-2023-23946
This vulnerability in Git poses a risk of path traversal, potentially enabling an attacker to overwrite files beyond the intended scope by manipulating inputs in the
git apply
command.
What is CVE-2023-23946?
The CVE-2023-23946 vulnerability in Git involves improper limitation of a pathname to a restricted directory, leading to path traversal issues. In this scenario, a malicious actor could exploit this flaw to overwrite files outside the designated working tree using crafted input in the
git apply
function.
The Impact of CVE-2023-23946
The impact of this vulnerability is rated as moderate with a CVSS base score of 6.2. While the attack complexity is low and requires local access, the integrity impact is deemed high as unauthorized modifications can occur without compromising confidentiality or availability.
Technical Details of CVE-2023-23946
This section delves into the specifics of the vulnerability, including its description, affected systems, and exploitation mechanism.
Vulnerability Description
The vulnerability arises from Git not properly restricting pathname access within the working directory, leading to path traversal vulnerabilities that can be exploited through the
git apply
command.
Affected Systems and Versions
Git versions prior to 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 are affected by this vulnerability, potentially exposing them to malicious path traversal activities.
Exploitation Mechanism
By leveraging a crafted input in the
git apply
command, an attacker can trick the system into overwriting files located outside the intended working directory, enabling unauthorized modifications beyond the legitimate scope.
Mitigation and Prevention
To address CVE-2023-23946, it is crucial to take immediate steps to mitigate the risk and implement long-term security practices to safeguard against similar vulnerabilities in the future.
Immediate Steps to Take
As an immediate measure, users are advised to inspect patches before applying them using
git apply --stat
, especially avoiding applying patches that create symbolic links or attempt to write files beyond the intended working tree.
Long-Term Security Practices
Implementing secure coding practices, restricting access permissions, and conducting regular security assessments can help prevent and detect path traversal vulnerabilities like CVE-2023-23946.
Patching and Updates
Users are recommended to update their Git installations 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 or later to mitigate the CVE-2023-23946 vulnerability and prevent potential path traversal exploits.