{"uuid": "ac794dbe-eb07-48da-81b5-0db255fc527b", "vulnerability_lookup_origin": "1a89b78e-f703-45f3-bb86-59eb712668bd", "author": "9f56dd64-161d-43a6-b9c3-555944290a09", "vulnerability": "GHSA-3f7w-8rr8-f37f", "type": "seen", "source": "https://gist.github.com/alon710/e29226c330282c9416a9859028fe2877", "content": "# GHSA-3F7W-8RR8-F37F: GHSA-3f7w-8rr8-f37f: Arbitrary File Overwrite and Read via Unguarded Argument Forwarding in GitPython\n\n&gt; **CVSS Score:** 8.1\n&gt; **Published:** 2026-08-03\n&gt; **Full Report:** https://cvereports.com/reports/GHSA-3F7W-8RR8-F37F\n\n## Summary\nAn argument injection vulnerability in GitPython allows remote or local attackers to execute arbitrary file reads or arbitrary file overwrites via unsafe command option forwarding. This occurs because the wrapper methods `IndexFile.checkout()` and `TagReference.create()` fail to validate parameters before passing them to system-level git invocations.\n\n## TL;DR\nGitPython versions prior to 3.1.57 are vulnerable to argument injection, enabling arbitrary file overwrite via IndexFile.checkout() and arbitrary file read via TagReference.create() because keyword arguments are forwarded unsanitized to the underlying git binary.\n\n## Exploit Status: POC\n\n## Technical Details\n\n- **CWE ID**: CWE-88 (Argument Injection), CWE-20 (Improper Input Validation)\n- **Attack Vector**: Network\n- **CVSS Score**: 8.1\n- **Impact**: High (Arbitrary File Overwrite / Arbitrary File Read)\n- **Exploit Status**: Proof-of-Concept Available\n- **KEV Status**: Not Listed\n\n## Affected Systems\n\n- GitPython\n- **gitpython**: &lt; 3.1.57 (Fixed in: `3.1.57`)\n\n## Mitigation\n\n- Upgrade GitPython to version 3.1.57 or newer to enforce default parameter validation blocklists.\n- Sanitize application-level inputs to ensure keys like 'prefix', 'F', and 'file' are stripped from user-controlled dictionary unpacking before passing arguments to GitPython methods.\n- Apply the principle of least privilege by running repository-parsing applications within isolated, non-root user accounts or containerized environments.\n\n**Remediation Steps:**\n1. Identify all direct dependencies on GitPython within requirements files or package lock files.\n2. Execute the package manager update command: `pip install --upgrade gitpython&gt;=3.1.57`.\n3. Search the codebase for usages of `IndexFile.checkout()` and `TagReference.create()` to ensure no manual enablement of `allow_unsafe_options=True` exists without proper sanitization.\n\n## References\n\n- [GitHub Security Advisory GHSA-3f7w-8rr8-f37f](https://github.com/gitpython-developers/GitPython/security/advisories/GHSA-3f7w-8rr8-f37f)\n- [GitPython Pull Request 2193](https://github.com/gitpython-developers/GitPython/pull/2193)\n- [GitPython Fix Commit](https://github.com/gitpython-developers/GitPython/commit/3af0c2516c5e18c829da30338614688f6b69b49c)\n- [GitPython Source Repository](https://github.com/gitpython-developers/GitPython)\n- [GitPython Release 3.1.57](https://github.com/gitpython-developers/GitPython/releases/tag/3.1.57)\n\n\n---\n*Generated by [CVEReports](https://cvereports.com/reports/GHSA-3F7W-8RR8-F37F) - Automated Vulnerability Intelligence*", "creation_timestamp": "2026-08-04T08:31:39.801578Z"}