GitPython versions 2.1.0 up to but not including 3.0.3 contain a vulnerability where environment variables can be expanded from attacker-controlled .gitmodules submodule names during cloning operations. This leads to leakage of environment variable values both as persistent directory names on disk and in debug-level logs. The issue arises because the _clone() method does not disable environment variable expansion in Git.polish_url() for the separate_git_dir argument, unlike other similar calls. A fix is available in version 3.0.3.