Snowflake cli: GitPython: Unguarded git option forwarding in Repo.init enables arbitrary command execution via --template clone hooks (CVE-2026-76218)
GitPython's Repo.init method forwards all keyword arguments directly to git init without guarding unsafe options. This allows an attacker who can control the 'template' argument to plant malicious git hooks that execute arbitrary code during subsequent git operations. The vulnerability affects GitPython versions from 3.4.1 up to but not including 3.25.0. The attack requires the attacker to stage an executable hook directory at a known path and have the application call Repo.init with a crafted template argument. A patch is available that adds a guard against unsafe options like --template.
AI Analysis
Technical Summary
The vulnerability in GitPython's Repo.init method (CVE-2026-76218) arises because it forwards **kwargs verbatim to 'git init' without checking for unsafe options. Specifically, the '--template' option allows copying attacker-controlled hooks into the new repository's .git/hooks directory, enabling arbitrary code execution on the next git operation. Unlike the clone path, which already has unsafe option guards, Repo.init lacks any such protection. Exploitation requires the attacker to stage an executable hook directory and influence the template argument passed to Repo.init. The issue affects GitPython versions >=3.4.1 and <3.25.0. The recommended fix is to add a check_unsafe_options guard with a denylist including '--template' and '--separate-git-dir'.
Potential Impact
Successful exploitation results in arbitrary code execution with the privileges of the host process when the next git operation triggers the malicious hook. The attack complexity is high because the attacker must control the template argument and stage an executable hook directory at a known path. Confidentiality, integrity, and availability impacts are all high due to arbitrary code execution.
Mitigation Recommendations
A patch is available that introduces a check_unsafe_options guard in Repo.init to block unsafe options such as '--template' and '--separate-git-dir'. Users should upgrade GitPython to a fixed version beyond 3.25.0. Until patched, avoid passing untrusted input to the template argument in Repo.init calls. No other mitigations are indicated by the vendor advisory.
Snowflake cli: GitPython: Unguarded git option forwarding in Repo.init enables arbitrary command execution via --template clone hooks (CVE-2026-76218)
Description
GitPython's Repo.init method forwards all keyword arguments directly to git init without guarding unsafe options. This allows an attacker who can control the 'template' argument to plant malicious git hooks that execute arbitrary code during subsequent git operations. The vulnerability affects GitPython versions from 3.4.1 up to but not including 3.25.0. The attack requires the attacker to stage an executable hook directory at a known path and have the application call Repo.init with a crafted template argument. A patch is available that adds a guard against unsafe options like --template.
CVSS v3.1
Score 7.5high
Affected software
Run on your own infrastructure? Check whether these packages are installed with threat-finder — our free open-source scanner.
AI-Powered Analysis
Machine-generated threat intelligence
Technical Analysis
The vulnerability in GitPython's Repo.init method (CVE-2026-76218) arises because it forwards **kwargs verbatim to 'git init' without checking for unsafe options. Specifically, the '--template' option allows copying attacker-controlled hooks into the new repository's .git/hooks directory, enabling arbitrary code execution on the next git operation. Unlike the clone path, which already has unsafe option guards, Repo.init lacks any such protection. Exploitation requires the attacker to stage an executable hook directory and influence the template argument passed to Repo.init. The issue affects GitPython versions >=3.4.1 and <3.25.0. The recommended fix is to add a check_unsafe_options guard with a denylist including '--template' and '--separate-git-dir'.
Potential Impact
Successful exploitation results in arbitrary code execution with the privileges of the host process when the next git operation triggers the malicious hook. The attack complexity is high because the attacker must control the template argument and stage an executable hook directory at a known path. Confidentiality, integrity, and availability impacts are all high due to arbitrary code execution.
Mitigation Recommendations
A patch is available that introduces a check_unsafe_options guard in Repo.init to block unsafe options such as '--template' and '--separate-git-dir'. Users should upgrade GitPython to a fixed version beyond 3.25.0. Until patched, avoid passing untrusted input to the template argument in Repo.init calls. No other mitigations are indicated by the vendor advisory.
Technical Details
- Gcve Source
- db.gcve.eu
- Osv Id
- BREW-snowflake-cli-CVE-2026-76218
- Osv Schema Version
- 1.7.3
- Ecosystems
- ["Homebrew"]
- Cvss Version
- 3.1
- State
- PUBLISHED
Threat ID: 6abb41aef7a7c54106cc3a6e
Added to database: 09/29/2026, 04:42:22 UTC
Last enriched: 09/29/2026, 05:01:35 UTC
Last updated: 09/29/2026, 05:01:35 UTC
Views: 2
Community Reviews
0 reviewsCrowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.
Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.
Actions
Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.
Need more coverage?
Upgrade to Pro Console for AI refresh and higher limits.
For incident response and remediation, OffSeq services can help resolve threats faster.
Latest Threats
Check if your credentials are on the dark web
Instant breach scanning across billions of leaked records. Free tier available.