Gitpython: Five Vulnerabilities Including Critical Flaw Disclosed Together
Key findings • Five Gitpython vulnerabilities disclosed simultaneously on August 25, 2026, affecting versions prior to 3.1.59. • Critical vulnerability (CVE-2026-78676) allows arbitrary Git d…

Key findings
- Five Gitpython vulnerabilities disclosed simultaneously on August 25, 2026, affecting versions prior to 3.1.59.
- Critical vulnerability (CVE-2026-78676) allows arbitrary Git directive injection via config file manipulation.
- Multiple vulnerabilities enable arbitrary file reads through different methods, including tag references and .gitmodules.
- High severity flaw (CVE-2026-78677) permits attackers to create arbitrary Git directories.
- All issues are fixed in Gitpython version 3.1.59; immediate update recommended.
On August 25, 2026, a batch of five vulnerabilities was disclosed in the Gitpython library, affecting versions prior to 3.1.59. These vulnerabilities, ranging in severity from Medium to Critical, were all published simultaneously, indicating a coordinated disclosure event. The issues primarily revolve around improper handling of Git configuration and references, potentially allowing for arbitrary file reads, arbitrary Git directory creation, and configuration corruption.
One of the most severe flaws, CVE-2026-78676 (Critical, CVSS 9.8), arises from Gitpython's failure to safely re-serialize multi-line git-config values. This can lead to the corruption of dormant quoted values into injected directives, such as core.hooksPath. Attackers can exploit this by crafting configuration files with embedded newlines, which, after an unrelated Gitpython configuration write operation, can be transformed into active Git directives.
Two vulnerabilities, CVE-2026-78679 (Medium, CVSS 6.5) and CVE-2026-78678 (Medium, CVSS 6.5), both involve arbitrary file read capabilities. CVE-2026-78679 specifically targets the TagReference.create() method, where a positional reference parameter can bypass security checks, allowing attackers to read arbitrary files by embedding file paths in the annotated tag message. Similarly, CVE-2026-78678 exploits an incomplete denylist in the unsafe_git_revision_options guard, enabling attackers to read files using options like --contents or -S with Repo.blame().
Further exacerbating the risk, CVE-2026-78675 (High, CVSS 8.4) allows for the disclosure of local file content. This occurs because Gitpython fails to disable merge_includes when parsing .gitmodules files. Attackers can craft malicious .gitmodules files containing [include] directives that point to sensitive local files, which are then disclosed when accessing repo.submodules.
Lastly, CVE-2026-78677 (High, CVSS 7.5) presents a risk of arbitrary Git directory creation. The unsafe_git_clone_options guard omits --separate-git-dir, permitting attackers to redirect repository metadata to an attacker-controlled location by supplying a separate_git_dir parameter during cloning operations via Repo.clone_from() or Repo.clone().
All these vulnerabilities have been addressed in Gitpython version 3.1.59. Users are strongly advised to update to this version or later to mitigate these security risks. The simultaneous disclosure of these diverse vulnerabilities highlights the importance of keeping the Gitpython library updated to prevent potential security breaches.
The Gitpython Project has released version 3.1.59 to address these issues. Users are urged to update immediately.
The vulnerabilities disclosed include:
- CVE-2026-78676: Critical (CVSS 9.8) - Arbitrary configuration directive injection via unsafe config re-serialization.
- CVE-2026-78675: High (CVSS 8.4) - Arbitrary file read via
.gitmodulesinclude directives. - CVE-2026-78677: High (CVSS 7.5) - Arbitrary Git directory creation.
- CVE-2026-78678: Medium (CVSS 6.5) - Arbitrary file read via unsafe revision options in
Repo.blame(). - CVE-2026-78679: Medium (CVSS 6.5) - Arbitrary file read via
TagReference.create().
Users should update to Gitpython 3.1.59 or newer.