Vulnerability in gitpython (CVE-2026-78678)
Summary
Vulnerability in gitpython (CVE-2026-78678). Confidential information can be exposed externally. Exploitable via unsafe_git_revision_options. Mitigation: upgrade to 3.1.59 or later.
Original description
The description as published by the source.
Summary
Repo.blame() / Repo.blame_incremental() guard forwarded revision options against unsafe_git_revision_options, but that denylist only contains the file-WRITE options --output/-o. git blame also honors --contents and -S , which cause the file's lines to be echoed into the blame result — an arbitrary file READ. Neither option is in the denylist, so a caller-influenced revision value of --contents= passes the guard and leaks file contents. This is a distinct sink-option and impact class (READ) from GHSA-956x-8gvw-wg5v (which addressed the blame --output WRITE), directly analogous to GHSA-539m-9xh6-q6rr (archive READ gap accepted separately from the archive write/exec advisory).
Root Cause
unsafe_git_revision_options = ["--output","-o"] (git/repo/base.py:188). The rev string is passed to _option_candidates([rev], kwargs) and placed BEFORE the -- separator (base.py:841). The canonical name of --contents=... is contents, which is not on the denylist, so no UnsafeOptionError is raised. The trailing -- protects only the pathspec, not the option before the revision.
Impact
Arbitrary local file read at the privileges of the host process; the file's line contents appear in the blame result returned to the caller. Pure VALUE control (the caller forwards a user-influenced revision string). Default allow_unsafe_options=False.
Proof of Concept
result = repo.blame("--contents=/etc/passwd", "a.txt")
# result rows carry t…
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-78678 has been found in gitpython.
Attackers can target a specific entry point like unsafe_git_revision_options 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.59 or later.
If unsure, ask your IT team or search "gitpython CVE-2026-78678" on the vendor's site.
CVE-2026-78678 (gitpython) — CWE-88 / CVSS v3 6.5
Attack vector: remote (network-reachable) / no user interaction
Attack surface: unsafe_git_revision_options / rev / contents / UnsafeOptionError
Patched: 3.1.59 — 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.
A vulnerability (CWE-88) exists in gitpython. Attackers reach the vulnerable code path via unsafe_git_revision_options.
Check the vendor advisory for the affected versions of gitpython. Attack surface: unsafe_git_revision_options / rev / contents / UnsafeOptionError.
Severity: Medium (CVSS 6.5/10). Confidential information can be exposed externally.
Update to 3.1.59.
Until the patch is applied: disable the affected feature, apply WAF rules, or restrict access via network ACLs.
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
-
1Identify exposure identify
grep -r 'gitpython' . | grep -v node_modulesリポジトリと本番環境の依存ファイル (package-lock.json / requirements.txt / go.sum / Gemfile.lock 等) で
gitpythonを grep し、稼働しているサービス・バージョンを把握する。 -
2Apply patch patch
Upgrade gitpython to 3.1.59ステージング環境で 3.1.59 に上げて回帰テスト → 本番反映。回帰テストはアプリの主要ハッピーパスを含めること。
-
3Post-deployment verification verify
Confirm patched version is live in productionパッチ適用後、ステージングで PoC または同等の悪用パターンを再現して脆弱性が閉じたことを確認。本番ではアクセスログ・WAF でアラート再発が無いか継続監視。
Affected packages
Fix status by distribution
Fixed packages published by each distribution for this CVE
- Debian DEBIAN-CVE-2026-78678 python-git
References
- advisory nvd.nist.gov
- package github.com
- web github.com
- web vulncheck.com
- web github.com
- web github.com
- web github.com