High priorityDisclosed

Advisory · CVE-2026-110859

GitPython checkout flaw can leak local files through a crafted branch name

GitPython before 3.2.0 lets a branch name be parsed as a git option in Head.checkout, so a crafted repository can leak local file contents through error messages. CVSS 4.0 8.7.

Vendor
GitPython
Product
GitPython
Identifier / CWE
CVE-2026-110859
CWE-88
Action timing
Immediate
ELI5

Explain it like I’m five

A branch label is treated as an instruction, and the error message reads the file out loud.

SIMPLIFIED_ATTACK_PATH04 STEPS
  1. 01Crafted repository hosted

    An attacker hosts a repository whose default branch name begins as a git file option.

  2. 02Repository cloned and checked out

    An application using GitPython checks out the active branch.

  3. 03Branch parsed as option

    Head.checkout treats the branch name as an option rather than plain data.

  4. 04File contents leak

    Local file contents are exposed through GitCommandError messages.

What happened

The GitHub advisory for GitPython describes an argument injection flaw before 3.2.0 in Head.checkout. A branch name can be parsed as a git option.

A repository whose default branch uses such a name can cause cloning applications that check out the active branch to leak local file contents through error messages.

What to do

  1. Inventory applications that clone and check out untrusted repositories with GitPython.
  2. Upgrade GitPython to 3.2.0 or later using the project advisory guidance.
  3. Avoid checking out the active branch of untrusted repositories automatically until patched.
  4. Review error logs and error reporting channels for checkout failures that contain local file content.
  5. Rotate any credentials found in files that may have been leaked through those errors.

Management note

Error messages are an easy leak path to miss because they land in tickets and log aggregators. Search those stores, not just the application, if you ran affected checkouts.