Intel

AIKIDO-2026-137233

gitpython is vulnerable to Argument Injection

CVE-2026-110859Published Oct 21, 2026
October 21, 2026

75

CVE Score

High

Argument Injection

Are you affected? Scan for Free

TL;DR

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).

How do I fix this?

Upgrade the gitpython package to version 3.2.0 or later.

Who does this affect?

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.

Package

Versions

0.3.2 - 3.1.62

Fixed in 3.2.0

Background info

gitpython is vulnerable to Argument Injection in versions 0.3.2 - 3.1.62.

Get secure today,
quickly and for free.

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.

Trusted by 150k+ orgs
  • Revolut
  • n8n
  • Lovable
  • Deel
  • Prove
  • Omnea