CVE-2023-41040
published medium CVSS 3.1 · 4.0GitPython blind local file inclusion
Package status and fixes
| Distro / vendor | Release | Package / product | Publisher status | Fixed build | Source |
|---|---|---|---|---|---|
| gitpython-developers | — | GitPython< 3.1.37 | Affected | Not stated | GitHub_M |
| Alpine Linux | edge | py3-gitpython | Fixed | 3.1.37-r0 | Package fix record |
| Debian | bullseye | python-git | Advisory build | 3.1.14-1+deb11u1 | DLA-3939-1 |
| SUSE / openSUSE | openSUSE-Leap-15.4 | python3-GitPythonnoarch | Advisory build | 3.1.12.1610074031.f653af66-bp154.2.3.1 | OPENSUSE-SU-2023:0271-1 |
| Ubuntu | bionic | python-git | Advisory build | 2.1.8-1ubuntu0.1~esm4 | USN-8303-1 |
| Alpine Linux | v3.19 | py3-gitpython | Fixed | 3.1.37-r0 | Package fix record |
| Alpine Linux | v3.20 | py3-gitpython | Fixed | 3.1.37-r0 | Package fix record |
| Alpine Linux | v3.21 | py3-gitpython | Fixed | 3.1.37-r0 | Package fix record |
Show 33 more entries
| Distro / vendor | Release | Package / product | Publisher status | Fixed build | Source |
|---|---|---|---|---|---|
| Alpine Linux | v3.22 | py3-gitpython | Fixed | 3.1.37-r0 | Package fix record |
| Alpine Linux | v3.23 | py3-gitpython | Fixed | 3.1.37-r0 | Package fix record |
| Alpine Linux | v3.24 | py3-gitpython | Fixed | 3.1.37-r0 | Package fix record |
| Debian | buster | python-git | Advisory build | 2.1.11-1+deb10u2 | DLA-3589-1 |
| SUSE / openSUSE | openSUSE-Leap-15.5 | python3-GitPythonnoarch | Advisory build | 3.1.12.1610074031.f653af66-bp155.3.3.1 | OPENSUSE-SU-2023:0259-1 |
| SUSE / openSUSE | openSUSE-Tumbleweed | python310-GitPythonaarch64 | Advisory build | 3.1.34.1693646983.2a2ae77-1.1 | OPENSUSE-SU-2024:13207-1 |
| SUSE / openSUSE | openSUSE-Tumbleweed | python310-GitPythonppc64le | Advisory build | 3.1.34.1693646983.2a2ae77-1.1 | OPENSUSE-SU-2024:13207-1 |
| SUSE / openSUSE | openSUSE-Tumbleweed | python310-GitPythons390x | Advisory build | 3.1.34.1693646983.2a2ae77-1.1 | OPENSUSE-SU-2024:13207-1 |
| SUSE / openSUSE | openSUSE-Tumbleweed | python310-GitPythonx86_64 | Advisory build | 3.1.34.1693646983.2a2ae77-1.1 | OPENSUSE-SU-2024:13207-1 |
| SUSE / openSUSE | openSUSE-Tumbleweed | python311-GitPythonaarch64 | Advisory build | 3.1.34.1693646983.2a2ae77-1.1 | OPENSUSE-SU-2024:13207-1 |
| SUSE / openSUSE | openSUSE-Tumbleweed | python311-GitPythonppc64le | Advisory build | 3.1.34.1693646983.2a2ae77-1.1 | OPENSUSE-SU-2024:13207-1 |
| SUSE / openSUSE | openSUSE-Tumbleweed | python311-GitPythons390x | Advisory build | 3.1.34.1693646983.2a2ae77-1.1 | OPENSUSE-SU-2024:13207-1 |
| SUSE / openSUSE | openSUSE-Tumbleweed | python311-GitPythonx86_64 | Advisory build | 3.1.34.1693646983.2a2ae77-1.1 | OPENSUSE-SU-2024:13207-1 |
| SUSE / openSUSE | openSUSE-Tumbleweed | python313-GitPythonaarch64 | Advisory build | 3.1.56-1.1 | OPENSUSE-SU-2026:11419-1 |
| SUSE / openSUSE | openSUSE-Tumbleweed | python313-GitPythonppc64le | Advisory build | 3.1.56-1.1 | OPENSUSE-SU-2026:11419-1 |
| SUSE / openSUSE | openSUSE-Tumbleweed | python313-GitPythons390x | Advisory build | 3.1.56-1.1 | OPENSUSE-SU-2026:11419-1 |
| SUSE / openSUSE | openSUSE-Tumbleweed | python313-GitPythonx86_64 | Advisory build | 3.1.56-1.1 | OPENSUSE-SU-2026:11419-1 |
| SUSE / openSUSE | openSUSE-Tumbleweed | python314-GitPythonaarch64 | Advisory build | 3.1.56-1.1 | OPENSUSE-SU-2026:11419-1 |
| SUSE / openSUSE | openSUSE-Tumbleweed | python314-GitPythonppc64le | Advisory build | 3.1.56-1.1 | OPENSUSE-SU-2026:11419-1 |
| SUSE / openSUSE | openSUSE-Tumbleweed | python314-GitPythons390x | Advisory build | 3.1.56-1.1 | OPENSUSE-SU-2026:11419-1 |
| SUSE / openSUSE | openSUSE-Tumbleweed | python314-GitPythonx86_64 | Advisory build | 3.1.56-1.1 | OPENSUSE-SU-2026:11419-1 |
| SUSE / openSUSE | openSUSE-Tumbleweed | python39-GitPythonaarch64 | Advisory build | 3.1.34.1693646983.2a2ae77-1.1 | OPENSUSE-SU-2024:13207-1 |
| SUSE / openSUSE | openSUSE-Tumbleweed | python39-GitPythonppc64le | Advisory build | 3.1.34.1693646983.2a2ae77-1.1 | OPENSUSE-SU-2024:13207-1 |
| SUSE / openSUSE | openSUSE-Tumbleweed | python39-GitPythons390x | Advisory build | 3.1.34.1693646983.2a2ae77-1.1 | OPENSUSE-SU-2024:13207-1 |
| SUSE / openSUSE | openSUSE-Tumbleweed | python39-GitPythonx86_64 | Advisory build | 3.1.34.1693646983.2a2ae77-1.1 | OPENSUSE-SU-2024:13207-1 |
| Ubuntu | bionic | python3-git | Advisory build | 2.1.8-1ubuntu0.1~esm4 | USN-8303-1 |
| Ubuntu | focal | python-git | Advisory build | 3.0.7-1ubuntu0.1~esm4 | USN-8303-1 |
| Ubuntu | focal | python3-git | Advisory build | 3.0.7-1ubuntu0.1~esm4 | USN-8303-1 |
| Ubuntu | jammy | python-git | Advisory build | 3.1.24-1ubuntu0.1~esm3 | USN-8303-1 |
| Ubuntu | jammy | python3-git | Advisory build | 3.1.24-1ubuntu0.1~esm3 | USN-8303-1 |
| Ubuntu | trusty | python-git | Advisory build | 0.3.2~RC1-3ubuntu0.1~esm3 | USN-8303-1 |
| Ubuntu | xenial | python-git | Advisory build | 1.0.1+git137-gc8b8379-2.1ubuntu0.1~esm4 | USN-8303-1 |
| Ubuntu | xenial | python3-git | Advisory build | 1.0.1+git137-gc8b8379-2.1ubuntu0.1~esm4 | USN-8303-1 |
Description
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.
Related advisories
Vendor advisories explicitly linked to this CVE.
Assessment
CVSS risk assessment and additional context for this vulnerability.
- CVSS version
- 3.1
- Base score
- 4.0 / 10
- Severity
- medium
- Provider
- GitHub_M · cna
- Vector string
- CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L
Publisher product statements
Version ranges and default statuses as reported by each provider.
| Vendor | Product | Version status | Source |
|---|---|---|---|
| gitpython-developers | GitPython | < 3.1.37 (affected) | GitHub_M · cna |
Weaknesses
1- CWE-22 CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')
References
9- https://github.com/gitpython-developers/GitPython/blob/1c8310d7cae144f74a671cbe17e51f63a830adbf/git/refs/symbolic.py#L174-L175
- https://github.com/gitpython-developers/GitPython/commit/74e55ee4544867e1bd976b7df5a45869ee397b0b
- https://github.com/gitpython-developers/GitPython/commit/e98f57b81f792f0f5e18d33ee658ae395f9aa3c4
- https://github.com/gitpython-developers/GitPython/pull/1672
- https://github.com/gitpython-developers/GitPython/releases/tag/3.1.37
- https://github.com/gitpython-developers/GitPython/security/advisories/GHSA-cwvm-v4w8-q58c
- https://github.com/pypa/advisory-database/tree/main/vulns/gitpython/PYSEC-2023-165.yaml
- https://lists.debian.org/debian-lts-announce/2023/09/msg00036.html
- https://lists.debian.org/debian-lts-announce/2024/10/msg00030.html
Provider assertions
3GitHub_M · cna
GitPython blind local file inclusion
CISA-ADP · adp
CISA ADP Vulnrichment
CVE · adp
CVE Program Container
Provenance
- Schema
- 5.2
- Searchable
- yes
- Content hash
- 970ca823dc7dabb1ec3b92bd7a9cd4f2e25a10e02778049f1af08ed681fe4be7
- Ingested
- 23 Sep 2026, 08:11:26 UTC
- Source record
- Official CVE record