PT-2023-4955 · Gitpython+4 · Gitpython+4

Stsewd

·

Published

2023-08-30

·

Updated

2026-05-26

·

CVE-2023-41040

CVSS v4.0

6.9

Medium

VectorAV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:L/VA:N/SC:N/SI:N/SA:N
Name of the Vulnerable Software and Affected Versions GitPython versions prior to 3.1.37
Description The issue is related to GitPython's handling of file paths when resolving git references. In some cases, the library reads files from the .git directory based on user-provided input without checking if the file is located outside the intended directory. This allows an attacker to make GitPython read any file from the system, potentially leading to a denial of service. The vulnerability is present in the symbolic.py file and is caused by the code joining the base directory with a user-given string without checking the final path.
Recommendations For versions prior to 3.1.37, update to version 3.1.37 or later to resolve the issue. As a temporary workaround, consider restricting access to the symbolic.py module or the affected API endpoints to minimize the risk of exploitation. Avoid using user-provided input for file paths without proper validation and sanitization.

Exploit

Fix

DoS

Path traversal

Weakness Enumeration

Related Identifiers

ALT-PU-2023-6832
ALT-PU-2023-8078
BDU:2023-05476
CVE-2023-41040
DLA-3589-1
DLA-3939-1
GHSA-CWVM-V4W8-Q58C
OESA-2023-1628
OPENSUSE-SU-2023:0259-1
OPENSUSE-SU-2023:0271-1
OPENSUSE-SU-2024:13207-1
PYSEC-2023-165
RHSA-2023:7851
RHSA-2024:0190
RHSA-2024:0215
RHSA-2024:0322
RHSA-2024:1640
USN-8303-1

Affected Products

Alt Linux
Astra Linux
Gitpython
Linuxmint
Red Os