CVE-2023-40590
Python vulnerability analysis and mitigation

Overview

GitPython, a Python library used to interact with Git repositories, was found to contain a vulnerability (CVE-2023-40590) that affects Windows systems. The vulnerability was discovered and disclosed on August 26, 2023, affecting all versions up to and including 3.1.32. The issue stems from how Python and Windows handle program resolution in the current working directory before checking the PATH environment (GitHub Advisory).

Technical details

The vulnerability occurs when GitPython defaults to using the 'git' command. On Windows systems, when resolving a program, Python first looks in the current working directory before checking the PATH environment. This means if a user runs GitPython from a directory containing a malicious 'git.exe' or 'git' executable, that program will be executed instead of the legitimate Git installation in the user's PATH. The vulnerability has been assigned a CVSS v3.1 score of 7.8 (High), with a vector string of CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H (GitHub Advisory, NVD).

Impact

The vulnerability allows an attacker to execute arbitrary code on Windows systems by tricking a user into downloading a repository containing a malicious git executable and running GitPython from that directory. This could lead to complete system compromise within the context of the user running the Python code (Security Online).

Mitigation and workarounds

Several mitigation strategies have been proposed: 1) Default to an absolute path for the git program on Windows (e.g., 'C:\Program Files\Git\cmd\git.EXE'), 2) Set the GITPYTHONGIT_EXECUTABLE environment variable on Windows systems to specify the absolute path to the git executable, 3) Never run GitPython from an untrusted repository, 4) Resolve the executable manually by only looking into the PATH environment variable (GitHub Advisory).

Additional resources


SourceThis report was generated using AI

Related Python vulnerabilities:

CVE ID

Severity

Score

Technologies

Component name

CISA KEV exploit

Has fix

Published date

CVE-2025-66423HIGH7.1
  • PythonPython
  • tryton-server
NoYesNov 30, 2025
CVE-2025-66454MEDIUM6.5
  • PythonPython
  • arcade-mcp-server
NoYesDec 02, 2025
CVE-2025-66424MEDIUM6.5
  • PythonPython
  • trytond
NoYesNov 30, 2025
CVE-2025-66422MEDIUM4.3
  • PythonPython
  • tryton-server
NoYesNov 30, 2025
CVE-2025-65858LOW3.5
  • PythonPython
  • calibreweb
NoNoDec 02, 2025

Free Vulnerability Assessment

Benchmark your Cloud Security Posture

Evaluate your cloud security practices across 9 security domains to benchmark your risk level and identify gaps in your defenses.

Request assessment

Get a personalized demo

Ready to see Wiz in action?

"Best User Experience I have ever seen, provides full visibility to cloud workloads."
David EstlickCISO
"Wiz provides a single pane of glass to see what is going on in our cloud environments."
Adam FletcherChief Security Officer
"We know that if Wiz identifies something as critical, it actually is."
Greg PoniatowskiHead of Threat and Vulnerability Management