VAITP Dataset

← Back to the dataset

CVE-2026-110857

Remote code execution via unvalidated Git.ls_remote URLs (ext:: transport).

  • CVSS 7.7
  • CWE-1287
  • Input Validation and Sanitization
  • Remote

GitPython before 3.2.0 contains a remote code execution vulnerability that allows attackers to run commands because Git.ls_remote forwards URLs without check_unsafe_protocols validation. Attackers can supply ext:: remote-helper URLs to execute commands when git permits the ext transport, while merge_base and IndexFile.move also accept unguarded option injection.

CVSS base score
7.7
Published
2026-10-14
OWASP
A03 Injection
Orthogonal defect classification
Checking
Code defect classification
Missing Check
Category
Input Validation and Sanitization
Subcategory
Command Injection
Accessibility scope
Remote
Impact
Arbitrary Code Execution
Affected component
GitPython
Fixed by upgrading
Yes

Solution

Upgrade GitPython to version 3.2.0 or newer.

Vulnerable code sample

import git

def fetch_refs(remote_url: str):
    """
    Retrieve remote references using GitPython's ls_remote.
    """
    repo = git.Repo.init("/tmp/repo")
    # VULNERABLE: forwards unvalidated remote URL to git, allowing ext:: helper execution
    refs = repo.git.ls_remote(remote_url)
    return refs.splitlines()

Patched code sample

import git
from urllib.parse import urlparse

def fetch_refs(remote_url: str):
    """
    Retrieve remote references using GitPython's ls_remote with protocol validation.
    """
    repo = git.Repo.init("/tmp/repo")
    # FIX: reject unsafe protocols before passing URL to git
    parsed = urlparse(remote_url)
    if parsed.scheme not in ("ssh", "https", "http", "git"):
        raise ValueError("Unsupported remote protocol")
    refs = repo.git.ls_remote(remote_url)
    return refs.splitlines()

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:cve2026110857,
  title        = {{Remote code execution via unvalidated Git.ls_remote URLs (ext:: transport).}},
  author       = {Bogaerts, Fr\'ed\'eric and Ivaki, Naghmeh and Fonseca, Jos\'e},
  year         = {2026},
  note         = {VAITP Python Vulnerability Dataset, entry CVE-2026-110857},
  howpublished = {\url{https://netpack.pt/vaitp/vulnerability/CVE-2026-110857/}}
}

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.