CVE-2023-41040: GitPython blind local file inclusion
Vulnerability summary
CVE-2023-41040 is a medium (CVSS 6.5) vulnerability in gitpython_project gitpython. EPSS estimates a 1.09% chance of exploitation in the next 30 days, higher than 65.4% of scored vulnerabilities. 1 public exploit is recorded.
Not severe (CVSS 4, local access); no exploitation reported by the 5 checked sources
Source freshness unavailable
How is this decided?Advisory lineage
Upstream 0 · Downstream 7 · Related 2Timeline
- 30-08-2023PublishedVulnerability first disclosed.
- 03-11-2025Last modifiedVulnerability information updated.
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.
CVSS metrics
7 scores · 7 sources · 1 version- CVE.orgCNA4.0MediumCVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:LDiffers
- OSV · PypiEcosystem advisory · calculated6.5MediumCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:L
- OSV · Red hatEcosystem advisory · calculated5.1MediumCVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:LDiffers
- OSV · UbuntuEcosystem advisory · calculated6.5MediumCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:L
- OSV · DebianEcosystem advisory · calculated6.5MediumCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:L
- OSV · AlpineEcosystem advisory · calculated6.5MediumCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:L
EPSS trend
Probability
1.09%
Chance of exploitation in the next 30 days
Percentile
65%
Versus all other CVEs
30-day change
No change 0.00 pp
From 1.09% on 04-10-2026
Known exploited
Compare KEV catalogsNot in the CISA KEV catalog.
Not in the ENISA CNW catalog.
Not in the CIRCL catalog.
Public exploits
1 foundGitpython
Maturity: poc
Weaknesses
CWE · root causeAffected systems
Known conditions: local access, no authentication, no user interaction (CVSS vector). Other conditions: not stated in public data.
Opensuse2 products
- python-GitPython&distro=openSUSE Leap 15.4< 3.1.12.1610074031.f653af66-bp154.2.3.1
- python-GitPython&distro=openSUSE Leap 15.5< 3.1.12.1610074031.f653af66-bp155.3.3.1
Redhat2 products
- GitPython< 0:3.1.14-2.el8ost | < 0:3.1.14-2.el9ost
- python3-GitPython< 0:3.1.14-2.el8ost | < 0:3.1.14-2.el9ost
Suse2 products
- python-GitPython&distro=SUSE Package Hub 15 SP4< 3.1.12.1610074031.f653af66-bp154.2.3.1
- python-GitPython&distro=SUSE Package Hub 15 SP5< 3.1.12.1610074031.f653af66-bp155.3.3.1
Alpine1 product
- py3-gitpython< 3.1.37-r0
Debian1 product
- python-git< 2.1.11-1+deb10u2 | < 3.1.30-1+deb12u2 | < 3.1.36-1
Gitpython_project1 product
- gitpython≤ 3.1.34
Gitpython-developers1 product
- gitpython< 3.1.37
PyPI1 product
- gitpython< 3.1.37 | < 3.1.35
Ubuntu1 product
- python-git< 0.3.2~RC1-3ubuntu0.1~esm3 | < 1.0.1+git137-gc8b8379-2.1ubuntu0.1~esm4 | < 2.1.8-1ubuntu0.1~esm4 | < 3.0.7-1ubuntu0.1~esm4 | < 3.1.24-1ubuntu0.1~esm3
9 vendors · 12 products
References
27 links- github.com/gitpython-developers/GitPython/security/advisories/GHSA-cwvm-v4w8-q58cX Refsource CONFIRMWEBAdvisoryARTICLEREPORTExploitVendor Advisory
- lists.opensuse.org/archives/…Advisory
Show all 27 references
- lists.opensuse.org/archives/…Advisory