Categories
CVE-2026-78676 critical CVSS 9.8

Vulnerability in GitPython (CVE-2026-78676)

Summary

Vulnerability in GitPython (CVE-2026-78676). Successful exploitation can lead to full system takeover. Exploitable via UNSAFE_CONFIG_CHARS_RE. Mitigation: upgrade to 3.1.59 or later.

Original description

The description as published by the source.

  • CWE: CWE-88 (Argument Injection) / CWE-94 (Code Injection) — via a read-then-corrupt-on-rewrite config round trip, not a direct setter argument
  • Affected component: git/config.py — GitConfigParser._read() (multi-line value decoding, lines 444-541, esp. string_decode() at line 460 and its call sites at 519/541) and GitConfigParser._write()/write_section() (serialization, lines ~694-712, esp. line 708)
  • Affected version: GitPython at HEAD (9729ed3b948f2bde09f1f188c5311e172212b67e, 2026-08-05, VERSION 3.1.58)

Reachability

GitPython added UNSAFE_CONFIG_CHARS_RE / _value_to_string_safe() / _assure_config_name_safe() guards (commits c417af46, 1ed1b924, a495ccd3, and PR #2176) to reject a Python string containing a raw \r/\n/NUL byte, or syntax-bearing characters, when it is passed as an argument to set(), set_value(), add_value(), or add_section(). This closed the four config-injection GHSAs above.

That guard is applied only on the write-argument surface. It is never consulted for values that entered GitConfigParser._sections via _read() — i.e. values that came from parsing an on-disk config file. And _read() legitimately supports standard, spec-compliant git config syntax for multi-line values: a quoted value that is not closed on the same physical line continues onto the next physical line (git's own backslash-continuation syntax), and string_decode() (.decode('unicode_escape')) decodes a literal two-charact…

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-78676 has been found in GitPython.
Attackers can target a specific entry point like UNSAFE_CONFIG_CHARS_RE over the network to misuse the product.
Successful exploitation can lead to full system takeover. CVSS score: 9.8/10.
What to do: upgrade GitPython to 3.1.59 or later.
If unsure, ask your IT team or search "GitPython CVE-2026-78676" on the vendor's site.

CVE-2026-78676 (GitPython) — CWE-88 / CVSS v3 9.8
Attack vector: remote (network-reachable) / unauthenticated / no user interaction
Attack surface: UNSAFE_CONFIG_CHARS_RE / c417af46 / a495ccd3 / GitConfigParser._sections
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.

❓ What is the problem

A vulnerability (CWE-88) exists in GitPython. Attackers reach the vulnerable code path via UNSAFE_CONFIG_CHARS_RE without authentication.

📍 Affected scope

Check the vendor advisory for the affected versions of GitPython. Attack surface: UNSAFE_CONFIG_CHARS_RE / c417af46 / a495ccd3 / GitConfigParser._sections.

🔥 Severity

Severity: Critical (CVSS 9.8/10). Successful exploitation can lead to full system takeover.

🔧 How to fix

Update to 3.1.59.

🛡️ 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.59

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

  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.59"}]}]
PyPI gitpython
[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"3.1.59"}]}]

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