The vulnerability in GitPython's count() method stems from a protection gap that's more architectural than accidental: check_unsafe_options existed in iter_items but was absent from count(), even though both methods forward kwargs to the same git subprocess. This is the invisible attack surface that emerges when security patches are applied method-by-method rather than enforced at the API boundary. A developer using count() with user-adjacent option dicts — exactly the documented use case for this library — had no way to know they were operating in unprotected territory. The guard in iter_items likely arrived as a reactive patch after some prior incident, but no subsequent sweep identified that count() used structurally identical kwargs-passing mechanics without equivalent protection. The EPSS score of 0.00199 suggests low immediate exploitability, but the real exposure is the kwargs-forwarding surface itself: any method in GitPython that accepts **kwargs and passes them to git commands is a potential vector, and counting the methods that got this treatment versus the ones that didn't is an exercise in trust rather than verification. The correct response is not to audit count() alone, but to assume the entire kwargs-passing surface is suspect until proven otherwise. Avoid forwarding user-supplied option dictionaries to any GitPython method without explicit validation. If your codebase passes option dicts from user input to git commands, treat that code path as vulnerable by default and build an explicit whitelist of permitted options at your application boundary — do not rely on the library's internal guards, because those guards are applied unevenly and will decay as maintainers rotate and institutional memory of why they exist evaporates.
CVE-2026-73621
Official description Straight from the sourceThe vendor's or NVD's own wording, published unedited. Authoritative, but often terse — it says what broke, rarely what to do.
NVD · uneditedGitPython 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).
Technical summary Written by usOur analysis, written from the advisory, the CVSS vector and the affected-version data. It adds context the advisory leaves out, and never invents facts that are not in the source.
dbcve analysisA detailed technical summary for this CVE is being prepared.
CVSS breakdown How the score is builtThe industry scoring standard. It rates how the flaw is reached, what it takes to exploit, and what an attacker gains — the score is derived from those, not the other way round.
From the vector- Attack vector
- Network
- Complexity
- Low
- Privileges
- Low
- User interaction
- None
- Scope
- Unchanged
- Confidentiality
- None
- Integrity
- Low
- Availability
- Low
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:L/A:L
Remediation Closing itWhat it takes to close this. Where a vendor fix exists we point at it; where none exists we say so plainly, and can build one. Effort estimates are scoped from the advisory, not from your codebase.
dbcve · scopedGitPython 3.1.56 or later
- Identify the current GitPython version in your environment using 'pip show gitpython' or your package manager
- Upgrade GitPython to version 3.1.56 or later using 'pip install --upgrade gitpython>=3.1.56'
- Verify the upgrade was successful by running 'pip show gitpython' and confirming the version number
- If your application directly passes user-supplied options to Commit.count(), audit and restrict the allowed parameters to prevent argument injection
Generated from the published advisory — verify against the referenced sources before acting.
There is no version to upgrade to and no patch to apply. Every affected install stays exposed until the vendor ships a fix — or somebody else builds one.
Free. We build fixes in the order the community asks for them — and we’ll tell you the moment this one lands.
We develop and verify an original fix where the vendor hasn’t, from $4,000. Deployed to your staging first — never straight to production.
Scope it with usSee what else the community needs solved on the solutions-needed board.
Scan for this in your stack
Free · runs locallyCheck whether your project pulls in CVE-2026-73621 — or any other known-vulnerable package — straight from your lock files. Free and open source; it runs locally and uploads nothing.
References Go to the primary sourcePrimary sources — vendor advisories, patches and trackers. Where our summary and a reference disagree, the reference wins.
Primary sourcesThe vulnerability in GitPython's count() method stems from a protection gap that's more architectural than accidental: check_unsafe_options existed in iter_items but was absent from count(), even though both methods forward kwargs to the same git subprocess. This is the invisible attack surface that emerges when security patches are applied method-by-method rather than enforced at the API boundary. A developer using count() with user-adjacent option dicts — exactly the documented use case for this library — had no way to know they were operating in unprotected territory. The guard in iter_items likely arrived as a reactive patch after some prior incident, but no subsequent sweep identified that count() used structurally identical kwargs-passing mechanics without equivalent protection. The EPSS score of 0.00199 suggests low immediate exploitability, but the real exposure is the kwargs-forwarding surface itself: any method in GitPython that accepts **kwargs and passes them to git commands is a potential vector, and counting the methods that got this treatment versus the ones that didn't is an exercise in trust rather than verification. The correct response is not to audit count() alone, but to assume the entire kwargs-passing surface is suspect until proven otherwise. Avoid forwarding user-supplied option dictionaries to any GitPython method without explicit validation. If your codebase passes option dicts from user input to git commands, treat that code path as vulnerable by default and build an explicit whitelist of permitted options at your application boundary — do not rely on the library's internal guards, because those guards are applied unevenly and will decay as maintainers rotate and institutional memory of why they exist evaporates.
Practitioner notes
ContributedPeer-ranked notes from engineers who’ve handled CVE-2026-73621 in production — separate from our analysis above.
The advisory tells you what broke. It rarely tells you what actually worked. If you’ve dealt with this one, that detail is what the next engineer is searching for.
- The version that genuinely resolved it — not the one the vendor claimed
- A config change or rule that shut the vector down
- A gotcha in the upgrade path that cost you an afternoon
A place for practitioners to share what actually worked: a mitigation you’ve tested, a configuration change, a version- or environment-specific caveat, or a link to a verified patch. The most useful notes rise to the top as peers upvote them, so the signal stays high.
- Verified mitigations, workarounds, and config changes
- Version or environment caveats, and links to real fixes
- No weaponised exploit code, or anything meant to cause harm
- No spam, self-promotion, credentials, or personal data