GitPython: cloning a malicious repo can leak local files
If an app uses GitPython to clone a repository from a URL an attacker controls, the attacker can trick it into showing the contents of a file on the app's server, such as system user lists. No login is needed by the attacker.
| Severity | HighCVSS 7.1 of 10 |
|---|---|
| Being exploited? | UnclearNo reports either way yet |
| Fix available? | YesGitPython 3.2.0 · since 27 Oct 2026 |
| How sure is this? | Official sourceBacked by an official source |
How the attack works simplified
- 1Attacker publishes repoDefault branch named as a git option
- 2App clones the URLConsumer runs a normal clone
- 3Checkout runs unguardedBranch name reaches git without '--'
- 4Git reads local fileOption treats path as input file
- 5Contents echoed backFile text appears in error message
- ResultAttacker reads server files
What happened
Head.checkout() passes the branch name to git checkout without a '--' separator, so a branch named like a git option (--pathspec-from-file=/etc/passwd) is interpreted as an option and file contents are returned in the error message.
Are you affected?
You are affected if you use GitPython 3.1.62 or earlier and your application clones repositories from URLs that users or outsiders can supply, then checks out the default branch.
| Package / product | Affected versions | Fixed in |
|---|---|---|
| GitPython · pip | <= 3.1.62 | 3.2.0 |
What to do
- Update GitPython to 3.2.0 or later (pip install --upgrade 'GitPython>=3.2.0')
- If you cannot upgrade yet, do not clone or check out untrusted repository URLs, or run the clone in a sandbox with no sensitive files readable
- Review logs for clones of unfamiliar repositories whose branch names start with '--'
Timeline
- 27 Oct 2026, 15:28 UTCPublicly disclosed
- 27 Oct 2026, 15:28 UTCReported by GitHub Advisory · GitHub Advisory
- 27 Oct 2026, 15:29 UTCPicked up by Zero Radar
Sources 1 report, oldest first
Official vendor, government CERT or advisory database
- GitPython: arbitrary file read via attacker-controlled branch name in `Head.checkout()` (incomplete fix of CVE-2026-78679)GitHub Advisory · 27 Oct 2026, 15:28 UTC
Technical details
- ID
- GHSA-23mf-xhv8-69c2
- CVSS
- 7.1 / 10
- Disclosed
- 27 Oct 2026, 15:28 UTC
- On Zero Radar
- 27 Oct 2026, 15:29 UTC (1 min after disclosure)
- Last change
- 27 Oct 2026, 15:29 UTC
The plain-language parts and the attack diagram were written by an AI model (anthropic/claude-haiku-5.5) from the sources above. Facts like versions, exploitation and dates come from the sources themselves. How Zero Radar works