Executive brief
GitPython is a widely-used library for programmatic Git repository access, commonly integrated into CI/CD systems, code-review bots, and dependency scanners that process third-party repositories. A defect in how GitPython parses repository submodule configuration (.gitmodules) allows an attacker to disclose the first line of any file readable by the application—such as environment variables, API keys, or /etc/passwd—by embedding a path directive in a malicious repository. The victim need only perform the most routine read-only operation: listing the repository's submodules. This affects any application that processes untrusted repositories.
Technical details
GitPython's SubmoduleConfigParser parses .gitmodules (tracked, attacker-controlled repository content) without disabling the merge_includes feature that causes the ConfigParser to follow [include] directives to arbitrary filesystem paths. When an include path points to a non-gitconfig file (e.g., /etc/passwd, .env), the parser raises configparser.MissingSectionHeaderError with the target file's first line embedded verbatim in the exception message. Because Submodule.iter_items() catches only IOError and BadName (not configparser.Error), this exception propagates uncaught through the public repo.submodules API. Include-path resolution uses osp.isabs() to bypass path containment checks entirely for absolute paths and performs no repository-boundary verification. A sibling code path in Repo.config_writer() was hardened with merge_includes=False in 2023, but Submodule._config_parser() was never updated. The vulnerability requires only cloning an attacker repository and iterating repo.submodules—no authentication, submodule checkout, or user interaction.
Affected products
- GitPython developers GitPython 3.1.58 and earlier
Timeline
- 2026-08-05: disclosed: Vulnerability present in GitPython HEAD (commit 9729ed3b948f2bde09f1f188c5311e172212b67e, version 3.1.58)
- 2026-08-10: advisory: GHSA-7833-fr7j-v32q published on GitHub Advisory Database
- 2026: patched: Fixed in GitPython 3.1.59
- 2026-09-08: other: CVE-2026-78675 assigned; advisory updated September 8, 2026