Advisory Database
  • Advisories
  • Dependency Scanning
  1. pypi
  2. ›
  3. GitPython
  4. ›
  5. GHSA-gq48-pqfc-9p58

GHSA-gq48-pqfc-9p58: GitPython: Submodule.move() follows an attacker-committed intermediate symlink outside the worktree

October 27, 2026

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 →

Affected versions

All versions before 3.2.0

Fixed versions

  • 3.2.0

Solution

Upgrade to version 3.2.0 or above.

Weakness

  • CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')
  • CWE-59: Improper Link Resolution Before File Access ('Link Following')

Source file

pypi/GitPython/GHSA-gq48-pqfc-9p58.yml

Spotted a mistake? Edit the file on GitLab.

  • Site Repo
  • About GitLab
  • Terms
  • Privacy Statement
  • Contact

Page generated Sun, 08 Nov 2026 00:16:49 +0000.