VAITP Dataset

← Back to the dataset

CVE-2026-110860

Symlink-following flaw in GitPython Submodule.move() allows path traversal via crafted symlinks.

  • CVSS 6.9
  • CWE-59
  • Input Validation and Sanitization
  • Local

GitPython from 3.1.62 before 3.2.0 contains a symlink-following flaw in Submodule.move(), which checks the destination only lexically and does not reject symbolic links in intermediate path components. An untrusted repository can commit a symlink such as vendor pointing outside the worktree, so an application moving an initialized submodule beneath it relocates the checkout externally and corrupts the index and .gitmodules.

CVSS base score
6.9
Published
2026-10-14
OWASP
A01 Broken Access Control
Orthogonal defect classification
Checking
Code defect classification
Missing Check
Category
Input Validation and Sanitization
Subcategory
Path Traversal
Accessibility scope
Local
Impact
Unauthorized Access
Affected component
GitPython
Fixed by upgrading
Yes

Solution

Upgrade GitPython to version 3.2.0 or later.

Vulnerable code sample

import os
from git import Repo

def relocate_submodule(repo_path: str, submodule_name: str, new_path: str) -> None:
    """Move a submodule to a new location inside the worktree."""
    repo = Repo(repo_path)
    submodule = repo.submodule(submodule_name)
    # VULNERABLE: does not verify that intermediate components are not symlinks
    submodule.move(new_path)

Patched code sample

import os
from git import Repo

def relocate_submodule(repo_path: str, submodule_name: str, new_path: str) -> None:
    """Move a submodule to a new location inside the worktree."""
    repo = Repo(repo_path)
    submodule = repo.submodule(submodule_name)
    # FIX: resolve symlinks and ensure the target stays within the worktree
    target = os.path.realpath(os.path.join(repo.working_tree_dir, new_path))
    if not target.startswith(os.path.realpath(repo.working_tree_dir) + os.sep):
        raise ValueError("Target path escapes repository")
    submodule.move(new_path)

Published fix

Public sources link this CVE to the changes below. The code samples above were generated to illustrate the defect; these links lead to the code the project actually changed.

Cite this entry

@misc{vaitp:cve2026110860,
  title        = {{Symlink-following flaw in GitPython Submodule.move() allows path traversal via crafted symlinks.}},
  author       = {Bogaerts, Fr\'ed\'eric and Ivaki, Naghmeh and Fonseca, Jos\'e},
  year         = {2026},
  note         = {VAITP Python Vulnerability Dataset, entry CVE-2026-110860},
  howpublished = {\url{https://netpack.pt/vaitp/vulnerability/CVE-2026-110860/}}
}

Download this entry as JSON Download the whole dataset

Introducing the "VAITP dataset": a specialized repository of Python vulnerabilities and patches, meticulously compiled for the use of the security research community. As Python's prominence grows, understanding and addressing potential security vulnerabilities become crucial. Crafted by and for the cybersecurity community, this dataset offers a valuable resource for researchers, analysts, and developers to analyze and mitigate the security risks associated with Python. Through the comprehensive exploration of vulnerabilities and corresponding patches, the VAITP dataset fosters a safer and more resilient Python ecosystem, encouraging collaborative advancements in programming security.

The supreme art of war is to subdue the enemy without fighting.

Sun Tzu – “The Art of War”

:: Shaping the future through research and ingenuity ::

Before you use the VAITP AI models

Please read and accept the following disclaimer:

By choosing "I understand and accept", you acknowledge that you understand and agree to these terms.