Summary
Path traversal in gitpython (CVE-2026-78677). Confidential information can be exposed externally. Exploitable via Repo.unsafe_git_clone_options. Mitigation: upgrade to >= 3.1.59 or later.
Original description
The description as published by the source.
- CWE: CWE-73 (External Control of File Name or Path) / CWE-22 (Path Traversal, in the "escapes intended base directory" sense)
- Affected component:
git/repo/base.py,Repo.unsafe_git_clone_options(class attribute, lines 153-165) andRepo._clone()(lines 1477-1520), reached via the publicRepo.clone_from()(line 1626) andRepo.clone()(line 1567) APIs. - Affected version: GitPython at HEAD (
9729ed3b948f2bde09f1f188c5311e172212b67e, 2026-08-05, VERSION3.1.58)
Reachability
Repo.clone_from(url, to_path, **kwargs) (and Repo.clone()) forward arbitrary keyword arguments to the underlying git clone invocation. Before forwarding, GitPython builds a candidate option list from the kwargs (Git._option_candidates) and checks it against a denylist, Repo.unsafe_git_clone_options, via Git.check_unsafe_options() — unless the caller passes allow_unsafe_options=True. This denylist mechanism is exactly the guard that the last ~16 published GHSAs against this repo (2026-07-12 → 2026-08-05) have repeatedly found incomplete or bypassable for other options (--template, --upload-pack, --config, --exec, --output, --index-output, --pathspec-from-file, etc.).
git clone also accepts --separate-git-dir=, which redirects the repository's entire .git metadata directory to an arbitrary, caller-controlled filesystem path, leaving only a gitlink text file (gitdir: ) at the intended destination. This is the exact same primitive already…
Source: NIST National Vulnerability Database NVD GitHub Advisory
AI summary
Written by an external AI model and may contain mistakes. Check the original description and references below before acting on it.
GitPythonのバージョン3.1.59未満には、リポジトリのクローン作成時に--separate-git-dirオプションが欠如している問題があります。これにより、攻撃者は本来のクローン先とは異なる場所に任意のGitディレクトリを作成することが可能です。この脆弱性により、攻撃者はリポジトリのメタデータを攻撃者が制御するファイルシステムパスに移動させることができ、任意のディレクトリを作成したりフックを実行したりする可能性があります。
GitPythonのクローン作成時のオプション欠如によりディレクトリを制御される脆弱性。
GitPython 3.1.59未満
攻撃者が任意のディレクトリを作成可能であり、フックの実行も可能なため、高い危険性があります。
GitPythonをバージョン3.1.59以降にアップデートしてください。
情報なし
リポジトリのクローン先ディレクトリが意図されない場所に作成されていないか確認する。
Affected packages
References
- advisory nvd.nist.gov
- package github.com
- web github.com
- web vulncheck.com
- web github.com
- web github.com
- web github.com
- web github.com
- web github.com
- web github.com