Categories
CVE-2026-76217 medium CVSS 6.5

Vulnerability in gitpython (CVE-2026-76217)

Summary

Vulnerability in gitpython (CVE-2026-76217). Confidential information can be exposed externally. Exploitable via GitCommandError.stderr. Mitigation: upgrade to 3.1.58 or later.

Original description

The description as published by the source.

Summary

IndexFile.remove() and Head.checkout() forward **kwargs into git rm and git checkout
with no guard. Passing --pathspec-from-file= together with --pathspec-file-nul
makes Git treat the whole file as a single NUL-delimited pathspec, and the unmatched-pathspec
error quotes it verbatim. GitPython surfaces that through GitCommandError.stderr, so the
entire contents of a caller-chosen file are returned to the caller in band.

This is the same primitive as Instance 2 of
GHSA-3f7w-8rr8-f37f - TagReference.create()
with -F, arbitrary file read returned in band - at two sites that advisory assessed and
cleared.

Prior art, and why I am filing rather than commenting

GHSA-3f7w-8rr8-f37f's sweep table lists these four sites with the assessment
"--pathspec-from-file only reads a pathspec; no write or disclosure primitive found":

Call site git command that advisory's assessment
IndexFile.remove() rm --pathspec-from-file only reads a pathspec; no write or disclosure primitive found
IndexFile.move() mv same
HEAD.reset() reset same
HEAD.checkout() checkout same

That assessment is very nearly right, and I think that is why it held: with
--pathspec-from-file alone, Git splits on newlines and the error quotes only the first
line
, which reads as an uninteresting partial. Adding --pathspec-file-nul - a sibling flag
of the…

Source: NIST National Vulnerability Database NVD GitHub Advisory

Auto-generated summary

Assembled by SecPulse from the source data (CVSS, CWE, affected versions) using templates — no AI involved. Check the original description and references below for exact details.

A vulnerability tracked as CVE-2026-76217 has been found in gitpython.
Attackers can target a specific entry point like GitCommandError.stderr over the network to misuse the product.
Confidential information can be exposed externally. CVSS score: 6.5/10.
What to do: upgrade gitpython to 3.1.58 or later.
If unsure, ask your IT team or search "gitpython CVE-2026-76217" on the vendor's site.

CVE-2026-76217 (gitpython) — CWE-73 / CVSS v3 6.5
Attack vector: remote (network-reachable) / no user interaction
Attack surface: GitCommandError.stderr / reset / checkout / allow_unsafe_options
Patched: 3.1.58 — apply immediately
Plan: 1) Audit SBOM/dependencies, 2) Stage→prod upgrade, 3) Add WAF/proxy monitoring on affected endpoints, 4) Hunt IOCs in logs.
Refs: see the GHSA / vendor advisory / patched release linked on this page.

❓ What is the problem

A vulnerability (CWE-73) exists in gitpython. Attackers reach the vulnerable code path via GitCommandError.stderr.

📍 Affected scope

Check the vendor advisory for the affected versions of gitpython. Attack surface: GitCommandError.stderr / reset / checkout / allow_unsafe_options.

🔥 Severity

Severity: Medium (CVSS 6.5/10). Confidential information can be exposed externally.

🔧 How to fix

Update to 3.1.58.

🛡️ Workaround

Until the patch is applied: disable the affected feature, apply WAF rules, or restrict access via network ACLs.

🔍 Detection

Search webserver/proxy logs for unusual request patterns matching this CVE's known IOCs. Run grep -r 'gitpython' . against your dependency files (package-lock.json, requirements.txt, go.sum) to find affected services.

Response actions

Concrete steps and command examples for SOC/SRE teams to execute in order

  1. 1
    Identify exposure identify
    grep -r 'gitpython' . | grep -v node_modules

    リポジトリと本番環境の依存ファイル (package-lock.json / requirements.txt / go.sum / Gemfile.lock 等) で gitpython を grep し、稼働しているサービス・バージョンを把握する。

  2. 2
    Apply patch patch
    Upgrade gitpython to 3.1.58

    ステージング環境で 3.1.58 に上げて回帰テスト → 本番反映。回帰テストはアプリの主要ハッピーパスを含めること。

  3. 3
    Post-deployment verification verify
    Confirm patched version is live in production

    パッチ適用後、ステージングで PoC または同等の悪用パターンを再現して脆弱性が閉じたことを確認。本番ではアクセスログ・WAF でアラート再発が無いか継続監視。

Affected packages

pip gitpython
[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"3.1.58"}]}]

Fix status by distribution

Fixed packages published by each distribution for this CVE

References

We use cookies for analytics and ad measurement. This setting applies to all Game co., Ltd. sites. Details