GHSA-gq48-pqfc-9p58: GitPython: Submodule.move() follows an attacker-committed intermediate symlink outside the worktree
GitPython’s public Submodule.move() API verifies that its destination is lexically inside the parent repository, but it does not reject symbolic links in the destination’s intermediate components before filesystem operations. On systems that check out Git symlinks, an untrusted repository can therefore redirect a fixed, application-selected move destination outside the parent worktree.
The reporter reproduced this on the latest release, GitPython 3.1.62, and current main. In the strict scenario, the repository commits vendor -> ../outside, while the consuming application independently passes the fixed literal vendor/module. Submodule.move() follows vendor, moves the initialized submodule checkout to outside/module, rewrites .gitmodules and the index to the symlinked path, and leaves the index unable to produce a tree.
The same result occurs when the committed symlink contains an absolute path to an external directory. No attacker-controlled API argument, local symlink planting, race, Git hook, unsafe-option flag, or network access during the proof is required.
References
- github.com/advisories/GHSA-gq48-pqfc-9p58
- github.com/gitpython-developers/GitPython/commit/24b6f95d4b90ab1483fb601c736ac6e7c059cd61
- github.com/gitpython-developers/GitPython/pull/2232
- github.com/gitpython-developers/GitPython/releases/tag/3.2.0
- github.com/gitpython-developers/GitPython/security/advisories/GHSA-gq48-pqfc-9p58
Code Behaviors & Features
Detect and mitigate GHSA-gq48-pqfc-9p58 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 →