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.
Affected products
| Vendor | Product | Affected | Fixed |
|---|---|---|---|
| gitpython-developers | GitPython | < 3.1.37 | — |
Fixed in Linux distributions
Distributions backport fixes, so the version that fixes this vulnerability differs per release — upgrade to at least the version shown. From the distributions' security trackers and advisories.
Debian
Security tracker ↗| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| Debian 14 | python-git | 3.1.36-1 | — |
| Debian 13 | python-git | 3.1.36-1 | — |
| Debian 12 | python-git | 3.1.30-1+deb12u2 | — |
| Debian 11 | python-git | 3.1.14-1+deb11u1 | DLA-3939-1 |
| Debian 10 | python-git | 2.1.11-1+deb10u2 | DLA-3589-1 |
Ubuntu
Security tracker ↗| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| Ubuntu Pro 26.04 LTS | python-git | 3.1.46-1ubuntu0.1~esm1 | USN-8303-1 |
| Ubuntu Pro 24.04 LTS | python-git | 3.1.37-3ubuntu0.1~esm2 | USN-8303-1 |
| Ubuntu Pro 22.04 LTS | python-git | 3.1.24-1ubuntu0.1~esm3 | USN-8303-1 |
Show 4 more (older releases, extended support, other products)Fewer releases
| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| Ubuntu Pro 20.04 LTS | python-git | 3.0.7-1ubuntu0.1~esm4 | USN-8303-1 |
| Ubuntu Pro 18.04 LTS | python-git | 2.1.8-1ubuntu0.1~esm4 | USN-8303-1 |
| Ubuntu Pro 16.04 LTS | python-git | 1.0.1+git137-gc8b8379-2.1ubuntu0.1~esm4 | USN-8303-1 |
| Ubuntu Pro 14.04 LTS | python-git | 0.3.2~RC1-3ubuntu0.1~esm3 | USN-8303-1 |
Red Hat
Security tracker ↗| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| Red Hat Satellite Utils 6 | foreman +1 | 3.7.0.10-1.el8sat | RHSA-2023:7851 |
| Red Hat Satellite Utils 6 | satellite +1 | 6.14.1-1.el8sat | RHSA-2023:7851 |
| Red Hat Satellite Capsule 6 | createrepo_c +3 | 1.0.2-2.el8pc | RHSA-2023:7851 |
| Red Hat Satellite Capsule 6 | foreman +1 | 3.7.0.10-1.el8sat | RHSA-2023:7851 |
| Red Hat Satellite Capsule 6 | foreman-installer +1 | 1:3.7.0.5-1.el8sat | RHSA-2023:7851 |
| Red Hat Satellite Capsule 6 | pulpcore-selinux | 2.0.0-1.el8pc | RHSA-2023:7851 |
| Red Hat Satellite Capsule 6 | python-django-import-export +1 | 3.1.0-1.el8pc | RHSA-2023:7851 |
| Red Hat Satellite Capsule 6 | python-gitpython +1 | 3.1.40-0.1.el8pc | RHSA-2023:7851 |
| Red Hat Satellite Capsule 6 | python-pulp-rpm +1 | 3.19.11-2.el8pc | RHSA-2023:7851 |
| Red Hat Satellite Capsule 6 | python-pulpcore +1 | 3.22.19-1.el8pc | RHSA-2023:7851 |
| Red Hat Satellite Capsule 6 | python-urllib3 +1 | 1.26.18-0.1.el8pc | RHSA-2023:7851 |
| Red Hat Satellite Capsule 6 | rubygem-smart_proxy_remote_execution_ssh | 0.10.2-2.el8sat | RHSA-2023:7851 |
| Red Hat Satellite Capsule 6 | satellite +2 | 6.14.1-1.el8sat | RHSA-2023:7851 |
| Red Hat Satellite 6 | createrepo_c +3 | 1.0.2-2.el8pc | RHSA-2023:7851 |
| Red Hat Satellite 6 | foreman +13 | 3.7.0.10-1.el8sat | RHSA-2023:7851 |
| Red Hat Satellite 6 | foreman-installer +1 | 1:3.7.0.5-1.el8sat | RHSA-2023:7851 |
| Red Hat Satellite 6 | pulpcore-selinux | 2.0.0-1.el8pc | RHSA-2023:7851 |
| Red Hat Satellite 6 | python-django-import-export +1 | 3.1.0-1.el8pc | RHSA-2023:7851 |
| Red Hat Satellite 6 | python-gitpython +1 | 3.1.40-0.1.el8pc | RHSA-2023:7851 |
| Red Hat Satellite 6 | python-pulp-rpm +1 | 3.19.11-2.el8pc | RHSA-2023:7851 |
| Red Hat Satellite 6 | python-pulpcore +1 | 3.22.19-1.el8pc | RHSA-2023:7851 |
| Red Hat Satellite 6 | python-urllib3 +1 | 1.26.18-0.1.el8pc | RHSA-2023:7851 |
| Red Hat Satellite 6 | rubygem-foreman_leapp | 1.1.0-1.el8sat | RHSA-2023:7851 |
| Red Hat Satellite 6 | rubygem-foreman_remote_execution +1 | 10.1.2-1.el8sat | RHSA-2023:7851 |
| Red Hat Satellite 6 | rubygem-katello | 4.9.0.18-1.el8sat | RHSA-2023:7851 |
| Red Hat Satellite 6 | rubygem-rails +12 | 6.1.7.4-1.el8sat | RHSA-2023:7851 |
| Red Hat Satellite 6 | rubygem-smart_proxy_remote_execution_ssh | 0.10.2-2.el8sat | RHSA-2023:7851 |
| Red Hat Satellite 6 | satellite +2 | 6.14.1-1.el8sat | RHSA-2023:7851 |
| Red Hat Satellite 6 | satellite-convert2rhel-toolkit | 1.0.0-1.el8sat | RHSA-2023:7851 |
Show 4 more (older releases, extended support, other products)Fewer releases
| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| Red Hat OpenStack 17 | GitPython +1 | 3.1.14-2.el8ost | RHSA-2024:0215, RHSA-2024:0190 |
| Red Hat Ansible Automation Platform Inside 2 | receptor +1 | 1.4.5-1.el8ap | RHSA-2024:1640 |
| Red Hat Ansible Automation Platform Developer 2 | receptor +1 | 1.4.5-1.el8ap | RHSA-2024:1640 |
| Red Hat Ansible Automation Platform 2 | automation-controller-venv-tower | 4.5.5-2.el8ap | RHSA-2024:1640 |
| Red Hat Ansible Automation Platform 2 | python-aiohttp +1 | 3.9.3-1.el9ap | RHSA-2024:1640 |
| Red Hat Ansible Automation Platform 2 | python-django +1 | 4.2.11-1.el9ap | RHSA-2024:1640 |
| Red Hat Ansible Automation Platform 2 | python-gitpython +1 | 3.1.40-1.el9ap | RHSA-2024:0322 |
| Red Hat Ansible Automation Platform 2 | python-twisted +2 | 23.10.0-1.el9ap | RHSA-2024:0322 |
| Red Hat Ansible Automation Platform 2 | python39-aiohttp +1 | 3.9.3-1.el8ap | RHSA-2024:1640 |
| Red Hat Ansible Automation Platform 2 | python39-django +1 | 4.2.11-1.el8ap | RHSA-2024:1640 |
| Red Hat Ansible Automation Platform 2 | python39-gitpython +1 | 3.1.40-1.el8ap | RHSA-2024:0322 |
| Red Hat Ansible Automation Platform 2 | python39-twisted +2 | 23.10.0-1.el8ap | RHSA-2024:0322 |
| Red Hat Ansible Automation Platform 2 | receptor +1 | 1.4.5-1.el8ap | RHSA-2024:1640 |
SUSE
Security tracker ↗| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| SUSE Package Hub 15 SP5 | python-GitPython | 3.1.12.1610074031.f653af66-bp155.3.3.1 | openSUSE-SU-2023:0259-1 |
| SUSE Package Hub 15 SP4 | python-GitPython | 3.1.12.1610074031.f653af66-bp154.2.3.1 | openSUSE-SU-2023:0271-1 |
openSUSE
Security tracker ↗| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| openSUSE Tumbleweed | python-GitPython | 3.1.56-1.1 | openSUSE-SU-2026:11419-1 |
| openSUSE Leap 15.5 | python-GitPython | 3.1.12.1610074031.f653af66-bp155.3.3.1 | openSUSE-SU-2023:0259-1 |
| openSUSE Leap 15.4 | python-GitPython | 3.1.12.1610074031.f653af66-bp154.2.3.1 | openSUSE-SU-2023:0271-1 |
Alpine
Security tracker ↗| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| Alpine v3.24 | py3-gitpython | 3.1.37-r0 | — |
| Alpine v3.23 | py3-gitpython | 3.1.37-r0 | — |
| Alpine v3.22 | py3-gitpython | 3.1.37-r0 | — |
| Alpine v3.21 | py3-gitpython | 3.1.37-r0 | — |
| Alpine v3.20 | py3-gitpython | 3.1.37-r0 | — |
Show 1 more (older releases, extended support, other products)Fewer releases
| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| Alpine v3.19 | py3-gitpython | 3.1.37-r0 | — |
Affected packages
| Ecosystem | Package | Affected | Fixed | Record |
|---|---|---|---|---|
| PyPI | gitpython | < 3.1.37 | 3.1.37 | GHSA-cwvm-v4w8-q58c |
| PyPI | gitpython | < 3.1.35 | 3.1.35 | PYSEC-2023-165 |
Advisories 12
- RHSA-2024:1640 Red Hat Security Advisory: Red Hat Ansible Automation Platform 2.4 Product Security and Bug Fix Update Red Hat Security Advisories (RHSA) · Oct 18, 2026
- RHSA-2023:7851 Red Hat Security Advisory: Satellite 6.14.1 Async Security Update Red Hat Security Advisories (RHSA) · Sep 9, 2026
- RHSA-2024:0322 Red Hat Security Advisory: Red Hat Ansible Automation Platform 2.4 Product Security and Bug Fix Update Red Hat Security Advisories (RHSA) · Aug 7, 2026
- RHSA-2024:0215 Red Hat Security Advisory: Red Hat OpenStack Platform 17.1 (GitPython) security update Red Hat Security Advisories (RHSA) · Aug 7, 2026
- RHSA-2024:0190 Red Hat Security Advisory: Red Hat OpenStack Platform 17.1 (GitPython) security update Red Hat Security Advisories (RHSA) · Aug 7, 2026
- WID-SEC-2023-2428 SaltStack Salt: Mehre Schwachstellen BSI CERT-Bund (WID) · Aug 2, 2026
- openSUSE-SU-2026:11419-1 python313-GitPython-3.1.56-1.1 on GA media SUSE / openSUSE Security Updates · Aug 2, 2026
- USN-8303-1 python-git vulnerabilities Ubuntu Security Notices (USN) · May 27, 2026
- DLA-3589-1 python-git - security update Debian Security (DSA / DLA) · Mar 9, 2026
- DLA-3939-1 python-git - security update Debian Security (DSA / DLA) · Mar 9, 2026
- openSUSE-SU-2023:0271-1 Security update for python-GitPython SUSE / openSUSE Security Updates · Feb 4, 2026
- openSUSE-SU-2023:0259-1 Security update for python-GitPython SUSE / openSUSE Security Updates · Feb 4, 2026
References
- https://github.com/gitpython-developers/GitPython/security/advisories/GHSA-cwvm-v4w8-q58c
- https://github.com/gitpython-developers/GitPython/pull/1672
- https://github.com/gitpython-developers/GitPython/commit/74e55ee4544867e1bd976b7df5a45869ee397b0b
- https://github.com/gitpython-developers/GitPython/commit/e98f57b81f792f0f5e18d33ee658ae395f9aa3c4
- https://github.com/gitpython-developers/GitPython/blob/1c8310d7cae144f74a671cbe17e51f63a830adbf/git/refs/symbolic.py#L174-L175
- https://github.com/gitpython-developers/GitPython/releases/tag/3.1.37
- 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