Only the latest version of GitPython can receive security updates. If a vulnerability is discovered, a fix can be issued in a new release.
| Version | Supported |
|---|---|
| 3.x.x | ✅ |
| < 3.0 | ❌ |
GitPython inherits its threat model directly from Git. The trust boundaries in Git's security documentation apply to both the CLI and Gix backends:
- Repository content may be untrusted. Cloning an untrusted repository and
inspecting its history are supported operations. A clone creates local
repository metadata without copying the source repository's configuration or
hooks. Tracked files, including
.gitmodules, remain untrusted input. - Local repository metadata must be trusted. Running commands in an
attacker-supplied
.gitdirectory, bare repository, or surrounding worktree is unsafe: configuration and hooks can execute commands. This includes repositories received in archives or copied directories. Owning the extracted files or listing a repository insafe.directorydoes not make its contents trustworthy. - Repository paths are not a sandbox. Git supports metadata and working trees
in separate locations,
including metadata reached through gitfiles or symlinks.
GitPython does not promise that all filesystem access stays within a checkout
or
.gitdirectory. Paths supplied by untrusted repository content must still receive Git's intended protections.
For an untrusted repository directory, Git recommends obtaining a clean copy with
git clone --no-local before running other commands. Serving the source through
git-upload-pack still has an attack surface; Git recommends using an
unprivileged user for additional isolation. See
Git's git-upload-pack security guidance.
Violations of these trust boundaries or bypasses of Git's intended protections remain reportable, including cases where Git itself is affected.
Please report private portions of a vulnerability to https://github.com/gitpython-developers/GitPython/security/advisories/new. Doing so helps to receive updates and collaborate on the matter, without disclosing it publicly right away.
Vulnerabilities in GitPython's dependencies gitdb or smmap, which primarily exist to support GitPython, can be reported here as well, at that same link. The affected package (GitPython, gitdb, or smmap) can be included in the report, if known.