{"id":"CVE-2026-73624","aliases":["CVE-2026-73624","GHSA-fjr4-x663-mwxc","PYSEC-2026-3995"],"related":[],"kind":"vulnerability","state":"published","title":"GitPython before 3.1.54 Arbitrary File Overwrite via diff","summary":"GitPython versions before 3.1.54 contain an arbitrary file overwrite vulnerability in the Diffable.diff method that fails to validate git options passed through kwargs. Attackers can supply the --output argument via the other parameter or output kwarg to write patch content to attacker-chosen file paths at process privilege level.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"GitPython versions before 3.1.54 contain an arbitrary file overwrite vulnerability in the Diffable.diff method that fails to validate git options passed through kwargs. Attackers can supply the --output argument via the other parameter or output kwarg to write patch content to attacker-chosen file paths at process privilege level.","source":"cvelist"},{"lang":"en","text":"## Summary\n`Diffable.diff()` forwards `**kwargs` straight into `diff`/`diff_tree` with **no** `check_unsafe_options` guard. `Diffable` is mixed into `Commit`, `Tree`, `IndexFile`, and `Submodule`, giving a broad surface. `git diff --output=<path>` writes real patch content to an attacker-chosen path, enabling arbitrary file overwrite.\n\n## Root Cause\n`diff.py:188-283` builds and runs the diff command with no `check_unsafe_options` anywhere in the method (grep-confirmed). Additionally `diff.py:265` does `args.insert(0, other)`, placing the caller-supplied `other` ref BEFORE the `--` separator, so a value of `--output=/path` is parsed by git as an option — a value-only control path requiring no kwarg key.\n\n## Impact\nOverwrite/corrupt any file at process privilege with attacker-chosen path (e.g. `~/.ssh/authorized_keys`, configs, lockfiles). Content is real diff/patch bytes (attacker-influenced). Per the skill's rule, controlling WHICH file is overwritten = I:H regardless of content constraints.\n\n## Proof of Concept\n```python\n# Key-control:\ncommit.diff(other_commit, output='/home/app/.ssh/authorized_keys')   # victim overwritten with diff (105 bytes verified)\n# Value-control (attacker controls only the ref string):\ncommit.diff(other='--output=/home/app/.ssh/authorized_keys')          # 14-byte victim -> 146 bytes of diff-tree output\n```\n\n## Attack Chain\n1. Entry (value-control): `commit.diff(other=<user ref>)` with `other = \"--output=/home/app/.ssh/authorized_keys\"`. Guard: none in `Diffable.diff`. Bypass proof: no `check_unsafe_options` in the method body (grep); `other` inserted pre-`--` at diff.py:265.\n2. Sink: `git diff-tree <sha> --output=/home/app/.ssh/authorized_keys -r ...` -> git opens+truncates the target then writes diff content. Impact: overwrite/corrupt any file at process privilege (attacker chooses the path). Verified argv and victim overwrite live.\n\n## Bypass Evidence\nLive-verified on HEAD (tag 3.1.53): both key-control (`output=`) and value-control (`other='--output=...'`) overwrote a victim file with real diff-tree content; argv confirmed `['git','diff-tree','<sha>','--output=/victim','-r',...]`. This is the same value-control model GHSA-956x deemed fix-worthy for `iter_commits(rev='--output=')` — but `diff` is a distinct, unguarded sink NOT touched by that fix.\n\n## Affected Versions\n`<= 3.1.53`\n\n## Suggested Fix\nAdd `check_unsafe_options` to `Diffable.diff` (mirroring `iter_commits`/`archive`), and/or place `--end-of-options` before the `other` ref so it cannot be parsed as an option.\n\n---\nReported by **zx (Jace)** — GitHub: @manus-use","format":"markdown","source":"ghsa"},{"lang":"es","text":"Las versiones de GitPython anteriores a la 3.1.54 contienen una vulnerabilidad de sobrescritura arbitraria de archivos en el método Diffable.diff que no valida las opciones de git pasadas a través de kwargs. Los atacantes pueden proporcionar el argumento --output a través del parámetro other o del kwarg output para escribir contenido del parche en rutas de archivo elegidas por el atacante al nivel de privilegio del proceso.","source":"nvd"}],"published":"2026-07-24T16:41:20.000Z","modified":"2026-10-24T15:10:00.190Z","severity":{"scorer":"VulnCheck","scheme":"CVSS:4.0","vector":"CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:N/VC:N/VI:H/VA:H/SC:N/SI:N/SA:N","score":7.2,"rating":"HIGH"},"severities":[{"scorer":"VulnCheck","scheme":"CVSS:4.0","vector":"CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:N/VC:N/VI:H/VA:H/SC:N/SI:N/SA:N","score":7.2,"rating":"HIGH"},{"scorer":"VulnCheck","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:H/A:H","score":8.1,"rating":"HIGH"},{"scorer":"GitHub","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:H/A:H","score":8.1,"rating":"HIGH"},{"scorer":"PyPA Advisory Database","scheme":"CVSS:4.0","vector":"CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:N/VC:N/VI:H/VA:H/SC:N/SI:N/SA:N/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X"}],"cwes":["CWE-88"],"affected":[{"ranges":[{"type":"semver","introduced":"0","fixed":"3.1.54","status":"affected"},{"type":"semver","version":"3.1.54","status":"unaffected"}],"vendor":"gitpython-developers","product":"GitPython","source":"cvelist"},{"ranges":[{"type":"ecosystem","introduced":"0","status":"affected","fixed":"3.1.54"}],"ecosystem":"PyPI","package":"gitpython","purl":"pkg:pypi/gitpython","source":"ghsa"},{"ranges":[{"status":"affected","fixed":"3.1.54"}],"vendor":"gitpython_project","product":"gitpython","cpe":"cpe:2.3:a:gitpython_project:gitpython:*:*:*:*:*:python:*:*","source":"nvd"},{"ranges":[{"type":"ecosystem","introduced":"0","status":"affected","fixed":"3.1.54"}],"ecosystem":"PyPI","package":"gitpython","purl":"pkg:pypi/gitpython","source":"pysec"}],"references":[{"url":"https://github.com/gitpython-developers/GitPython/security/advisories/GHSA-fjr4-x663-mwxc","tags":["evidence","exploit","mitigation","third-party-advisory","vendor-advisory","web"],"sources":["cvelist","ghsa","nvd","pysec"]},{"url":"https://www.vulncheck.com/advisories/gitpython-before-arbitrary-file-overwrite-via-diff","tags":["advisory","third-party-advisory"],"sources":["cvelist","nvd","pysec"]},{"url":"https://github.com/gitpython-developers/GitPython/pull/2180","tags":["web"],"sources":["ghsa"]},{"url":"https://github.com/gitpython-developers/GitPython/commit/1d51b891d7f236044a6aa17498ec682b63dad6e6","tags":["web"],"sources":["ghsa"]},{"url":"https://github.com/gitpython-developers/GitPython","tags":["package"],"sources":["ghsa"]},{"url":"https://github.com/gitpython-developers/GitPython/releases/tag/3.1.54","tags":["web"],"sources":["ghsa"]}],"credits":["manus-use"],"assigner":"VulnCheck","ssvc":{"scorer":"CISA-ADP","exploitation":"poc","automatable":"no","technicalImpact":"total","date":"2026-08-13T15:04:50.912Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-73624","url":"https://www.cve.org/CVERecord?id=CVE-2026-73624","licence":"CVE Terms of Use","modified":"2026-10-08T15:24:44.790Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-fjr4-x663-mwxc","url":"https://github.com/advisories/GHSA-fjr4-x663-mwxc","licence":"CC-BY-4.0","modified":"2026-09-29T09:10:55.738Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-73624","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-73624","licence":"Public domain","modified":"2026-10-24T15:10:00.190Z"},{"source":"pysec","name":"PyPA Advisory Database","id":"PYSEC-2026-3995","url":"https://osv.dev/vulnerability/PYSEC-2026-3995","licence":"CC-BY-4.0","modified":"2026-09-29T09:00:02.996Z"}],"updatedAt":"2026-11-25T22:59:32.709Z","epss":{"score":0.00553,"percentile":0.39854,"date":"2026-11-30T12:00:22.000Z"}}