Advisory Database
  • Advisories
  • Dependency Scanning
  1. pypi
  2. ›
  3. GitPython
  4. ›
  5. GHSA-3f7w-8rr8-f37f

GHSA-3f7w-8rr8-f37f: GitPython: Unguarded git option forwarding in IndexFile.checkout() and TagReference.create() enables arbitrary file overwrite and arbitrary file read

August 3, 2026

GitPython blocks dangerous git options through Git.check_unsafe_options(), gated per method by an allow_unsafe_options parameter. That guard is applied per call site, so any API that forwards **kwargs into a git command without calling it passes caller-controlled options straight to git.

A mechanical sweep of every method that forwards **kwargs into a .git.<command>(...) call found 14 sites with no guard. Two reach a git option that takes a filesystem path:

#Call sitegit optionImpact
1IndexFile.checkout() → git checkout-index--prefix=<path>arbitrary file overwrite with repository-controlled content
2TagReference.create() → git tag-F <file> / --file=<file>arbitrary file read, returned in-band

This is the same defect class already fixed in Commit.count() (GHSA-p538-c434-8v24), Repo.archive() and Git.ls_remote() (GHSA-956x-8gvw-wg5v). Both instances below are still present at HEAD.


References

  • github.com/advisories/GHSA-3f7w-8rr8-f37f
  • github.com/gitpython-developers/GitPython/commit/3af0c2516c5e18c829da30338614688f6b69b49c
  • github.com/gitpython-developers/GitPython/pull/2193
  • github.com/gitpython-developers/GitPython/releases/tag/3.1.57
  • github.com/gitpython-developers/GitPython/security/advisories/GHSA-3f7w-8rr8-f37f

Code Behaviors & Features

Detect and mitigate GHSA-3f7w-8rr8-f37f with GitLab Dependency Scanning

Secure your software supply chain by verifying that all open source dependencies used in your projects contain no disclosed vulnerabilities. Learn more about Dependency Scanning →

Affected versions

All versions before 3.1.57

Fixed versions

  • 3.1.57

Solution

Upgrade to version 3.1.57 or above.

Impact 8.1 HIGH

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

Learn more about CVSS

Weakness

  • CWE-200: Exposure of Sensitive Information to an Unauthorized Actor
  • CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')
  • CWE-73: External Control of File Name or Path

Source file

pypi/GitPython/GHSA-3f7w-8rr8-f37f.yml

Spotted a mistake? Edit the file on GitLab.

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

Page generated Sat, 08 Aug 2026 00:17:46 +0000.