CVEReports
CVEReports

Automated vulnerability intelligence platform. Comprehensive reports for high-severity CVEs generated by AI.

Product

  • Home
  • Sitemap
  • RSS Feed

Company

  • About
  • Contact
  • Privacy Policy
  • Terms of Service

© 2026 CVEReports. All rights reserved.

Made with love by Amit Schendel & Alon Barad



GHSA-WVPP-8HX9-P66J

GHSA-WVPP-8HX9-P66J: Arbitrary Command Execution via Option Guard Bypass in GitPython

Alon Barad
Alon Barad
Software Engineer

Aug 7, 2026·8 min read·42 visits

Executive Summary (TL;DR)

GitPython prior to 3.1.58 allows arbitrary command execution when executing git commands with split_single_char_options=False due to validation desynchronization.

An unsafe option guard bypass vulnerability exists in GitPython before version 3.1.58. When keyword arguments are passed to Git commands with split_single_char_options=False, GitPython's argument validation helper fails to inspect the combined short-option value. This discrepancy allows short-option token smuggling or clustering manipulation, enabling remote attackers to bypass option blocklists and execute arbitrary system commands.

Vulnerability Overview

GitPython is an open-source Python library designed to provide a native programmatic interface for interacting with Git repositories. Applications rely on this package to automate complex git operations such as cloning remote repositories, checking out branches, and managing revision histories. The library acts as a high-level wrapper, serializing Python functions and keyword arguments into command-line parameters that are eventually passed to the system's local Git binary via the standard subprocess module.

Because GitPython interacts directly with a shell-executable binary, any application that passes untrusted user input directly to GitPython commands exposes a severe attack surface. To mitigate the risk of parameter injection, GitPython implements an internal security validation layer. This layer checks options against a list of dangerous parameters (such as --upload-pack or -u) that could allow external command execution. If any blocked options are detected, the system raises an exception and halts execution.

This security advisory focuses on a technical flaw in this safety validation logic designated as GHSA-WVPP-8HX9-P66J. The vulnerability is classified under CWE-88 (Improper Neutralization of Argument Delimiters in a Command) and manifests when keyword arguments are formatted with the option split_single_char_options=False. In this configuration, GitPython fails to evaluate combined short-option flags properly, introducing a logic gap that enables unauthenticated remote code execution via short-option smuggling.

When exploitation is successful, an attacker can bypass all internal safety blacklists and force the host operating system to execute arbitrary binaries or scripts. The flaw does not require authentication and can be triggered remotely if an application exposes Git wrappers (such as cloning configurations) to external web inputs. The vulnerability affects all versions of GitPython prior to version 3.1.58.

Root Cause Analysis

The underlying root cause of GHSA-WVPP-8HX9-P66J lies in a logical desynchronization between two key internal functions inside GitPython's execution wrapper: transform_kwargs and _option_candidates. The transform_kwargs function is responsible for converting Python keyword arguments into actual string arguments for command-line serialization. Conversely, the _option_candidates function extracts and normalizes these parameters for safety analysis, ensuring they do not match restricted elements in check_unsafe_options.

When developers supply single-character keyword arguments (such as n="value"), the split_single_char_options boolean flag controls how the parameters are serialized. If set to True, the library splits them into discrete arguments: the flag and its parameter (e.g., ["-n", "value"]). If configured to False, the serializer merges them into a single string (e.g., ["-nvalue"]). The core vulnerability is triggered when split_single_char_options=False because _option_candidates and transform_kwargs handle the merged token unsafely.

During argument parsing, _option_candidates extracted only the primary single-character key (e.g., -n) and completely discarded the attached value (e.g., uhelper). Consequently, the safety engine evaluated only the safe -n option, allowing the command to proceed. However, when transform_kwargs subsequently generated the final command string, it created the merged option -nuhelper.

When the resulting argument list is passed to the underlying git binary, the executable parses the combined string according to POSIX short-option clustering rules. Git interprets the string character by character: -n is treated as a safe option, the subsequent u is treated as a nested short option (equivalent to -u or --upload-pack), and the remaining helper string is bound as the argument for -u. By smuggling the unsafe -u option within a benign single-character key, attackers successfully bypass the blocklist.

Code-Level Vulnerability and Patch Analysis

To understand the exact mechanics of the desynchronization, we analyze the vulnerable implementation of _option_candidates in git/cmd.py alongside the corrective patch implemented in version 3.1.58. The fix was committed under hash 96a888f4d782cb2f80452148e48e60ce4af6d541.

In the vulnerable implementation, the logic for handling keyword arguments inside _option_candidates was as follows:

# Vulnerable logic inside git/cmd.py
key = str(key)
options.append(f"-{key}" if len(key) == 1 else f"--{dashify(key)}")
if len(key) == 1 and split_single_char_options:
    options.extend(
        str(value)
        for value in values
        if value is not True and value not in (False, None) and str(value).startswith("-")
    )

Notice that if split_single_char_options was False, the if condition was skipped entirely. The generator appended only the base flag (-{key}) to the candidate list and ignored value completely. Because the validation engine lacked visibility into the concatenated string, check_unsafe_options remained unaware of the nested command parameters.

To resolve this desynchronization, the developers restructured the conditional branches to handle the split_single_char_options=False scenario explicitly. The patch modified git/cmd.py as follows:

# Patched implementation in git/cmd.py (GitPython >= 3.1.58)
key = str(key)
if len(key) != 1:
    options.append(f"--{dashify(key)}")
elif split_single_char_options:
    options.append(f"-{key}")
    options.extend(
        str(value)
        for value in values
        if value is not True and value not in (False, None) and str(value).startswith("-")
    )
else:
    # Correctly reconstruct the merged short option for validation
    options.extend(
        f"-{key}" if value is True else f"-{key}{value}"
        for value in values
        if value is True or (value is not False and value is not None)
    )

This new branch ensures that when split_single_char_options=False, the exact string generated for subprocess execution (-{key}{value}) is also appended to the options candidate list. Consequently, passing n="uhelper" now produces the validation candidate -nuhelper. Since the validation engine matches candidates using substring checks, this correctly triggers a blocklist exception on the smuggled u parameter.

The implemented fix is robust for the evaluated single-character path. However, security researchers should note that long option keys (e.g., len(key) != 1) still only append --{dashify(key)} to candidates and do not inspect the associated value parameter in _option_candidates. While Git's parsing of long options is less susceptible to POSIX short-option clustering, developers must ensure that no custom command wrappers treat long-option values as secondary arguments.

Attack Methodology and Proof of Concept

Exploiting this vulnerability requires specific environment conditions. First, the target application must utilize GitPython to interact with Git repositories. Second, the application must expose an execution interface where external input directly controls keyword arguments. Third, either the application or the developer's custom configuration must specify split_single_char_options=False during command execution.

Consider a vulnerable Python web application that allows users to clone repositories and configure specific Git flags through a query parameter. The following proof-of-concept script demonstrates how an attacker can leverage this configuration to execute arbitrary system binaries:

# Vulnerable Application Context (GitPython < 3.1.58)
from git import Git
from git.exc import UnsafeOptionError
 
git_client = Git()
 
# Malicious payload designed to execute an external helper binary
# under the guise of an 'n' (no-checkout) flag value.
user_supplied_option = "utouch /tmp/pwned;git-upload-pack"
 
try:
    # The application processes arguments with split_single_char_options disabled
    git_client.clone(
        "https://github.com/example/repo.git", 
        n=user_supplied_option, 
        split_single_char_options=False
    )
except Exception as e:
    print(f"Execution resulted in: {e}")

When this script runs, the internal workflow triggers as follows:

  1. The clone wrapper receives n="utouch /tmp/pwned;git-upload-pack" and split_single_char_options=False.
  2. The validation layer calls _option_candidates which generates ["-n"] (the payload value is omitted).
  3. The safety filter check_unsafe_options checks if -n is blocked. Because -n is safe, the validation passes.
  4. The argument serializer transform_kwargs constructs the actual parameter list: ["-nutouch /tmp/pwned;git-upload-pack"].
  5. GitPython invokes the local git binary using subprocess.Popen.
  6. The git executable parses the parameter as -n (no-checkout) and -u (upload-pack) with the value touch /tmp/pwned;git-upload-pack.
  7. Git launches the touch /tmp/pwned;git-upload-pack process as the upload-pack backend, executing the attacker's arbitrary command on the host.

This exploitation flow demonstrates how minor desynchronizations in argument tokenization lead directly to complete command-injection pathways, bypassing all intended blacklist validation layers.

Security Impact and Remediation Guidance

The security impact of GHSA-WVPP-8HX9-P66J is critical, carrying an estimated CVSS v3.1 score of 9.8. Because GitPython is widely used in continuous integration and continuous deployment (CI/CD) pipelines, automated build platforms, and developer tooling, an argument injection vulnerability of this nature poses severe risks. An attacker who successfully exploits this flaw achieves unauthenticated remote code execution (RCE) within the context of the running application process.

Depending on the privileges of the host process, RCE can lead to full system compromise, lateral movement within internal networks, and unauthorized access to intellectual property such as source code repositories. In containerized environments, attackers may exploit this vector to escape containers or access cloud metadata services to harvest sensitive credentials.

To mitigate this vulnerability, system administrators and developers must take immediate action. The primary remediation strategy is upgrading the GitPython package to version 3.1.58 or higher, which incorporates the corrected _option_candidates validation logic. Upgrading can be performed via the standard Python package manager:

pip install --upgrade GitPython>=3.1.58

If immediate upgrading is not feasible, developers should implement defensive programming workarounds. Avoid disabling split_single_char_options when processing untrusted inputs. Additionally, implement robust input validation filters to reject any keyword values that begin with letters matching dangerous short-options (such as u or c), or strictly sanitize input against alphanumeric character sets. Organizations can also deploy Semgrep static analysis rules within their development pipelines to flag any vulnerable occurrences of split_single_char_options=False in their source code repositories.

Official Patches

gitpython-developersOfficial Fix Commit

Fix Analysis (1)

Technical Appendix

CVSS Score
9.8/ 10
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H

Affected Systems

GitPython

Affected Versions Detail

Product
Affected Versions
Fixed Version
GitPython
gitpython-developers
< 3.1.583.1.58
AttributeDetail
CWE IDCWE-88
Attack VectorNetwork
CVSS v3.19.8 (Critical)
EPSS ScoreN/A
ImpactRemote Command Execution (RCE)
Exploit StatusProof of Concept (PoC)
CISA KEV StatusNot Listed

MITRE ATT&CK Mapping

T1202Indirect Command Execution
Execution
T1059Command and Scripting Interpreter
Execution
T1218System Binary Execution Proxy
Defense Evasion
CWE-88
Improper Neutralization of Argument Delimiters in a Command ('Argument Injection')

The product constructs a command-line string or command array using input from an upstream source, but it does not neutralize or incorrectly neutralizes argument delimiters, allowing an attacker to supply additional command-line arguments.

Vulnerability Timeline

Vulnerability reported to developers
2026-08-02
Fix committed to repository and PR merged
2026-08-02
GitPython version 3.1.58 published with fix
2026-08-02
Public advisory GHSA-WVPP-8HX9-P66J released
2026-08-02

References & Sources

  • [1]GitPython Fix Commit
  • [2]GitPython Pull Request #2204
  • [3]GitPython 3.1.58 Release Announcement

Attack Flow Diagram

Press enter or space to select a node. You can then use the arrow keys to move the node around. Press delete to remove it and escape to cancel.
Press enter or space to select an edge. You can then press delete to remove it or escape to cancel.

More Reports

•14 minutes ago•CVE-2026-105745
6.7

CVE-2026-105745: Arbitrary Code Execution via Malicious Entrypoint Discovery in Docling base_factory

Docling prior to version 2.131.0 is vulnerable to arbitrary local code execution during module initialization due to incorrect order of operations in its plugin discovery system. Even when the default option to reject external plugins is active, Docling utilizes Pluggy to scan and import entrypoints before performing namespace validation.

Amit Schendel
Amit Schendel
0 views•6 min read
•about 1 hour ago•CVE-2026-105749
6.5

CVE-2026-105749: Unbounded Table Attributes in Docling Backends Leads to Resource Exhaustion

An uncontrolled resource consumption vulnerability exists in the Docling document conversion library. Maliciously structured HTML, JATS, ODS, or BoxNote inputs containing table cells with excessively large 'rowspan' or 'colspan' attribute values trigger algorithmic complexity conditions. This allows unauthenticated remote attackers to initiate resource exhaustion states, crashing or hanging the target document processing pipeline while bypassing configured timeouts.

Amit Schendel
Amit Schendel
7 views•6 min read
•about 2 hours ago•CVE-2026-105748
4.3

CVE-2026-105748: Local File Inclusion and Arbitrary File Disclosure in Docling Document Parser

A Local File Inclusion (LFI) and Arbitrary File Disclosure vulnerability exists in Docling and Docling Slim versions >= 2.16.0 up to 2.131.0. When parsing serialized DoclingDocument structures using the JSON input format, the backend fails to restrict image URI schemes, allowing remote attackers to retrieve local files and verify path existence on the host system during embedded document export.

Amit Schendel
Amit Schendel
6 views•5 min read
•about 3 hours ago•CVE-2026-105744
7.5

CVE-2026-105744: Arbitrary File Read and Remote Code Execution in Docling Tectonic Engine

Docling, a tool for parsing and processing diverse document formats, is vulnerable to arbitrary file read, arbitrary file write, and potential remote code execution (RCE) in versions 2.94.0 through 2.131.0. The vulnerability occurs when applications configure Docling to use the Tectonic engine for rendering TikZ diagrams into images. Because the compilation did not restrict hazardous TeX primitives or sandbox the environment, an attacker can supply crafted documents containing malicious TikZ definitions to access or modify local files and execute arbitrary commands under the privileges of the processing application.

Amit Schendel
Amit Schendel
7 views•7 min read
•about 4 hours ago•CVE-2026-105743
4.0

CVE-2026-105743: Server-Side Request Forgery Guard Bypass in Docling Document Conversion Engine

An SSRF guard bypass vulnerability in the Docling document conversion engine allows unauthenticated attackers to bypass internal IP access controls. The vulnerability exists due to a DNS rebinding Time-of-Check Time-of-Use (TOCTOU) condition, URL authority parsing inconsistencies, and unvalidated network requests triggered during headless browser page rendering.

Amit Schendel
Amit Schendel
6 views•6 min read
•about 5 hours ago•CVE-2026-105742
3.7

CVE-2026-105742: Sensitive Custom Header Leakage in Docling Image Resource Loader

A technical analysis of CVE-2026-105742 (GHSA-p3fw-7699-7926), a sensitive information disclosure vulnerability in the Docling document processing library. Vulnerable versions of Docling indiscriminately forward custom HTTP headers, such as authentication tokens, to arbitrary third-party origins and during cross-origin redirects while fetching remote image assets from untrusted HTML and EPUB documents.

Alon Barad
Alon Barad
6 views•6 min read