Arbitrary command execution through GitPython clone template options
GitPython versions before 3.1.54 contain an incomplete denylist in unsafe_git_clone_options that omits the --template option. An attacker who can influence clone options can specify a template directory containing malicious post-checkout hooks. Git can execute these hooks during repository cloning, allowing arbitrary command execution despite GitPython's unsafe-option filtering.
What it means and what to do now: patch path, interim mitigations, and the assume-compromise checklist.
What an attacker gets, and what they’ve been doing with it.
Successful exploitation executes attacker-controlled commands with the privileges of the process performing the clone. This can compromise data and credentials accessible to that process, permit modification of repositories or build outputs, and disrupt affected services or CI/CD jobs.
If you can’t patch tonight, do this now.
Until patched, prevent untrusted input from controlling clone options, particularly --template. Use a strict allowlist of permitted options rather than relying solely on the affected denylist. Run clone operations with minimal privileges and without access to sensitive credentials to limit potential impact.
Patch, then assume compromise.
Upgrade GitPython to version 3.1.54 or later, or install the distribution security update containing the corresponding fix. GitPython 3.1.57 also addresses the other six vulnerabilities identified in the related seven-CVE disclosure.
No public exploits tracked yet. Mallory keeps watching.
Products and vendors Mallory has correlated with this vulnerability. Open in Mallory to drill down to specific CPE configurations and version ranges.
4 sources tracked across advisories, community write-ups, and news. New activity surfaces here as Mallory finds it.