Skip to content

CVE-2023-41040 GitPython blind local file inclusion

MediumCVSS 6.5 EPSS 1.1%
Published
Updated
Exploit status
No public exploit known
CISA SSVC
Proof of concept public · automatable: no · technical impact: partial
Technology
UbuntuDebian

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.

Upgrade path

18 packages: 17 fixed.

PackageAffectedFixed inStatus
alpine/py3-gitpython(Alpine v3.19) < 3.1.37-r0 3.1.37-r0 Fixed
alpine/py3-gitpython(Alpine v3.20) < 3.1.37-r0 3.1.37-r0 Fixed
alpine/py3-gitpython(Alpine v3.21) < 3.1.37-r0 3.1.37-r0 Fixed
alpine/py3-gitpython(Alpine v3.22) < 3.1.37-r0 3.1.37-r0 Fixed
alpine/py3-gitpython(Alpine v3.23) < 3.1.37-r0 3.1.37-r0 Fixed
alpine/py3-gitpython(Alpine v3.24) < 3.1.37-r0 3.1.37-r0 Fixed
debian/python-git(Debian 12) < 3.1.30-1+deb12u2; = 3.1.30-1 3.1.30-1+deb12u2 Fixed
debian/python-git(Debian 13) < 3.1.36-1 3.1.36-1 Fixed
debian/python-git(Debian 14) < 3.1.36-1 3.1.36-1 Fixed
gitpython project gitpython <= 3.1.34 after 3.1.34 Fixed
pypi gitpython(PyPI) < 3.1.35; < 3.1.37; = 0.1.7; = 0.2.0-beta1 +88 more 3.1.35, 3.1.37 Fixed
ubuntu/python-git(Ubuntu 22.04) < 3.1.24-1ubuntu0.1~esm3 3.1.24-1ubuntu0.1~esm3 Fixed
ubuntu/python-git(Ubuntu Pro 14.04) < 0.3.2~RC1-3ubuntu0.1~esm3; = 0.3.2~RC1-2; = 0.3.2~RC1-3; = 0.3.2~RC1-3ubuntu0.1~esm1 +1 more 0.3.2~RC1-3ubuntu0.1~esm3 Fixed
ubuntu/python-git(Ubuntu Pro 16.04) < 1.0.1+git137-gc8b8379-2.1ubuntu0.1~esm4; = 1.0.1+git137-gc8b8379-1; = 1.0.1+git137-gc8b8379-2; = 1.0.1+git137-gc8b8379-2.1 +2 more 1.0.1+git137-gc8b8379-2.1ubuntu0.1~esm4 Fixed
ubuntu/python-git(Ubuntu Pro 18.04) < 2.1.8-1ubuntu0.1~esm4; = 2.1.5-1; = 2.1.6-1; = 2.1.7-1 +3 more 2.1.8-1ubuntu0.1~esm4 Fixed
ubuntu/python-git(Ubuntu Pro 20.04) < 3.0.7-1ubuntu0.1~esm4; = 2.1.11-1; = 3.0.4-1; = 3.0.5-1 +3 more 3.0.7-1ubuntu0.1~esm4 Fixed
ubuntu/python-git(Ubuntu Pro 22.04) < 3.1.24-1ubuntu0.1~esm3; = 3.1.14-1; = 3.1.23-1; = 3.1.24-1 +2 more 3.1.24-1ubuntu0.1~esm3 Fixed
gitpython-developers GitPython = < 3.1.37 No fix listed Versions listed

Affected products

ProductAffected versionsFixed in
pypi gitpython(PyPI) < 3.1.37 3.1.37
pypi gitpython(PyPI) = 0.1.7 No fix listed
pypi gitpython(PyPI) = 0.2.0-beta1 No fix listed
pypi gitpython(PyPI) = 0.3.0-beta1 No fix listed
pypi gitpython(PyPI) = 0.3.0-beta2 No fix listed
pypi gitpython(PyPI) = 0.3.1-beta2 No fix listed
pypi gitpython(PyPI) = 0.3.2 No fix listed
pypi gitpython(PyPI) = 0.3.2.1 No fix listed
pypi gitpython(PyPI) = 0.3.2.RC1 No fix listed
pypi gitpython(PyPI) = 0.3.3 No fix listed
pypi gitpython(PyPI) = 0.3.4 No fix listed
pypi gitpython(PyPI) = 0.3.5 No fix listed
pypi gitpython(PyPI) = 0.3.6 No fix listed
pypi gitpython(PyPI) = 0.3.7 No fix listed
pypi gitpython(PyPI) = 1.0.0 No fix listed
pypi gitpython(PyPI) = 1.0.1 No fix listed
pypi gitpython(PyPI) = 1.0.2 No fix listed
pypi gitpython(PyPI) = 2.0.0 No fix listed
pypi gitpython(PyPI) = 2.0.1 No fix listed
pypi gitpython(PyPI) = 2.0.2 No fix listed
pypi gitpython(PyPI) = 2.0.3 No fix listed
pypi gitpython(PyPI) = 2.0.4 No fix listed
pypi gitpython(PyPI) = 2.0.5 No fix listed
pypi gitpython(PyPI) = 2.0.6 No fix listed
pypi gitpython(PyPI) = 2.0.7 No fix listed
Show 111 more
ProductAffected versionsFixed in
pypi gitpython(PyPI) = 2.0.8 No fix listed
pypi gitpython(PyPI) = 2.0.9 No fix listed
pypi gitpython(PyPI) = 2.0.9.dev0 No fix listed
pypi gitpython(PyPI) = 2.0.9.dev1 No fix listed
pypi gitpython(PyPI) = 2.1.0 No fix listed
pypi gitpython(PyPI) = 2.1.1 No fix listed
pypi gitpython(PyPI) = 2.1.10 No fix listed
pypi gitpython(PyPI) = 2.1.11 No fix listed
pypi gitpython(PyPI) = 2.1.12 No fix listed
pypi gitpython(PyPI) = 2.1.13 No fix listed
pypi gitpython(PyPI) = 2.1.14 No fix listed
pypi gitpython(PyPI) = 2.1.15 No fix listed
pypi gitpython(PyPI) = 2.1.2 No fix listed
pypi gitpython(PyPI) = 2.1.3 No fix listed
pypi gitpython(PyPI) = 2.1.4 No fix listed
pypi gitpython(PyPI) = 2.1.5 No fix listed
pypi gitpython(PyPI) = 2.1.6 No fix listed
pypi gitpython(PyPI) = 2.1.7 No fix listed
pypi gitpython(PyPI) = 2.1.8 No fix listed
pypi gitpython(PyPI) = 2.1.9 No fix listed
pypi gitpython(PyPI) = 3.0.0 No fix listed
pypi gitpython(PyPI) = 3.0.1 No fix listed
pypi gitpython(PyPI) = 3.0.2 No fix listed
pypi gitpython(PyPI) = 3.0.3 No fix listed
pypi gitpython(PyPI) = 3.0.4 No fix listed
pypi gitpython(PyPI) = 3.0.5 No fix listed
pypi gitpython(PyPI) = 3.0.6 No fix listed
pypi gitpython(PyPI) = 3.0.7 No fix listed
pypi gitpython(PyPI) = 3.0.8 No fix listed
pypi gitpython(PyPI) = 3.0.9 No fix listed
pypi gitpython(PyPI) = 3.1.0 No fix listed
pypi gitpython(PyPI) = 3.1.1 No fix listed
pypi gitpython(PyPI) = 3.1.10 No fix listed
pypi gitpython(PyPI) = 3.1.11 No fix listed
pypi gitpython(PyPI) = 3.1.12 No fix listed
pypi gitpython(PyPI) = 3.1.13 No fix listed
pypi gitpython(PyPI) = 3.1.14 No fix listed
pypi gitpython(PyPI) = 3.1.15 No fix listed
pypi gitpython(PyPI) = 3.1.16 No fix listed
pypi gitpython(PyPI) = 3.1.17 No fix listed
pypi gitpython(PyPI) = 3.1.18 No fix listed
pypi gitpython(PyPI) = 3.1.19 No fix listed
pypi gitpython(PyPI) = 3.1.2 No fix listed
pypi gitpython(PyPI) = 3.1.20 No fix listed
pypi gitpython(PyPI) = 3.1.22 No fix listed
pypi gitpython(PyPI) = 3.1.23 No fix listed
pypi gitpython(PyPI) = 3.1.24 No fix listed
pypi gitpython(PyPI) = 3.1.25 No fix listed
pypi gitpython(PyPI) = 3.1.26 No fix listed
pypi gitpython(PyPI) = 3.1.27 No fix listed
pypi gitpython(PyPI) = 3.1.28 No fix listed
pypi gitpython(PyPI) = 3.1.29 No fix listed
pypi gitpython(PyPI) = 3.1.3 No fix listed
pypi gitpython(PyPI) = 3.1.30 No fix listed
pypi gitpython(PyPI) = 3.1.31 No fix listed
pypi gitpython(PyPI) = 3.1.32 No fix listed
pypi gitpython(PyPI) = 3.1.33 No fix listed
pypi gitpython(PyPI) = 3.1.34 No fix listed
pypi gitpython(PyPI) = 3.1.35 No fix listed
pypi gitpython(PyPI) = 3.1.36 No fix listed
pypi gitpython(PyPI) = 3.1.4 No fix listed
pypi gitpython(PyPI) = 3.1.5 No fix listed
pypi gitpython(PyPI) = 3.1.6 No fix listed
pypi gitpython(PyPI) = 3.1.7 No fix listed
pypi gitpython(PyPI) = 3.1.8 No fix listed
pypi gitpython(PyPI) = 3.1.9 No fix listed
pypi gitpython(PyPI) < 3.1.35 3.1.35
debian/python-git(Debian:12) < 3.1.30-1+deb12u2 3.1.30-1+deb12u2
debian/python-git(Debian:12) = 3.1.30-1 No fix listed
debian/python-git(Debian:13) < 3.1.36-1 3.1.36-1
debian/python-git(Debian:14) < 3.1.36-1 3.1.36-1
gitpython-developers GitPython = < 3.1.37 No fix listed
ubuntu/python-git(Ubuntu:22.04) < 3.1.24-1ubuntu0.1~esm3 3.1.24-1ubuntu0.1~esm3
alpine/py3-gitpython(Alpine:v3.19) < 3.1.37-r0 3.1.37-r0
alpine/py3-gitpython(Alpine:v3.20) < 3.1.37-r0 3.1.37-r0
alpine/py3-gitpython(Alpine:v3.21) < 3.1.37-r0 3.1.37-r0
alpine/py3-gitpython(Alpine:v3.22) < 3.1.37-r0 3.1.37-r0
alpine/py3-gitpython(Alpine:v3.23) < 3.1.37-r0 3.1.37-r0
alpine/py3-gitpython(Alpine:v3.24) < 3.1.37-r0 3.1.37-r0
gitpython project gitpython <= 3.1.34 No fix listed
ubuntu/python-git(Ubuntu:Pro:14.04) < 0.3.2~RC1-3ubuntu0.1~esm3 0.3.2~RC1-3ubuntu0.1~esm3
ubuntu/python-git(Ubuntu:Pro:14.04) = 0.3.2~RC1-2 No fix listed
ubuntu/python-git(Ubuntu:Pro:14.04) = 0.3.2~RC1-3 No fix listed
ubuntu/python-git(Ubuntu:Pro:14.04) = 0.3.2~RC1-3ubuntu0.1~esm1 No fix listed
ubuntu/python-git(Ubuntu:Pro:14.04) = 0.3.2~RC1-3ubuntu0.1~esm2 No fix listed
ubuntu/python-git(Ubuntu:Pro:16.04) < 1.0.1+git137-gc8b8379-2.1ubuntu0.1~esm4 1.0.1+git137-gc8b8379-2.1ubuntu0.1~esm4
ubuntu/python-git(Ubuntu:Pro:16.04) = 1.0.1+git137-gc8b8379-1 No fix listed
ubuntu/python-git(Ubuntu:Pro:16.04) = 1.0.1+git137-gc8b8379-2 No fix listed
ubuntu/python-git(Ubuntu:Pro:16.04) = 1.0.1+git137-gc8b8379-2.1 No fix listed
ubuntu/python-git(Ubuntu:Pro:16.04) = 1.0.1+git137-gc8b8379-2.1ubuntu0.1~esm1 No fix listed
ubuntu/python-git(Ubuntu:Pro:16.04) = 1.0.1+git137-gc8b8379-2.1ubuntu0.1~esm2 No fix listed
ubuntu/python-git(Ubuntu:Pro:18.04) < 2.1.8-1ubuntu0.1~esm4 2.1.8-1ubuntu0.1~esm4
ubuntu/python-git(Ubuntu:Pro:18.04) = 2.1.5-1 No fix listed
ubuntu/python-git(Ubuntu:Pro:18.04) = 2.1.6-1 No fix listed
ubuntu/python-git(Ubuntu:Pro:18.04) = 2.1.7-1 No fix listed
ubuntu/python-git(Ubuntu:Pro:18.04) = 2.1.8-1 No fix listed
ubuntu/python-git(Ubuntu:Pro:18.04) = 2.1.8-1ubuntu0.1~esm1 No fix listed
ubuntu/python-git(Ubuntu:Pro:18.04) = 2.1.8-1ubuntu0.1~esm2 No fix listed
ubuntu/python-git(Ubuntu:Pro:20.04) < 3.0.7-1ubuntu0.1~esm4 3.0.7-1ubuntu0.1~esm4
ubuntu/python-git(Ubuntu:Pro:20.04) = 2.1.11-1 No fix listed
ubuntu/python-git(Ubuntu:Pro:20.04) = 3.0.4-1 No fix listed
ubuntu/python-git(Ubuntu:Pro:20.04) = 3.0.5-1 No fix listed
ubuntu/python-git(Ubuntu:Pro:20.04) = 3.0.7-1 No fix listed
ubuntu/python-git(Ubuntu:Pro:20.04) = 3.0.7-1ubuntu0.1~esm1 No fix listed
ubuntu/python-git(Ubuntu:Pro:20.04) = 3.0.7-1ubuntu0.1~esm2 No fix listed
ubuntu/python-git(Ubuntu:Pro:22.04) < 3.1.24-1ubuntu0.1~esm3 3.1.24-1ubuntu0.1~esm3
ubuntu/python-git(Ubuntu:Pro:22.04) = 3.1.14-1 No fix listed
ubuntu/python-git(Ubuntu:Pro:22.04) = 3.1.23-1 No fix listed
ubuntu/python-git(Ubuntu:Pro:22.04) = 3.1.24-1 No fix listed
ubuntu/python-git(Ubuntu:Pro:22.04) = 3.1.24-1ubuntu0.1~esm1 No fix listed
ubuntu/python-git(Ubuntu:Pro:22.04) = 3.1.24-1ubuntu0.1~esm2 No fix listed

References