Advisory Database
  • Advisories
  • Dependency Scanning
  1. pypi
  2. ›
  3. GitPython
  4. ›
  5. GHSA-23mf-xhv8-69c2

GHSA-23mf-xhv8-69c2: GitPython: arbitrary file read via attacker-controlled branch name in `Head.checkout()` (incomplete fix of CVE-2026-78679)

October 27, 2026

Head.checkout() guards its **kwargs against unsafe Git options but never inspects its own positional argument — the branch name — which reaches the git checkout argv with no -- separator. A repository whose default branch is named --pathspec-from-file=/etc/passwd makes a consumer that merely clones it and checks out the default branch return the entire contents of that file to the caller.

This is the exact combination of two advisories the project already fixed:

  • CVE-2026-76217 (GHSA-hh9p-6wh2-4mfc) — “Arbitrary file read via --pathspec-from-file in IndexFile.remove() and Head.checkout()”. Fixed in 3.1.58 by commit f2550b65, which added the guard to this exact method — but only for **kwargs.
  • CVE-2026-78679 (GHSA-3wxw-xv34-2frg) — "TagReference.create positional reference bypasses kwargs-only --file guard, enabling arbitrary file read (incomplete fix of 3af0c251)". Fixed in 3.1.59 by commit 1b0d2d9b, which applied the positional check to git/refs/tag.py, git/diff.py, git/index/base.py and git/repo/base.py — but not to git/refs/head.py:286.

f2550b65 states in its own commit message that the audit found the positional variant and applied it to HEAD.reset — 185 lines above Head.checkout, in the same file, in the same commit:

“The audit also found that reset’s positional commit could carry the option before its argument separator. […] Check reset’s positional commit as well as keyword options”

HEAD.reset got the fix. Head.checkout did not, and 1b0d2d9b did not come back for it.

References

  • github.com/advisories/GHSA-23mf-xhv8-69c2
  • github.com/gitpython-developers/GitPython/commit/8da65080849a56a2fc9f3e7817bbf0524e8397d5
  • github.com/gitpython-developers/GitPython/pull/2233
  • github.com/gitpython-developers/GitPython/releases/tag/3.2.0
  • github.com/gitpython-developers/GitPython/security/advisories/GHSA-23mf-xhv8-69c2

Code Behaviors & Features

Detect and mitigate GHSA-23mf-xhv8-69c2 with GitLab Dependency Scanning

Secure your software supply chain by verifying that all open source dependencies used in your projects contain no disclosed vulnerabilities. Dependency Scanning using SBOM also detects vulnerabilities from proprietary advisories that this site does not include. Learn more about Dependency Scanning using SBOM →

Affected versions

All versions before 3.2.0

Fixed versions

  • 3.2.0

Solution

Upgrade to version 3.2.0 or above.

Impact 6.5 MEDIUM

CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:H/A:N

Learn more about CVSS

Weakness

  • CWE-200: Exposure of Sensitive Information to an Unauthorized Actor
  • CWE-73: External Control of File Name or Path
  • CWE-88: Improper Neutralization of Argument Delimiters in a Command ('Argument Injection')

Source file

pypi/GitPython/GHSA-23mf-xhv8-69c2.yml

Spotted a mistake? Edit the file on GitLab.

  • Site Repo
  • About GitLab
  • Terms
  • Privacy Statement
  • Contact

Page generated Fri, 30 Oct 2026 00:15:50 +0000.