CVE catalog

CVE-2023-41040

GitPython vulnerabilities

[CVE catalog]

Severity
Medium · CVSS 5.1CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:L
Published
Source
[NVD] · [CVE record]
EPSS
1.09% · Oct 25, 2026

GitPython is a python library used to interact with Git repositories. In order to resolve some git references, GitPython reads files from the `.git` directory, in some places the name of the file being read is provided by the user, GitPython doesn't check if this file is located outside the `.git` directory. This allows an attacker to make GitPython read any file from the system. This vulnerability is present in https://github.com/gitpython-developers/GitPython/blob/1c8310d7cae144f74a671cbe17e51f63a830adbf/git/refs/symbolic.py#L174-L175. That code joins the base directory with a user given string without checking if the final path is located outside the base directory. This vulnerability cannot be used to read the contents of files but could in theory be used to trigger a denial of service for the program. This issue has been addressed in version 3.1.37.

Vulnerable and fixed packages

Distribution-reported package versions and fixes. These do not depend on matching against the OpenFactory package catalog.

DistributionPackageReleaseVersionStatus
Debianpython-gitsid3.2.1-1fixed
Debianpython-gitforky3.2.1-1fixed
Debianpython-gittrixie3.1.44-1fixed
Debianpython-gitbookworm3.1.30-1+deb12u2fixed
Ubuntupython-gitnoble3.1.37-3ubuntu0.1~esm2fixed
Ubuntupython-git-docnoble3.1.37-3ubuntu0.1~esm2fixed
Ubuntupython3-gitnoble3.1.37-3ubuntu0.1~esm2fixed
PyPIgitpythonNot reported3.1.37fixed
PyPIgitpythonNot reported3.1.35fixed
Ubuntupython-gitpro3.1.44-1vulnerable
Ubuntupython-gitpro3.1.45-1vulnerable
Ubuntupython-gitpro3.1.46-1vulnerable
Ubuntupython-gitpro3.1.46-1ubuntu0.1~esm1fixed
Ubuntupython-gitpro3.1.14-1vulnerable
Ubuntupython-gitpro3.1.23-1vulnerable
Ubuntupython-gitpro3.1.24-1vulnerable
Ubuntupython-gitpro3.1.24-1ubuntu0.1~esm1vulnerable
Ubuntupython-gitpro3.1.24-1ubuntu0.1~esm2vulnerable
Ubuntupython-gitpro3.1.24-1ubuntu0.1~esm3fixed
Susepython-GitPythonpackage hub 15 sp43.1.12.1610074031.f653af66-bp154.2.3.1fixed
Opensusepython-GitPythonleap 15.43.1.12.1610074031.f653af66-bp154.2.3.1fixed
Susepython-GitPythonpackage hub 15 sp53.1.12.1610074031.f653af66-bp155.3.3.1fixed
Opensusepython-GitPythonleap 15.53.1.12.1610074031.f653af66-bp155.3.3.1fixed

Fixed-version evidence

DistributionPackageTypeReleaseFixed versionUrgencyOriginBugs
Debianpython-gitsourcesid3.1.36-1not yet assignedNot reportedNot reported
Debianpython-gitsourceforky3.1.36-1not yet assignedNot reportedNot reported
Debianpython-gitsourcetrixie3.1.36-1not yet assignedNot reportedNot reported
Debianpython-gitsourcebookworm3.1.30-1+deb12u2not yet assignedNot reportedNot reported
Ubuntupython-gitdebnoble3.1.37-3ubuntu0.1~esm2Not reportedNot reportedNot reported
Ubuntupython-git-docdebnoble3.1.37-3ubuntu0.1~esm2Not reportedNot reportedNot reported
Ubuntupython3-gitdebnoble3.1.37-3ubuntu0.1~esm2Not reportedNot reportedNot reported
PyPIgitpythonPyPINot reported3.1.37Not reportedGHSA-CWVM-V4W8-Q58CNot reported
PyPIgitpythonPyPINot reported3.1.35Not reportedPYSEC-2023-165Not reported
Ubuntupython-gitdebpro3.1.46-1ubuntu0.1~esm1Not reportedUSN-8303-1Not reported
Ubuntupython-gitdebpro3.1.24-1ubuntu0.1~esm3Not reportedUBUNTU-CVE-2023-41040Not reported
Susepython-GitPythonrpmpackage hub 15 sp43.1.12.1610074031.f653af66-bp154.2.3.1Not reportedOPENSUSE-SU-2023:0271-1Not reported
Opensusepython-GitPythonrpmleap 15.43.1.12.1610074031.f653af66-bp154.2.3.1Not reportedOPENSUSE-SU-2023:0271-1Not reported
Susepython-GitPythonrpmpackage hub 15 sp53.1.12.1610074031.f653af66-bp155.3.3.1Not reportedOPENSUSE-SU-2023:0259-1Not reported
Opensusepython-GitPythonrpmleap 15.53.1.12.1610074031.f653af66-bp155.3.3.1Not reportedOPENSUSE-SU-2023:0259-1Not reported

OpenFactory catalog packages

Matching against OpenFactory catalog package versions is in progress.

References