# CVE-2023-41040: python3-git: GitPython is a python library used to interact with Git repositories

CVE-2023-41040 is fixed in 2 products on 1 platform, first by DEBIAN-CVE-2023-41040, released August 30, 2023. It is not reported as exploited. Patch Radar priority: Routine.

- Web page: https://patchblox.com/security/cve/CVE-2023-41040
- Priority: Routine
- CVSS: 6.5 (Medium)
- EPSS: 0.0109
- CISA KEV: not listed
- Exploited (vendor report): no
- Publicly disclosed: no
- Published: Aug 30, 2023

## 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.

## Where it's fixed

| Platform | Product | Fixed in | Fix | Released |
|---|---|---|---|---|
| Linux | python-git Debian 12.15 (bookworm) | 3.1.30-1+deb12u2 | [DEBIAN-CVE-2023-41040](https://patchblox.com/security/data/fix/linux/debian-cve-2023-41040.md) | Aug 30, 2023 |
| Linux | python-git Debian 13.5 (trixie) | 3.1.36-1 | [DEBIAN-CVE-2023-41040](https://patchblox.com/security/data/fix/linux/debian-cve-2023-41040.md) | Aug 30, 2023 |
| Linux | python-git Debian 14 | 3.1.36-1 | [DEBIAN-CVE-2023-41040](https://patchblox.com/security/data/fix/linux/debian-cve-2023-41040.md) | Aug 30, 2023 |
| Linux | python-git Ubuntu 18.04.6 LTS (bionic) | 2.1.8-1ubuntu0.1~esm4 | [python-git 2.1.8-1ubuntu0.1~esm4](https://patchblox.com/security/data/fix/linux/ubuntu-bionic-python-git-2.1.8-1ubuntu0.1-esm4.md) | May 27, 2026 |
| Linux | python3-git Ubuntu 18.04.6 LTS (bionic) | 2.1.8-1ubuntu0.1~esm4 | [python3-git 2.1.8-1ubuntu0.1~esm4](https://patchblox.com/security/data/fix/linux/ubuntu-bionic-python3-git-2.1.8-1ubuntu0.1-esm4.md) | May 27, 2026 |
| Linux | python3-git Ubuntu 20.04 LTS (focal) | 3.0.7-1ubuntu0.1~esm4 | [python3-git 3.0.7-1ubuntu0.1~esm4](https://patchblox.com/security/data/fix/linux/ubuntu-focal-python3-git-3.0.7-1ubuntu0.1-esm4.md) | May 27, 2026 |
| Linux | python3-git Ubuntu 22.04.1 LTS (jammy) | 3.1.24-1ubuntu0.1~esm3 | [python3-git 3.1.24-1ubuntu0.1~esm3](https://patchblox.com/security/data/fix/linux/ubuntu-jammy-python3-git-3.1.24-1ubuntu0.1-esm3.md) | May 27, 2026 |

---

Data as of 2026-11-09T07:25:28Z UTC. Source: Patchblox Patch Radar (https://patchblox.com/security/patch-radar). Patchblox finds out-of-date software on Windows, macOS and Linux and updates it through release rings: https://patchblox.com/demo

Free to use with attribution: show "Data: Patchblox Patch Radar" with a link to https://patchblox.com/security/patch-radar. Terms, including what needs a written agreement: https://patchblox.com/security/patch-radar/use-the-data

Product names, logos and trademarks shown on Patch Radar belong to their respective owners. They are used only to identify the software each security fix applies to and to help readers find their platform. Their use does not imply any affiliation with, or endorsement by, those owners, and Patchblox is not affiliated with any of them.
