Skip to content

CVE-2023-40590 Untrusted search path on Windows systems leading to arbitrary code execution

HighCVSS 7.8 EPSS 0.51%
Published
Updated
Exploit status
No public exploit known
CISA SSVC
Proof of concept public · automatable: no · technical impact: total
Technology
UbuntuDebian

Description

GitPython is a python library used to interact with Git repositories. When resolving a program, Python/Windows look for the current working directory, and after that the PATH environment. GitPython defaults to use the git command, if a user runs GitPython from a repo has a git.exe or git executable, that program will be run instead of the one in the user's PATH. This is more of a problem on how Python interacts with Windows systems, Linux and any other OS aren't affected by this. But probably people using GitPython usually run it from the CWD of a repo. An attacker can trick a user to download a repository with a malicious git executable, if the user runs/imports GitPython from that directory, it allows the attacker to run any arbitrary commands. There is no fix currently available for windows users, however there are a few mitigations. 1: Default to an absolute path for the git program on Windows, like C:\\Program Files\\Git\\cmd\\git.EXE (default git path installation). 2: Require users to set the GIT_PYTHON_GIT_EXECUTABLE environment variable on Windows systems. 3: Make this problem prominent in the documentation and advise users to never run GitPython from an untrusted repo, or set the GIT_PYTHON_GIT_EXECUTABLE env var to an absolute path. 4: Resolve the executable manually by only looking into the PATH environment variable.

Upgrade path

8 packages: 2 fixed, 5 with no fix yet.

PackageAffectedFixed inStatus
ubuntu/python-git(Ubuntu 22.04) = 3.1.14-1; = 3.1.23-1; = 3.1.24-1; All versions No fix listed No fix yet
ubuntu/python-git(Ubuntu Pro 14.04) = 0.3.2~RC1-2; = 0.3.2~RC1-3; = 0.3.2~RC1-3ubuntu0.1~esm1; = 0.3.2~RC1-3ubuntu0.1~esm2 +2 more No fix listed No fix yet
ubuntu/python-git(Ubuntu Pro 16.04) = 1.0.1+git137-gc8b8379-1; = 1.0.1+git137-gc8b8379-2; = 1.0.1+git137-gc8b8379-2.1; = 1.0.1+git137-gc8b8379-2.1ubuntu0.1~esm1 +3 more No fix listed No fix yet
ubuntu/python-git(Ubuntu Pro 18.04) = 2.1.5-1; = 2.1.6-1; = 2.1.7-1; = 2.1.8-1 +4 more No fix listed No fix yet
ubuntu/python-git(Ubuntu Pro 20.04) = 2.1.11-1; = 3.0.4-1; = 3.0.5-1; = 3.0.7-1 +4 more No fix listed No fix yet
gitpython project gitpython <= 3.1.32 after 3.1.32 Fixed
pypi gitpython(PyPI) < 3.1.33; <= 3.1.32; = 0.1.7; = 0.2.0-beta1 +84 more 3.1.33 Fixed
gitpython-developers GitPython = <= 3.1.32 No fix listed Versions listed

Affected products

ProductAffected versionsFixed in
pypi gitpython(PyPI) < 3.1.33 3.1.33
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 98 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.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.32 No fix listed
gitpython-developers GitPython = <= 3.1.32 No fix listed
ubuntu/python-git(Ubuntu:22.04) All versions No fix listed
gitpython project gitpython <= 3.1.32 No fix listed
ubuntu/python-git(Ubuntu:Pro:14.04) All versions No fix listed
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:14.04) = 0.3.2~RC1-3ubuntu0.1~esm3 No fix listed
ubuntu/python-git(Ubuntu:Pro:16.04) All versions No fix listed
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:16.04) = 1.0.1+git137-gc8b8379-2.1ubuntu0.1~esm4 No fix listed
ubuntu/python-git(Ubuntu:Pro:18.04) All versions No fix listed
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:18.04) = 2.1.8-1ubuntu0.1~esm4 No fix listed
ubuntu/python-git(Ubuntu:Pro:20.04) All versions No fix listed
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:20.04) = 3.0.7-1ubuntu0.1~esm4 No fix listed
ubuntu/python-git(Ubuntu:22.04) = 3.1.14-1 No fix listed
ubuntu/python-git(Ubuntu:22.04) = 3.1.23-1 No fix listed
ubuntu/python-git(Ubuntu:22.04) = 3.1.24-1 No fix listed

References