
CVE catalog
CVE-2023-41040
GitPython vulnerabilities
- Severity
- Medium · CVSS 5.1
CVSS: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.
| Distribution | Package | Release | Version | Status |
|---|---|---|---|---|
| Debian | python-git | sid | 3.2.1-1 | fixed |
| Debian | python-git | forky | 3.2.1-1 | fixed |
| Debian | python-git | trixie | 3.1.44-1 | fixed |
| Debian | python-git | bookworm | 3.1.30-1+deb12u2 | fixed |
| Ubuntu | python-git | noble | 3.1.37-3ubuntu0.1~esm2 | fixed |
| Ubuntu | python-git-doc | noble | 3.1.37-3ubuntu0.1~esm2 | fixed |
| Ubuntu | python3-git | noble | 3.1.37-3ubuntu0.1~esm2 | fixed |
| PyPI | gitpython | Not reported | 3.1.37 | fixed |
| PyPI | gitpython | Not reported | 3.1.35 | fixed |
| Ubuntu | python-git | pro | 3.1.44-1 | vulnerable |
| Ubuntu | python-git | pro | 3.1.45-1 | vulnerable |
| Ubuntu | python-git | pro | 3.1.46-1 | vulnerable |
| Ubuntu | python-git | pro | 3.1.46-1ubuntu0.1~esm1 | fixed |
| Ubuntu | python-git | pro | 3.1.14-1 | vulnerable |
| Ubuntu | python-git | pro | 3.1.23-1 | vulnerable |
| Ubuntu | python-git | pro | 3.1.24-1 | vulnerable |
| Ubuntu | python-git | pro | 3.1.24-1ubuntu0.1~esm1 | vulnerable |
| Ubuntu | python-git | pro | 3.1.24-1ubuntu0.1~esm2 | vulnerable |
| Ubuntu | python-git | pro | 3.1.24-1ubuntu0.1~esm3 | fixed |
| Suse | python-GitPython | package hub 15 sp4 | 3.1.12.1610074031.f653af66-bp154.2.3.1 | fixed |
| Opensuse | python-GitPython | leap 15.4 | 3.1.12.1610074031.f653af66-bp154.2.3.1 | fixed |
| Suse | python-GitPython | package hub 15 sp5 | 3.1.12.1610074031.f653af66-bp155.3.3.1 | fixed |
| Opensuse | python-GitPython | leap 15.5 | 3.1.12.1610074031.f653af66-bp155.3.3.1 | fixed |
Fixed-version evidence
| Distribution | Package | Type | Release | Fixed version | Urgency | Origin | Bugs |
|---|---|---|---|---|---|---|---|
| Debian | python-git | source | sid | 3.1.36-1 | not yet assigned | Not reported | Not reported |
| Debian | python-git | source | forky | 3.1.36-1 | not yet assigned | Not reported | Not reported |
| Debian | python-git | source | trixie | 3.1.36-1 | not yet assigned | Not reported | Not reported |
| Debian | python-git | source | bookworm | 3.1.30-1+deb12u2 | not yet assigned | Not reported | Not reported |
| Ubuntu | python-git | deb | noble | 3.1.37-3ubuntu0.1~esm2 | Not reported | Not reported | Not reported |
| Ubuntu | python-git-doc | deb | noble | 3.1.37-3ubuntu0.1~esm2 | Not reported | Not reported | Not reported |
| Ubuntu | python3-git | deb | noble | 3.1.37-3ubuntu0.1~esm2 | Not reported | Not reported | Not reported |
| PyPI | gitpython | PyPI | Not reported | 3.1.37 | Not reported | GHSA-CWVM-V4W8-Q58C | Not reported |
| PyPI | gitpython | PyPI | Not reported | 3.1.35 | Not reported | PYSEC-2023-165 | Not reported |
| Ubuntu | python-git | deb | pro | 3.1.46-1ubuntu0.1~esm1 | Not reported | USN-8303-1 | Not reported |
| Ubuntu | python-git | deb | pro | 3.1.24-1ubuntu0.1~esm3 | Not reported | UBUNTU-CVE-2023-41040 | Not reported |
| Suse | python-GitPython | rpm | package hub 15 sp4 | 3.1.12.1610074031.f653af66-bp154.2.3.1 | Not reported | OPENSUSE-SU-2023:0271-1 | Not reported |
| Opensuse | python-GitPython | rpm | leap 15.4 | 3.1.12.1610074031.f653af66-bp154.2.3.1 | Not reported | OPENSUSE-SU-2023:0271-1 | Not reported |
| Suse | python-GitPython | rpm | package hub 15 sp5 | 3.1.12.1610074031.f653af66-bp155.3.3.1 | Not reported | OPENSUSE-SU-2023:0259-1 | Not reported |
| Opensuse | python-GitPython | rpm | leap 15.5 | 3.1.12.1610074031.f653af66-bp155.3.3.1 | Not reported | OPENSUSE-SU-2023:0259-1 | Not reported |
OpenFactory catalog packages
Matching against OpenFactory catalog package versions is in progress.
References
- [https://ftp.suse.com/pub/projects/security/csaf/opensuse-su-2026_11419-1.json]
- [https://osv.dev/vulnerability/DEBIAN-CVE-2023-41040]
- [https://osv.dev/vulnerability/DLA-3589-1]
- [https://osv.dev/vulnerability/PYSEC-2023-165]
- [https://osv.dev/vulnerability/UBUNTU-CVE-2023-41040]
- [https://osv.dev/vulnerability/USN-8303-1]
- [https://osv.dev/vulnerability/openSUSE-SU-2023:0259-1]
- [https://osv.dev/vulnerability/openSUSE-SU-2023:0271-1]
- [https://security-tracker.debian.org/tracker/CVE-2023-41040]
- [https://security.access.redhat.com/data/csaf/v2/vex/2023/cve-2023-41040.json]
- [https://ubuntu.com/security/notices/USN-8303-1]
- [https://wid.cert-bund.de/.well-known/csaf/white/2023/wid-sec-w-2023-2428.json]
[CERT-Bund public advisories] · [Debian Security Tracker] · [FIRST EPSS] · [OSV Package Vulnerability Database] · [Red Hat security advisories and VEX] · [SUSE security advisories and VEX] · [Ubuntu Security Notices (USN)]