Attack ChainAIDerived
Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain
-
AccessAttacker submits output=<victim_path> via application interface
-
DeliveryApplication forwards user options dict to commit.count(**user_options) without sanitization
-
ExploitUnsanitized output= argument reaches git rev-list subprocess via commit.py:290-291
-
Executiongit rev-list opens and truncates target file to 0 bytes
-
PersistTarget file destroyed at process privilege level
-
ImpactService disruption or configuration corruption
Vulnerability Assessment
| Weakness |
CWE
OWASP Top 10:2025
A05:2025 - Injection
ASVS 5.0
V1 - Encoding and Sanitization Argument sanitization
|
| Exploitation Conditions | The vulnerable application must explicitly forward a user-controlled keyword arguments dictionary to Commit.count() - specifically, the attacker must be able to supply the output= key in that dict. This is not the default usage of GitPython; it requires an application design decision to route external input into **kwargs. The injection does not affect Commit.count() called with no user-controlled arguments, nor does it affect iter_commits() or iter_items(), both of which raise UnsafeOptionError on the same payload. Exploitation is further limited by impact class: attackers gain only 0-byte truncation (no content control), and the set of targetable files is bounded by the OS privilege level of the running process. The application must use self.hexsha internally - ref control is not needed, reducing the precondition to option-key control only. |
| Impact | The provided CVSS 4.0 vector (AV:N/AC:L/AT:N/PR:L/UI:N) scores 5.3 (Medium), reflecting network reachability and low complexity once an application routes user input into Commit.count(), but constrained by the PR:L requirement and limited VI:L/VA:L impact (no content control, no confidentiality loss). Real-world risk is tightly conditional: exploitation requires an application to explicitly forward a user-controlled options dict to count(), a pattern previously seen in GHSA-956x-8gvw-wg5v's archive(**kwargs) sink, meaning the attack surface is real but not universal. The raw score may underweight impact in privileged deployments where zero-byte truncation of config files, key material, or database files could cause cascading service failure. No CISA KEV listing is present, and no EPSS signal is available in the provided data to cross-reference exploitation probability - this gap should be monitored. The published proof-of-concept in the GHSA advisory lowers the technical bar for exploitation in vulnerable application patterns. The CVSS AC:L assessment by the reporter contrasts with the application-dependent precondition; defenders should treat this as AC:H in practice unless their codebase is confirmed to forward user options to count(). |
| Exploit ScenarioDerived | A CI/CD dashboard or code-review application that accepts user-specified rev-list options and forwards them to Commit.count() - for instance, to support custom commit filtering - would allow an authenticated user to submit output=/etc/app/config.ini as an option. The underlying git rev-list subprocess would truncate that file to zero bytes, corrupting application configuration or destroying key material without the attacker ever needing write access to the filesystem directly. A proof-of-concept demonstrating this exact truncation was verified by the researcher on GitPython tag 3.1.53 and is published in GHSA-p538-c434-8v24. |
Get an e-mail when this CVE is exploited, patched or re-scored. Free account.
Alert meAnalysisAIv1 – Aug 13, 2026
Arbitrary file truncation in GitPython before 3.1.56 enables an attacker who can control keyword arguments forwarded to Commit.count() to blank any file accessible at the process's privilege level by injecting output=<path>, which causes git rev-list to open and truncate the target to zero bytes before revision parsing. The unguarded sink at commit.py:290-291 is a distinct, overlooked parallel to the sibling iter_items method, which carries the check_unsafe_options guard; this gap persisted after GHSA-956x-8gvw-wg5v addressed iter_commits and blame. No CISA KEV listing is present, but a proof-of-concept was verified on tag 3.1.53 and is published in the GHSA advisory.
RemediationAI
Upgrade GitPython to version 3.1.56, which applies the check_unsafe_options guard to Commit.count() in parity with the protection already present in iter_items; this is the only confirmed fix. The upstream patch is available via PR #2184 (https://github.com/gitpython-developers/GitPython/pull/2184) and commit 38553b6fddc7f6a667cdb45a6762343a08fc72b2. The vendor advisory is at https://github.com/gitpython-developers/GitPython/security/advisories/GHSA-p538-c434-8v24. If immediate upgrade is blocked, audit every call site that invokes Commit.count() with external or user-derived kwargs and add an explicit allowlist of safe rev-list options before forwarding - rejecting the output key is a targeted, low-side-effect control. Because the attack requires the application to route user input into the method's keyword arguments, a code-level review of option-forwarding patterns across all GitPython call sites (count, but also any other **kwargs sinks not yet identified) is an effective interim measure with no operational trade-offs.
Affected VersionsENISA
Affected Packages
Source: OSV (Open Source Vulnerabilities)
Affects your stack
Affects 1 package in pypi
Checking this CVE against your own stacks and servers is part of the Basic plan and up.
Technical ContextAI · show details
GitPython (cpe:2.3:a:gitpython-developers:gitpython:*:*:*:*:*:*:*:*) is a Python library abstracting Git subprocess invocations. The root cause is CWE-88 (Argument Injection): commit.py:290-291 executes self.repo.git.rev_list(self.hexsha, **kwargs) with no call to check_unsafe_options and no allow_unsafe_options parameter, meaning any caller-supplied keyword argument reaches the git subprocess unfiltered. Git's rev-list accepts --output=<path>, which causes it to open the named path for writing and truncate it to zero bytes as a side-effect of normal operation, even before any commits are enumerated. The sibling method iter_items (commit.py:341) was guarded against this class of injection; Commit.count was not patched alongside it during remediation of GHSA-956x-8gvw-wg5v, leaving a functionally identical but uncovered sink. Exploitation requires option-key control only - self.hexsha is used internally, so ref control is not necessary.
Know when Gitpython gets its next vulnerability
- Watch products and get an email when something new is published
- Check this CVE against your own stack and servers
- Exploit and PoC references, threat intelligence from 22 sources
No credit card · 7-day full trial
Severity by source
CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:N/VC:N/VI:L/VA:L/SC:N/SI:N/SA:N
AC:H reflects the required application-level condition of forwarding user options to count(); PR:L because application access is needed; no confidentiality impact.
AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:L/A:L
Primary rating from Vendor (VulnCheck).
CVSS VectorVendor: VulnCheck
Lifecycle Timeline
2DescriptionCVE.org
GitPython before 3.1.56 contains an argument injection vulnerability in the Commit.count() method, which forwards keyword arguments to 'git rev-list' without the check_unsafe_options guard present in the sibling iter_items method. An attacker who can control options passed to Commit.count (e.g., via an application that forwards a user-supplied options dict) can supply output=<path>, causing 'git rev-list --output=<path>' to open and truncate the target file to zero bytes before revision parsing. This allows destruction/blanking of an arbitrary file at the process's privilege level (no content control, 0-byte truncation).
Threat Intelligence Overview
How this decision was reached
The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.
What every action level means
SSVC AssessmentENISA
Priority Score
Attack Technique
Code injection occurs when an application accepts user input and passes it directly into a language interpreter or evaluator without proper sanitization.
All versions of package gitpython are vulnerable to Remote Code Execution (RCE) due to improper user input validation, w
Arbitrary code execution in GitPython before 3.1.59 arises from unsafe re-serialization of multi-line, quoted git-config
Arbitrary directory creation and potential hook-based code execution in GitPython affects all releases before 3.1.59. Th
GitPython before 3.1.59 discloses local file content through exception messages when parsing .gitmodules files that cont
GitPython is a python library used to interact with Git repositories. Rated high severity (CVSS 7.8), this vulnerability
Arbitrary file read in GitPython before 3.1.59 allows low-privileged remote attackers to exfiltrate sensitive files by s
Arbitrary file read in GitPython versions before 3.1.59 exposes sensitive filesystem content to low-privileged network a
GitPython is a python library used to interact with Git repositories. Rated medium severity (CVSS 6.5), this vulnerabili
GitPython before 3.1.32 does not block insecure non-multi options in clone and clone_from. Rated critical severity (CVSS
Command execution in GitPython 3.1.50 arises because its default unsafe-option gate fails to recognize joined short-opti
Command injection in GitPython before 3.1.51 allows low-privileged attackers to bypass the `check_unsafe_options` blockl
Command injection in GitPython 3.1.30-3.1.46 allows remote authenticated attackers to execute arbitrary commands via und
Same technique Code Injection
View allVendor StatusVendor
SUSE
Severity: Moderate| Product | Status |
|---|---|
| openSUSE Tumbleweed | Fixed |
| SUSE Linux Enterprise Desktop 15 SP7 | Affected |
| SUSE Linux Enterprise High Performance Computing 15 SP7 | Affected |
| SUSE Linux Enterprise Module for Python 3 15 SP7 | Affected |
| SUSE Linux Enterprise Server 15 SP7 | Affected |
| SUSE Linux Enterprise Server 16.0 | Affected |
| SUSE Linux Enterprise Server 16.1 | Affected |
| SUSE Linux Enterprise Server for SAP Applications 15 SP7 | Affected |
| SUSE Linux Enterprise Server for SAP applications 16.0 | Affected |
| SUSE Linux Enterprise Server for SAP applications 16.1 | Affected |
| openSUSE Leap 16.0 | Affected |
| SUSE Linux Enterprise High Performance Computing 15 SP4-LTSS | Affected |
| SUSE Linux Enterprise High Performance Computing 15 SP5 | Affected |
| SUSE Linux Enterprise High Performance Computing 15 SP5-LTSS | Affected |
| SUSE Linux Enterprise Module for Python 3 15 SP4 | Affected |
| SUSE Linux Enterprise Module for Python 3 15 SP5 | Affected |
| SUSE Linux Enterprise Module for Python 3 15 SP6 | Affected |
| SUSE Linux Enterprise Server 15 SP4 | Affected |
| SUSE Linux Enterprise Server 15 SP4-LTSS | Affected |
| SUSE Linux Enterprise Server 15 SP5 | Affected |
| SUSE Linux Enterprise Server 15 SP5-LTSS | Affected |
| SUSE Linux Enterprise Server 15 SP6 | Affected |
| SUSE Linux Enterprise Server 15 SP6-LTSS | Affected |
| SUSE Linux Enterprise Server for SAP Applications 15 SP4 | Affected |
| SUSE Linux Enterprise Server for SAP Applications 15 SP5 | Affected |
| SUSE Linux Enterprise Server for SAP Applications 15 SP6 | Affected |
| SUSE Manager Proxy 4.3 | Affected |
| SUSE Manager Retail Branch Server 4.3 | Affected |
| SUSE Manager Server 4.3 | Affected |
| SUSE Linux Enterprise Desktop 15 SP4 | Affected |
| SUSE Linux Enterprise Desktop 15 SP5 | Affected |
| SUSE Linux Enterprise Desktop 15 SP6 | Affected |
| SUSE Linux Enterprise High Performance Computing 15 SP4 | Affected |
| SUSE Linux Enterprise High Performance Computing 15 SP4-ESPOS | Affected |
| SUSE Linux Enterprise High Performance Computing 15 SP5-ESPOS | Affected |
| SUSE Linux Enterprise High Performance Computing 15 SP6 | Affected |
| openSUSE Leap 15.4 | Affected |
| openSUSE Leap 15.5 | Affected |
| openSUSE Leap 15.6 | Affected |
EUVD-2026-57825
GHSA-h75v-4jxv-ppxm
NVD
CVE.org
EPSS
Vulnrichment
VulDB
Exploit-DB