GHSA-fx3j-rwgx-fr94: GitPython: separate_git_dir leaks env vars via crafted .gitmodules submodule name
Repo._clone()’s handling of separate_git_dir never disables Git.polish_url()’s environment-variable expansion, unlike every other caller of that helper that handles attacker-influenced data. Since separate_git_dir can be derived from an attacker-controlled .gitmodules submodule name, a completely ordinary clone + submodule_update(init=True, recursive=True) on a malicious repository expands an environment variable of the attacker’s choosing and exposes its value both as a persistent on-disk directory name and, whenever DEBUG-level logging is enabled (a common CI/verbose-logging configuration), in a Popen(...) log line that is not redacted the way credential-bearing arguments are.
References
- github.com/advisories/GHSA-fx3j-rwgx-fr94
- github.com/gitpython-developers/GitPython/commit/9349ff58ee00c9fb14d515c8e693f33b2144b238
- github.com/gitpython-developers/GitPython/pull/2255
- github.com/gitpython-developers/GitPython/releases/tag/3.2.0
- github.com/gitpython-developers/GitPython/security/advisories/GHSA-fx3j-rwgx-fr94
Code Behaviors & Features
Detect and mitigate GHSA-fx3j-rwgx-fr94 with GitLab Dependency Scanning
Secure your software supply chain by verifying that all open source dependencies used in your projects contain no disclosed vulnerabilities. Dependency Scanning using SBOM also detects vulnerabilities from proprietary advisories that this site does not include. Learn more about Dependency Scanning using SBOM →