VAITP Dataset

← Back to the dataset

CVE-2026-67324

GitPython 3.1.50 allows -u to bypass unsafe‑option block, enabling malicious upload‑pack.

  • CVSS 9.3
  • CWE-78
  • Input Validation and Sanitization
  • Remote

GitPython 3.1.50 fails to recognize joined short-option forms such as -u (the short form of –upload-pack=) when enforcing its default unsafe-option gate. When an application passes attacker-influenced clone options into Repo.clone_from(…, multi_options=…, allow_unsafe_options=False), an attacker can supply -u to bypass the gate that blocks –upload-pack/-u, causing Git to execute the specified helper command during clone. Fixed in 3.1.51.

CVSS base score
9.3
Published
2026-08-01
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.1.51 (or later) to apply the fix.

Vulnerable code sample

from git import Repo

def clone_repository(url: str, dest: str, extra_opts: list):
    """
    Clone a repository, allowing only safe Git options.
    `extra_opts` may come from untrusted input.
    """
    # VULNERABLE: short option -u bypasses unsafe-option gate
    Repo.clone_from(
        url,
        dest,
        multi_options=extra_opts,
        allow_unsafe_options=False
    )

Patched code sample

from git import Repo

def clone_repository(url: str, dest: str, extra_opts: list):
    """
    Clone a repository, allowing only safe Git options.
    `extra_opts` may come from untrusted input.
    """
    # FIX: reject short option -u or translate to safe long form
    safe_opts = [
        opt for opt in extra_opts
        if not opt.startswith("-u")  # block short -u
    ]
    Repo.clone_from(
        url,
        dest,
        multi_options=safe_opts,
        allow_unsafe_options=False
    )

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:cve202667324,
  title        = {{GitPython 3.1.50 allows -u to bypass unsafe‑option block, enabling malicious upload‑pack.}},
  author       = {Bogaerts, Fr\'ed\'eric and Ivaki, Naghmeh and Fonseca, Jos\'e},
  year         = {2026},
  note         = {VAITP Python Vulnerability Dataset, entry CVE-2026-67324},
  howpublished = {\url{https://netpack.pt/vaitp/vulnerability/CVE-2026-67324/}}
}

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.