CVE-2026-73619
GitPython unsafe_git_archive_options allows reading arbitrary files via –add-file.
- CVSS 7.1
- CWE-73
- Information Leakage
- Remote
GitPython before 3.1.57 contains an incomplete denylist in the unsafe_git_archive_options guard that omits –add-file and –add-virtual-file options. Attackers can supply these options to Repo.archive() to read arbitrary files from the filesystem and include them in the returned archive.
- CWE
- CWE-73
- CVSS base score
- 7.1
- Published
- 2026-08-13
- OWASP
- A04 Insecure Design
- Orthogonal defect classification
- Checking
- Code defect classification
- Missing Check
- Category
- Information Leakage
- Subcategory
- Information Disclosure
- Accessibility scope
- Remote
- Impact
- Information Disclosure
- Affected component
- GitPython
- Fixed by upgrading
- Yes
Solution
Upgrade GitPython to 3.1.58 or any later version.
Vulnerable code sample
import os
from git import Repo
def create_archive(repo_path: str, output_path: str, archive_format: str, extra_opts: list):
"""
Create an archive of the given repository using user‑supplied extra options.
"""
repo = Repo(repo_path)
# VULNERABLE: passes unchecked extra options to Repo.archive()
repo.archive(open(output_path, 'wb'), format=archive_format, extra_args=extra_opts)Patched code sample
import os
from git import Repo
def create_archive(repo_path: str, output_path: str, archive_format: str, extra_opts: list):
"""
Create an archive of the given repository using user‑supplied extra options.
"""
repo = Repo(repo_path)
# FIX: filter out unsafe '--add-file' and '--add-virtual-file' options
safe_opts = [opt for opt in extra_opts if not opt.startswith('--add-file') and not opt.startswith('--add-virtual-file')]
repo.archive(open(output_path, 'wb'), format=archive_format, extra_args=safe_opts)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.
- Block unsafe archive additions and bundle URI (gitpython-developers/GitPython)
git/repo/base.py
Cite this entry
@misc{vaitp:cve202673619,
title = {{GitPython unsafe_git_archive_options allows reading arbitrary files via --add-file.}},
author = {Bogaerts, Fr\'ed\'eric and Ivaki, Naghmeh and Fonseca, Jos\'e},
year = {2026},
note = {VAITP Python Vulnerability Dataset, entry CVE-2026-73619},
howpublished = {\url{https://netpack.pt/vaitp/vulnerability/CVE-2026-73619/}}
}
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 ::
