gitpython is vulnerable to Argument Injection
75
CVE Score
High
Argument Injection
Head.checkout() passes the branch reference to self.repo.git.checkout(self, **kwargs) with no -- separator, so a branch name that starts with - is parsed as a Git option. After Repo.clone_from(), repo.active_branch.checkout() on a default branch named --pathspec-from-file=/etc/passwd makes Git read that file and return its contents in the GitCommandError. The guard added in 3.1.58, Git._option_candidates([], kwargs), still checks only keyword arguments. The fix changes the call to Git._option_candidates([self], kwargs).
Upgrade the gitpython package to version 3.2.0 or later.
You are affected if you are using a version that falls within the vulnerable range and your application calls checkout() on a Head object whose name originates from a remote-controlled branch name, such as after cloning a repository.
0.3.2 - 3.1.62
Fixed in 3.2.0gitpython is vulnerable to Argument Injection in versions 0.3.2 - 3.1.62.
Secure your code, cloud, and runtime in one central system. Connect a repo to discover what the reasoning agents find in your codebase.
No credit card required | Scan results in 32 seconds.
I consent to receiving marketing communications based on Aikido’s Privacy Policy.
SOC 2Compliant
ISO 27001Compliant
ISO 42001Compliant© All Intel data is openly available and commercially licensed.