CVE-2023-41040GitPython blind local file inclusion
- 4.0MediumCVSS base score
- 1.1%Exploitation in 30 daysEPSS · top 34% of all CVEs
- NoKnown exploitednot in CISA's KEV catalog
- YesPublic exploitsa reference or SSVC says so
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.
Public exploit
An exploit or proof of concept is public: anyone can try it against an unpatched system. CISA's SSVC rates its exploitation: a proof of concept is public.
Timeline
ID reserved
By GitHub_M
- 8 days later
· 8 days later
Published
- 2 years later
· 2 years later
Record updated
Changes after publication (a new score, a public exploit, EPSS crossing 1, 10 or 50 %, leaving KEV) are kept since November 2026; earlier ones are not known.
Scores
| Scored by | CVSS | Score | Vector |
|---|---|---|---|
| GitHub_MCNA (assigner) | 3.1 | Medium4.0 | CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L |
| NVDNVD · Modified | 3.1 | Medium6.5 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:L |
- EPSS (exploitation in 30 days)
- 1.1% · top 34% of all CVEs (19 Nov 2026)
- CISA SSVC
- Exploitation: poc · Automatable: no · Technical impact: partial
The list uses the assigner's score when there is one, then CISA's, then NVD's: Medium 4.0.
Affected products
gitpython-developers · GitPython
- affected < 3.1.37
Affected packages
From reviewed advisories of the GitHub Advisory Database.
- PyPIGitPythonGHSA-cwvm-v4w8-q58c (opens in a new tab)
References
References9
- https://github.com/gitpython-developers/GitPython/security/advisories/GHSA-cwvm-v4w8-q58c (opens in a new tab)x_refsource_CONFIRMx_transferred
- https://github.com/gitpython-developers/GitPython/pull/1672 (opens in a new tab)x_refsource_MISC
- https://github.com/gitpython-developers/GitPython/commit/74e55ee4544867e1bd976b7df5a45869ee397b0b (opens in a new tab)x_refsource_MISC
- https://github.com/gitpython-developers/GitPython/commit/e98f57b81f792f0f5e18d33ee658ae395f9aa3c4 (opens in a new tab)x_refsource_MISC
- https://github.com/gitpython-developers/GitPython/blob/1c8310d7cae144f74a671cbe17e51f63a830adbf/git/refs/symbolic.py#L174-L175 (opens in a new tab)x_refsource_MISCx_transferred
- https://github.com/gitpython-developers/GitPython/releases/tag/3.1.37 (opens in a new tab)x_refsource_MISC
- https://github.com/pypa/advisory-database/tree/main/vulns/gitpython/PYSEC-2023-165.yaml (opens in a new tab)x_refsource_MISC
- https://lists.debian.org/debian-lts-announce/2023/09/msg00036.html (opens in a new tab)x_refsource_MISCx_transferred
- https://lists.debian.org/debian-lts-announce/2024/10/msg00030.html (opens in a new tab)
Sources
The same CVE in the primary databases and aggregators, to check against.
- CVE.org record (opens in a new tab)
- CVE List JSON (GitHub) (opens in a new tab)
- NVD (opens in a new tab)
- FIRST EPSS (opens in a new tab)
- EUVD EUVD-2023-0087 (opens in a new tab)
- OSV.dev (opens in a new tab)
- GitHub Advisory GHSA-cwvm-v4w8-q58c (opens in a new tab)
- CIRCL Vulnerability-Lookup (opens in a new tab)
Badge for a README or a ticket
[](https://cveledger.app/cve/CVE-2023-41040)Record last updated .