CVE-2026-78675
GitPython 3.1.58‑3.1.58 allows .gitmodules include to leak local file contents.
- CVSS 8.6
- CWE-73
- Information Leakage
- Local
GitPython before 3.1.59 fails to disable merge_includes when parsing .gitmodules, allowing attackers to disclose local file content by including arbitrary file paths via [include] directives. Attackers can craft a malicious .gitmodules file with include directives pointing to sensitive files; when repo.submodules is accessed, GitConfigParser raises MissingSectionHeaderError embedding the target file's first line verbatim in the exception message.
- CWE
- CWE-73
- CVSS base score
- 8.6
- Published
- 2026-08-25
- OWASP
- A05 Security Misconfiguration
- Orthogonal defect classification
- Checking
- Code defect classification
- Missing Check
- Category
- Information Leakage
- Subcategory
- Information Disclosure
- Accessibility scope
- Local
- Impact
- Information Disclosure
- Affected component
- GitPython
- Fixed by upgrading
- Yes
Solution
Upgrade GitPython to version 3.1.59 or newer.
Vulnerable code sample
import git
def list_submodules(repo_path):
"""Return names of submodules in the repository."""
repo = git.Repo(repo_path)
# VULNERABLE: merge_includes left enabled, allowing include directives in .gitmodules
cfg = repo.config_reader() # defaults to merge_includes=True
# Accessing submodules triggers parsing of .gitmodules using the above config
return [submodule.name for submodule in repo.submodules]Patched code sample
import git
def list_submodules(repo_path):
"""Return names of submodules in the repository."""
repo = git.Repo(repo_path)
# FIX: disable merge_includes to ignore [include] sections in .gitmodules
cfg = repo.config_reader(merge_includes=False)
# Access submodules safely without processing external includes
return [submodule.name for submodule in repo.submodules]Published fix
Public sources link this CVE to the changes below. The code samples above were generated to illustrate the defect; these links lead to the code the project actually changed.
- fix: ignore includes in submodule configuration (gitpython-developers/GitPython)
git/objects/submodule/base.py · Submodule._config_parser
Cite this entry
@misc{vaitp:cve202678675,
title = {{GitPython 3.1.58‑3.1.58 allows .gitmodules include to leak local file contents.}},
author = {Bogaerts, Fr\'ed\'eric and Ivaki, Naghmeh and Fonseca, Jos\'e},
year = {2026},
note = {VAITP Python Vulnerability Dataset, entry CVE-2026-78675},
howpublished = {\url{https://netpack.pt/vaitp/vulnerability/CVE-2026-78675/}}
}
Introducing the "VAITP dataset": a specialized repository of Python vulnerabilities and patches, meticulously compiled for the use of the security research community. As Python's prominence grows, understanding and addressing potential security vulnerabilities become crucial. Crafted by and for the cybersecurity community, this dataset offers a valuable resource for researchers, analysts, and developers to analyze and mitigate the security risks associated with Python. Through the comprehensive exploration of vulnerabilities and corresponding patches, the VAITP dataset fosters a safer and more resilient Python ecosystem, encouraging collaborative advancements in programming security.
The supreme art of war is to subdue the enemy without fighting.
Sun Tzu – “The Art of War”
:: Shaping the future through research and ingenuity ::
