Skip to content

Security: gitpython-developers/GitPython

SECURITY.md

Security Policy

Supported Versions

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 ❌

Threat Model

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 .git directory, 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 in safe.directory does 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 .git directory. 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.

Reporting a Vulnerability

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.

Learn more about advisories related to gitpython-developers/GitPython in the GitHub Advisory Database