GitPython: clone_from()/clone() omit --separate-git-dir from unsafe_git_clone_options, enabling arbitrary git-directory creation outside the destination
Résumé
GitPython: clone_from()/clone() omit --separate-git-dir from unsafe_git_clone_options, enabling arbitrary git-directory creation outside the destination
Description d'origine
La description telle que publiée par la source (souvent en anglais).
- 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
Résumé IA
Rédigé par une IA externe ; il peut contenir des erreurs. Vérifiez la description d'origine et les références ci-dessous avant d'agir.
Une vulnérabilité référencée CVE-2026-78677 a été découverte dans git.
Des attaquants peuvent cibler un point d'entrée spécifique comme unsafe_git_clone_options à distance pour détourner le produit.
Des informations confidentielles peuvent être exposées. Score CVSS : 7.5/10.
Action : mettez à jour git vers >= 3.1.59 ou supérieur.
En cas de doute, contactez votre service informatique ou cherchez « git CVE-2026-78677 » sur le site de l'éditeur.
CVE-2026-78677 (git) — CWE-22 / CVSS v3 7.5
Vecteur d'attaque : distant (réseau) / non authentifié / sans interaction utilisateur
Surface d'attaque : unsafe_git_clone_options / Repo.unsafe_git_clone_options / Git._option_candidates / Repo.unsafe_git_init_options
Versions affectées : <= 3.1.58
Correctif : >= 3.1.59 — appliquer immédiatement
Plan : 1) Audit SBOM, 2) Mise à jour staging→prod, 3) Surveillance WAF/proxy sur les endpoints affectés, 4) Recherche d'IOC dans les logs.
Réfs : voir GHSA / avis éditeur / version corrigée liés sur cette page.
GitPythonのクローン作成時のオプション欠如によりディレクトリを制御される脆弱性。
GitPython 3.1.59未満
攻撃者が任意のディレクトリを作成可能であり、フックの実行も可能なため、高い危険性があります。
GitPythonをバージョン3.1.59以降にアップデートしてください。
情報なし
リポジトリのクローン先ディレクトリが意図されない場所に作成されていないか確認する。
Paquets affectés
Références
- advisory disclosure@vulncheck.com
- exploit github.com
- web nvd.nist.gov
- web github.com
- web github.com
- web github.com
- web github.com
- web github.com
- web github.com