Advisory Database
  • Advisories
  • Dependency Scanning
  1. pypi
  2. ›
  3. GitPython
  4. ›
  5. CVE-2023-40590

CVE-2023-40590: GitPython untrusted search path on Windows systems leading to arbitrary code execution

August 29, 2023 (updated September 20, 2024)

When resolving a program, Python/Windows look for the current working directory, and after that the PATH environment (see big warning in https://docs.python.org/3/library/subprocess.html#popen-constructor). 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.

References

  • docs.python.org/3/library/subprocess.html
  • github.com/advisories/GHSA-wfm5-v35h-vwf4
  • github.com/gitpython-developers/GitPython
  • github.com/gitpython-developers/GitPython/commit/8b75434e2c8a082cdeb4971cc6f0ee2bafec45bc
  • github.com/gitpython-developers/GitPython/issues/1635
  • github.com/gitpython-developers/GitPython/pull/1636
  • github.com/gitpython-developers/GitPython/releases/tag/3.1.33
  • github.com/gitpython-developers/GitPython/security/advisories/GHSA-wfm5-v35h-vwf4
  • github.com/pypa/advisory-database/tree/main/vulns/gitpython/PYSEC-2023-161.yaml
  • nvd.nist.gov/vuln/detail/CVE-2023-40590

Code Behaviors & Features

Detect and mitigate CVE-2023-40590 with GitLab Dependency Scanning

Secure your software supply chain by verifying that all open source dependencies used in your projects contain no disclosed vulnerabilities. Learn more about Dependency Scanning →

Affected versions

All versions before 3.1.33

Fixed versions

  • 3.1.33

Solution

Upgrade to version 3.1.33 or above.

Impact 7.8 HIGH

CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H

Learn more about CVSS

Weakness

  • CWE-426: Untrusted Search Path

Source file

pypi/GitPython/CVE-2023-40590.yml

Spotted a mistake? Edit the file on GitLab.

  • Site Repo
  • About GitLab
  • Terms
  • Privacy Statement
  • Contact

Page generated Wed, 14 May 2025 12:16:14 +0000.