CVE-2023-41040: GitPython - Path Traversal
- Cve: CVE-2023-41040
- Name: GitPython - Path Traversal
- 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.
- Impact: Attackers can trigger denial of service by causing GitPython to read arbitrary files or enter infinite loops, disrupting service availability.
- Remediation: Update to version 3.1.37 or later.
- Vulnerability type: path_traversal
- Vulnerability impact: denial_of_service
- Requirement type: none
- Labels source: projectdiscovery
- Severity: medium
- Cvss score: 6.5
- Cvss vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:L
- Epss score: 0.01093
- Epss percentile: 0.66155
- Assignee: [email protected]
- Published at: 2023-08-30T22:15:09Z
- Age in days: 1182
- Modified at: 2026-06-17T06:20:14Z
- Public exploits total: 1
- References total: 9
- Products total: 1
- Oss: yes
- Projects total: 1
- Advisory url: https://nvd.nist.gov/vuln/detail/CVE-2023-41040
- Nvd status: modified
- Checked, none or zero: patch available, known exploited entries, nuclei templates, public exploits capped, rejected by nvd
- Not known: requirements, hackerone
Cwe
| Id | Name |
|---|---|
| CWE-22 | Improper Limitation of a Pathname to a Restricted Directory |
Public exploits
| Url | Source | Added date |
|---|---|---|
| https://github.com/gitpython-developers/GitPython/security/advisories/GHSA-cwvm-v4w8-q58c | nvd | 2023-08-30 |
References
Same in every row:
- Source: nvd
Products
| Product | Affected | Platform bound | Sources | Url |
|---|---|---|---|---|
| gitpython_project:gitpython | <= 3.1.34 | no | nvd | /v1/products/gitpython_project/gitpython |
Projects
| Repository | Link kinds | Indexed | Url |
|---|---|---|---|
| gitpython-developers/gitpython | commit, fix, package, pull, releases, security_advisory | yes | /v1/repositories/gitpython-developers/gitpython |
Index
- Repositories: 398
- Repositories high signal: 222
- Packages: 1
Exploitation
- Public exploit: yes
- Public exploit count: 1
- Public exploit first date: 2023-08-30
- Remote: yes
- Checked, none or zero: known exploited, known exploited by, exploitation seen, initial access, authentication required
- Not known: known exploited since, vulncheck known exploited since, nuclei template, initial access since, hackerone reports, exposed hosts