Tach: GitPython: Arbitrary file overwrite via git diff --output argument injection in Diffable.diff (key- and value-controlled) (CVE-2026-73624)
CVE-2026-73624 is a high-severity vulnerability in the Tach GitPython integration where the Diffable.diff() method improperly forwards user-controlled arguments to git diff commands without validating unsafe options. This allows an attacker with limited privileges to overwrite arbitrary files with diff output by injecting the --output argument. The flaw affects versions up to 3.1.53. A patch is available to add proper option checks and prevent option injection.
AI Analysis
Technical Summary
The Diffable.diff() method in Tach's GitPython integration forwards **kwargs directly into git diff/diff-tree commands without invoking check_unsafe_options, allowing injection of git command-line options. Specifically, the 'other' argument is inserted before the '--' separator, enabling an attacker to supply '--output=<path>' which causes git to write diff output to an arbitrary file path. This leads to arbitrary file overwrite at the process privilege level. Both key-controlled (e.g., output='/path') and value-controlled (e.g., other='--output=/path') injections were verified on version 3.1.53. The vulnerability affects all versions up to and including 3.1.53. The suggested fix is to add check_unsafe_options to Diffable.diff and/or place a '--end-of-options' marker before the 'other' argument to prevent option parsing.
Potential Impact
An attacker with the ability to call Diffable.diff() with crafted arguments can overwrite or corrupt any file writable by the process, including sensitive files such as ~/.ssh/authorized_keys, configuration files, or lockfiles. The content written is the real diff or patch output generated by git, which is attacker-influenced. This can lead to privilege escalation or persistent compromise depending on the overwritten file. The impact is high due to arbitrary file overwrite at process privilege.
Mitigation Recommendations
A patch is available that adds the check_unsafe_options guard to Diffable.diff, preventing injection of unsafe git command options. Additionally, placing a '--end-of-options' marker before the 'other' argument prevents it from being interpreted as an option. Users should upgrade to a fixed version beyond 3.1.53 or apply the patch if available. Until patched, avoid passing untrusted input to Diffable.diff's arguments that could be interpreted as git options.
Tach: GitPython: Arbitrary file overwrite via git diff --output argument injection in Diffable.diff (key- and value-controlled) (CVE-2026-73624)
Description
CVE-2026-73624 is a high-severity vulnerability in the Tach GitPython integration where the Diffable.diff() method improperly forwards user-controlled arguments to git diff commands without validating unsafe options. This allows an attacker with limited privileges to overwrite arbitrary files with diff output by injecting the --output argument. The flaw affects versions up to 3.1.53. A patch is available to add proper option checks and prevent option injection.
CVSS v3.1
Score 8.1high
Affected software
Run on your own infrastructure? Check whether these packages are installed with threat-finder — our free open-source scanner.
AI-Powered Analysis
Machine-generated threat intelligence
Technical Analysis
The Diffable.diff() method in Tach's GitPython integration forwards **kwargs directly into git diff/diff-tree commands without invoking check_unsafe_options, allowing injection of git command-line options. Specifically, the 'other' argument is inserted before the '--' separator, enabling an attacker to supply '--output=<path>' which causes git to write diff output to an arbitrary file path. This leads to arbitrary file overwrite at the process privilege level. Both key-controlled (e.g., output='/path') and value-controlled (e.g., other='--output=/path') injections were verified on version 3.1.53. The vulnerability affects all versions up to and including 3.1.53. The suggested fix is to add check_unsafe_options to Diffable.diff and/or place a '--end-of-options' marker before the 'other' argument to prevent option parsing.
Potential Impact
An attacker with the ability to call Diffable.diff() with crafted arguments can overwrite or corrupt any file writable by the process, including sensitive files such as ~/.ssh/authorized_keys, configuration files, or lockfiles. The content written is the real diff or patch output generated by git, which is attacker-influenced. This can lead to privilege escalation or persistent compromise depending on the overwritten file. The impact is high due to arbitrary file overwrite at process privilege.
Mitigation Recommendations
A patch is available that adds the check_unsafe_options guard to Diffable.diff, preventing injection of unsafe git command options. Additionally, placing a '--end-of-options' marker before the 'other' argument prevents it from being interpreted as an option. Users should upgrade to a fixed version beyond 3.1.53 or apply the patch if available. Until patched, avoid passing untrusted input to Diffable.diff's arguments that could be interpreted as git options.
Technical Details
- Gcve Source
- db.gcve.eu
- Osv Id
- BREW-tach-CVE-2026-73624
- Osv Schema Version
- 1.7.3
- Ecosystems
- ["Homebrew"]
- Cvss Version
- 3.1
- State
- PUBLISHED
Threat ID: 6ac1397ba43b0b3b89d63b43
Added to database: 10/03/2026, 17:20:59 UTC
Last enriched: 10/03/2026, 17:29:22 UTC
Last updated: 10/04/2026, 02:46:06 UTC
Views: 2
Community Reviews
0 reviewsCrowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.
Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.
Actions
Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.
Need more coverage?
Upgrade to Pro Console for AI refresh and higher limits.
For incident response and remediation, OffSeq services can help resolve threats faster.
Latest Threats
Check if your credentials are on the dark web
Instant breach scanning across billions of leaked records. Free tier available.