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-RPM5-65CW-6HJ4

GHSA-RPM5-65CW-6HJ4: Command Injection via Git Options Bypass in GitPython

Amit Schendel
Amit Schendel
Senior Security Researcher

Apr 27, 2026·7 min read·95 visits

Executive Summary (TL;DR)

GitPython < 3.1.45 fails to properly filter dangerous Git options when supplied via Python keyword arguments. Attackers can bypass security checks by using underscores instead of hyphens (e.g., `upload_pack` instead of `upload-pack`), resulting in arbitrary remote code execution via the underlying Git executable.

GitPython versions prior to 3.1.45 are vulnerable to a command injection flaw due to an architectural logic error in how keyword arguments are sanitized. The library attempts to block dangerous Git options like `--upload-pack` but performs this validation before applying Pythonic underscore-to-hyphen normalization. This allows attackers to bypass the blocklist using underscore-formatted arguments, leading to arbitrary command execution when the underlying Git binary is invoked.

Vulnerability Overview

GitPython is a Python library used to interact with Git repositories, providing an object-oriented wrapper around the underlying Git command-line interface. Developers frequently use this library to programmatically clone, fetch, pull, and manipulate repositories. The vulnerability, identified as GHSA-RPM5-65CW-6HJ4, exists within the parameter processing pipeline where Python keyword arguments are translated into Git command-line options.

To bridge Python conventions and POSIX command-line flags, GitPython allows developers to pass keyword arguments (kwargs) using underscores, which the library automatically normalizes into hyphens. For example, passing upload_pack='...' in Python translates to --upload-pack='...' at the command line. This normalization is a core feature designed to maintain Python code readability while adhering to Git's expected argument syntax.

GitPython maintains a security blocklist to prevent the injection of dangerous Git options that natively support command execution, such as --upload-pack, --receive-pack, and --extcmd. The vulnerability occurs because the library executes this security validation step before performing the underscore-to-hyphen normalization. Consequently, an attacker can supply the dangerous arguments in their pre-normalized underscore form to bypass the security filter entirely.

Once the validation step completes successfully, GitPython normalizes the malicious keyword argument and passes the hyphenated flag to the Git subprocess. This results in the execution of arbitrary operating system commands with the privileges of the Python process invoking the Git wrapper.

Root Cause Analysis

The root cause of GHSA-RPM5-65CW-6HJ4 is an architectural sequencing error in the input sanitization pipeline. Effective input validation mandates that data must be normalized to its final, canonical representation before any security checks are applied. GitPython violates this principle by evaluating the input in its raw form rather than its normalized execution form.

When a developer invokes a Git command via the GitPython API, the library packages the provided keyword arguments into a dictionary. The security function iterates over the keys in this dictionary, checking against a hardcoded list of restricted strings. The blocklist specifically contains the standard Git command-line formats, specifically upload-pack, receive-pack, and extcmd.

If the dictionary key is provided as upload_pack, the string comparison against the blocklist fails, and the security check permits the argument. Following this validation, the library's command builder processes the dictionary to construct the actual shell command string. During this phase, it replaces all underscores in the dictionary keys with hyphens to match Git's parameter requirements.

The normalized dictionary keys are then concatenated with their respective values and appended to the Git binary path. The resulting command array is passed to Python's subprocess execution module. By processing the validation phase prematurely, GitPython guarantees that the command builder will subsequently mutate the validated input into an unsafe state, completely nullifying the intended security controls.

Code Analysis and Execution Flow

Understanding the vulnerability requires analyzing the exact data flow of the keyword arguments. The flaw exists in the method responsible for transforming the **kwargs dictionary into the final list of arguments passed to the subprocess.Popen call.

The implementation flaw is evident in the execution order. The Python dictionary {'upload_pack': 'touch /tmp/pwned'} is passed to the validation routine. The routine checks for the literal string upload-pack. Since upload_pack (with an underscore) does not match upload-pack (with a hyphen), no exception is raised.

After the validation loop completes, a separate processing loop handles the command string assembly. This loop takes upload_pack, runs a string replace operation for underscores, and yields --upload-pack. It then appends the provided value, resulting in --upload-pack=touch /tmp/pwned.

The patch for this vulnerability involves shifting the validation logic to occur after the normalization step, or explicitly checking both the underscore and hyphenated variations of the dangerous parameters. By normalizing the dictionary keys to their canonical hyphenated state first, the security check correctly identifies the prohibited arguments regardless of how they were initially formatted in the Python code.

Exploitation and Attack Vector

Exploitation of this vulnerability requires the application using GitPython to accept user-controlled input and apply it as a keyword argument to a Git command execution function. This pattern is increasingly common in automated CI/CD pipelines, repository management tools, and "agentic" AI systems that dynamically generate operational commands based on user prompts.

An attacker crafts a malicious payload targeting a remote Git operation, such as clone, fetch, pull, or push. The payload specifies the upload_pack argument, utilizing the underscore format to ensure the application processes it without triggering the built-in GitPython exception. The value of this argument contains the actual operating system commands the attacker wishes to execute.

import git
 
# The attacker controls this input variable via a web form or API endpoint
dangerous_option = "touch /tmp/pwned"
 
repo = git.Repo.init("/tmp/test-repo")
# The developer passes the user input as a keyword argument
# The underscore bypasses the GitPython security blocklist
repo.git.fetch(upload_pack=dangerous_option)

When the vulnerable application processes this code, GitPython constructs and executes the command git fetch --upload-pack='touch /tmp/pwned'. The git fetch operation natively supports the --upload-pack parameter to specify the path to the git-upload-pack binary on the remote end. However, Git executes the provided string as a shell command to initialize the pack transfer, resulting in immediate arbitrary code execution on the local host processing the fetch request.

Impact Assessment

The vulnerability enables arbitrary OS command execution, representing a critical risk to systems utilizing vulnerable versions of GitPython. The injected commands execute with the identical permissions and environment variables of the Python application hosting the GitPython library.

In environments where GitPython operates as part of a backend web service or API, successful exploitation yields a full remote shell or direct access to the underlying filesystem. Attackers can leverage this foothold to exfiltrate sensitive data, manipulate internal databases, or extract environment variables containing secondary authentication tokens, such as AWS credentials or database passwords.

This vulnerability is particularly consequential for AI-driven development tools and automated repository management systems. These platforms frequently parse user instructions or arbitrary repository data and map them into dynamically constructed Git commands. If these inputs dictate the keyword arguments passed to the GitPython wrapper, the system is immediately vulnerable to complete compromise without requiring authentication bypasses in the primary web application.

Remediation and Mitigation

The definitive remediation for this vulnerability is upgrading GitPython to version 3.1.45 or later. The patched release restructures the validation logic to accurately identify and block dangerous Git options, even when they are supplied using Python's underscore-based keyword argument syntax. Organizations should update dependencies via pip, poetry, or their respective package managers immediately.

If upgrading is not operationally feasible in the short term, developers must implement strict input validation at the application layer. Before passing any dynamic dictionary or user-controlled input to GitPython via **kwargs, the application must manually inspect all keys. Any keys matching upload_pack, receive_pack, extcmd, or their hyphenated equivalents must be explicitly rejected.

Furthermore, developers should adopt a strict allowlist approach when mapping untrusted data to system command interfaces. Avoid dynamically expanding untrusted dictionaries directly into function calls. Instead, map specific, expected user inputs to hardcoded arguments within the application logic, ensuring that arbitrary Git options cannot be introduced into the command pipeline regardless of library-level validation failures.

Official Patches

GitPython DevelopersGitPython 3.1.45 Release Notes

Technical Appendix

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

Affected Systems

GitPython LibraryAgentic AI tools leveraging GitPythonAutomated CI/CD pipelines using GitPython

Affected Versions Detail

Product
Affected Versions
Fixed Version
GitPython
gitpython-developers
< 3.1.453.1.45
AttributeDetail
CWE IDCWE-78: Improper Neutralization of Special Elements used in an OS Command
Attack VectorNetwork / Context Dependent
ImpactRemote Code Execution (RCE)
CVSS Score8.8 (Estimated)
Exploit StatusProof of Concept Available
Vulnerable ComponentGit command wrappers (`repo.git.*`)

MITRE ATT&CK Mapping

T1059.004Command and Scripting Interpreter: Unix Shell
Execution
T1190Exploit Public-Facing Application
Initial Access
CWE-78
OS Command Injection

The software constructs all or part of an OS command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended OS command when it is sent to a downstream component.

Known Exploits & Detection

Researcher ContextProof of concept demonstrates bypassing blocklist via upload_pack kwarg to execute touch /tmp/pwned.

Vulnerability Timeline

Security Advisory Published
2025-05-14
Patch Released in version 3.1.45
2025-07-24

References & Sources

  • [1]GitHub Advisory Database: GHSA-rpm5-65cw-6hj4
  • [2]GitPython Release Notes (3.1.45)
  • [3]Snyk Vulnerability Database
  • [4]Miggo Vulnerability Database

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

•1 day ago•CVE-2026-16454
4.3

CVE-2026-16454: Object-Level Authorization Bypass in Eclipse hawkBit Direct Device Integration Controller

CVE-2026-16454 is an object-level authorization bypass vulnerability (CWE-284, CWE-862) in Eclipse hawkBit versions 1.0.3 and prior. The flaw exists within the Direct Device Integration (DDI) REST controller (hawkbit-ddi-resource), where endpoints responsible for enumerating software module metadata and serving firmware binaries fail to verify whether the requested software module is assigned to the authenticated device. Consequently, any device with valid credentials (such as a TargetToken or GatewayToken) can enumerate software module identifiers and download arbitrary firmware artifacts across the entire tenant namespace.

Amit Schendel
Amit Schendel
10 views•9 min read
•2 days ago•CVE-2026-62284
8.6

CVE-2026-62284: Remote Code Execution and SSRF via Unsanitized Kubeconfig in OSAC Operator

CVE-2026-62284 (GHSA-5w5g-j6hw-6p8f) is a code injection and server-side request forgery vulnerability in the console-proxy component of the OSAC Operator. The RemoteConfigResolver parses Kubernetes Secrets containing kubeconfig files via clientcmd.RESTConfigFromKubeConfig without sanitizing execution-related fields. An attacker with RBAC permissions to create or modify labeled Secrets in monitored namespaces can supply a malicious exec credential plugin, resulting in arbitrary command execution within the console-proxy pod.

Amit Schendel
Amit Schendel
8 views•8 min read
•2 days ago•CVE-2026-62361
5.5

CVE-2026-62361: Authenticated SQL Injection and Table Access Control Bypass in Listmonk Subscriber Export

CVE-2026-62361 (GHSA-xgjr-7j9q-2h4r) is an authenticated SQL injection and authorization bypass vulnerability in listmonk, an open-source, self-hosted newsletter and mailing list manager written in Go. In versions prior to 6.2.0, the subscriber export endpoint (GET /api/subscribers/export) directly interpolates user-supplied SQL filter expressions into a PostgreSQL query without invoking the table allowlist validation function (validateQueryTables). Consequently, authenticated users possessing the subscribers:sql_query and subscribers:get_all permissions can bypass relational access controls, execute arbitrary subqueries against restricted tables such as users and settings, and modify database state via writable Common Table Expressions (CTEs).

Alon Barad
Alon Barad
9 views•11 min read
•2 days ago•CVE-2026-28385
5.0

CVE-2026-28385: Server-Side Request Forgery in Canonical LXD Image Import

CVE-2026-28385 (GHSA-3gq2-x4qg-p4g6) is a Server-Side Request Forgery (SSRF) vulnerability in Canonical LXD versions 4.12 through 6.9. An authenticated user possessing the can_create_images entitlement can force the LXD daemon to execute arbitrary outbound HTTP and HTTPS requests via the /1.0/images API endpoint. Due to the absence of egress destination validation, an attacker can probe host loopback services, RFC 1918 private network segments, and cloud Instance Metadata Services (IMDS) from the network position of the privileged LXD daemon.

Amit Schendel
Amit Schendel
10 views•9 min read
•2 days ago•GHSA-9J25-MM2H-2F76
9.9

CVE-2026-48750: Arbitrary File Write on Host via exec-output Symlink in Canonical LXD and Incus

Canonical LXD and LXC Incus contain an arbitrary file write vulnerability (CWE-73 / CWE-59) in the `/1.0/instances/<name>/exec` REST API endpoint. When an instance is unpacked from an image archive, top-level symbolic links are extracted directly onto the host filesystem within the instance storage directory. If a crafted image includes a symbolic link named `exec-output` pointing to an arbitrary host path, invoking the execution endpoint with `record-output: true` causes the privileged host daemon to follow the symlink and write command output files directly to the target host directory. An authenticated attacker with permissions to import images and execute commands can exploit this flaw to write controlled content to sensitive host directories such as `/etc/cron.d`, resulting in arbitrary code execution on the host as `root`.

Alon Barad
Alon Barad
8 views•12 min read
•2 days ago•GHSA-VGHH-5RFX-XHQ8
9.9

CVE-2026-48749: Arbitrary Host File Read and Write via Malicious Image Symlink in Canonical LXD and Incus

CVE-2026-48749 (tracked as GHSA-vghh-5rfx-xhq8 for LXD and GHSA-2q3f-q5pq-g8wv for Incus) is a critical container escape vulnerability in the Canonical LXD and Linux Containers Incus system container managers. By importing a specially crafted container image archive containing duplicate tar member headers, an authenticated attacker can replace the instance rootfs directory with a symbolic link pointing to the underlying host root filesystem. When performing file operations on a stopped container, the privileged forkfile helper binary resolves the symbolic link without confinement and chroots directly into the host filesystem, granting arbitrary root-level file read and write access.

Amit Schendel
Amit Schendel
8 views•9 min read