CVE-2023-40590
published high CVSS 3.1 · 7.8Untrusted search path on Windows systems leading to arbitrary code execution
Package status and fixes
| Distro / vendor | Release | Package / product | Publisher status | Fixed build | Source |
|---|---|---|---|---|---|
| gitpython-developers | — | GitPython<= 3.1.32 | Affected | Not stated | GitHub_M |
| SUSE / openSUSE | openSUSE-Tumbleweed | python310-GitPythonaarch64 | Advisory build | 3.1.34.1693646983.2a2ae77-1.1 | OPENSUSE-SU-2024:13207-1 |
| SUSE / openSUSE | openSUSE-Tumbleweed | python310-GitPythonppc64le | Advisory build | 3.1.34.1693646983.2a2ae77-1.1 | OPENSUSE-SU-2024:13207-1 |
| SUSE / openSUSE | openSUSE-Tumbleweed | python310-GitPythons390x | Advisory build | 3.1.34.1693646983.2a2ae77-1.1 | OPENSUSE-SU-2024:13207-1 |
| SUSE / openSUSE | openSUSE-Tumbleweed | python310-GitPythonx86_64 | Advisory build | 3.1.34.1693646983.2a2ae77-1.1 | OPENSUSE-SU-2024:13207-1 |
| SUSE / openSUSE | openSUSE-Tumbleweed | python311-GitPythonaarch64 | Advisory build | 3.1.34.1693646983.2a2ae77-1.1 | OPENSUSE-SU-2024:13207-1 |
| SUSE / openSUSE | openSUSE-Tumbleweed | python311-GitPythonppc64le | Advisory build | 3.1.34.1693646983.2a2ae77-1.1 | OPENSUSE-SU-2024:13207-1 |
| SUSE / openSUSE | openSUSE-Tumbleweed | python311-GitPythons390x | Advisory build | 3.1.34.1693646983.2a2ae77-1.1 | OPENSUSE-SU-2024:13207-1 |
Show 13 more entries
| Distro / vendor | Release | Package / product | Publisher status | Fixed build | Source |
|---|---|---|---|---|---|
| SUSE / openSUSE | openSUSE-Tumbleweed | python311-GitPythonx86_64 | Advisory build | 3.1.34.1693646983.2a2ae77-1.1 | OPENSUSE-SU-2024:13207-1 |
| SUSE / openSUSE | openSUSE-Tumbleweed | python313-GitPythonaarch64 | Advisory build | 3.1.56-1.1 | OPENSUSE-SU-2026:11419-1 |
| SUSE / openSUSE | openSUSE-Tumbleweed | python313-GitPythonppc64le | Advisory build | 3.1.56-1.1 | OPENSUSE-SU-2026:11419-1 |
| SUSE / openSUSE | openSUSE-Tumbleweed | python313-GitPythons390x | Advisory build | 3.1.56-1.1 | OPENSUSE-SU-2026:11419-1 |
| SUSE / openSUSE | openSUSE-Tumbleweed | python313-GitPythonx86_64 | Advisory build | 3.1.56-1.1 | OPENSUSE-SU-2026:11419-1 |
| SUSE / openSUSE | openSUSE-Tumbleweed | python314-GitPythonaarch64 | Advisory build | 3.1.56-1.1 | OPENSUSE-SU-2026:11419-1 |
| SUSE / openSUSE | openSUSE-Tumbleweed | python314-GitPythonppc64le | Advisory build | 3.1.56-1.1 | OPENSUSE-SU-2026:11419-1 |
| SUSE / openSUSE | openSUSE-Tumbleweed | python314-GitPythons390x | Advisory build | 3.1.56-1.1 | OPENSUSE-SU-2026:11419-1 |
| SUSE / openSUSE | openSUSE-Tumbleweed | python314-GitPythonx86_64 | Advisory build | 3.1.56-1.1 | OPENSUSE-SU-2026:11419-1 |
| SUSE / openSUSE | openSUSE-Tumbleweed | python39-GitPythonaarch64 | Advisory build | 3.1.34.1693646983.2a2ae77-1.1 | OPENSUSE-SU-2024:13207-1 |
| SUSE / openSUSE | openSUSE-Tumbleweed | python39-GitPythonppc64le | Advisory build | 3.1.34.1693646983.2a2ae77-1.1 | OPENSUSE-SU-2024:13207-1 |
| SUSE / openSUSE | openSUSE-Tumbleweed | python39-GitPythons390x | Advisory build | 3.1.34.1693646983.2a2ae77-1.1 | OPENSUSE-SU-2024:13207-1 |
| SUSE / openSUSE | openSUSE-Tumbleweed | python39-GitPythonx86_64 | Advisory build | 3.1.34.1693646983.2a2ae77-1.1 | OPENSUSE-SU-2024:13207-1 |
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.
Related advisories
Vendor advisories explicitly linked to this CVE.
Assessment
CVSS risk assessment and additional context for this vulnerability.
- CVSS version
- 3.1
- Base score
- 7.8 / 10
- Severity
- high
- Provider
- GitHub_M · cna
- Vector string
- CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H
Publisher product statements
Version ranges and default statuses as reported by each provider.
| Vendor | Product | Version status | Source |
|---|---|---|---|
| gitpython-developers | GitPython | <= 3.1.32 (affected) | GitHub_M · cna |
Weaknesses
1- CWE-426 CWE-426: Untrusted Search Path
References
2Provider assertions
3GitHub_M · cna
Untrusted search path on Windows systems leading to arbitrary code execution
CISA-ADP · adp
CISA ADP Vulnrichment
CVE · adp
CVE Program Container
Provenance
- Schema
- 5.1
- Searchable
- yes
- Content hash
- e9856201a360c83438c61111b7ae444de2572e86d26048196d3dcd8ba03dc317
- Ingested
- 23 Sep 2026, 08:11:26 UTC
- Source record
- Official CVE record