Skip to content

[Aikido] Fix security issue in gitpython via minor version upgrade from 3.1.57 to 3.1.58 - #19

Draft
aikido-autofix[bot] wants to merge 1 commit into
trunkfrom
fix/aikido-security-update-packages-83823642-5j4z
Draft

[Aikido] Fix security issue in gitpython via minor version upgrade from 3.1.57 to 3.1.58#19
aikido-autofix[bot] wants to merge 1 commit into
trunkfrom
fix/aikido-security-update-packages-83823642-5j4z

Conversation

@aikido-autofix

@aikido-autofix aikido-autofix Bot commented Aug 8, 2026

Copy link
Copy Markdown

Upgrade GitPython to fix five HIGH-severity vulnerabilities: config-option injection enabling RCE via core.sshCommand, unsafe-option guard bypass via single-char kwargs, path-traversal submodule directory creation, arbitrary file overwrite via read-tree, and hook-planting via unguarded Repo.init().

✅ 6 CVEs resolved by this upgrade

This PR will resolve the following CVEs:

Issue Severity           Description
GHSA-jm78-9fvv-mhgr
HIGH
[gitpython] GitPython's config option-name validator fails to reject special characters (=, #, ;, [, ], whitespace), allowing attackers to inject arbitrary git-config directives by embedding these characters in option names. This enables remote code execution via core.sshCommand or core.hooksPath when an application forwards attacker-controlled option names to the config writer.
GHSA-wvpp-8hx9-p66j
HIGH
[gitpython] A guard bypass vulnerability allows arbitrary command execution by combining a single-character kwarg with split_single_char_options=False, causing the security check to miss the smuggled option while transform_kwarg emits a joined token that git parses as --upload-pack=<cmd>. This incomplete fix of a prior vulnerability affects all guarded methods at the default allow_unsafe_options=False setting.
GHSA-hmq2-w58f-27jc
HIGH
[gitpython] GitPython fails to validate submodule names, allowing path traversal attacks to create Git repositories at arbitrary filesystem locations outside the intended clone directory. When a victim clones a malicious repository and initializes submodules, an attacker can write arbitrary content to any accessible path on the system.
GHSA-4gmw-gg2m-w46p
HIGH
[gitpython] IndexFile.from_tree, reset, and merge_tree fail to sanitize caller-controlled treeish arguments passed to git read-tree, allowing injection of --index-output to overwrite arbitrary files with git-index blobs. This enables arbitrary file destruction/corruption at process privileges.
GHSA-9rj7-rf2p-w77r
HIGH
[gitpython] Repo.init() passes unsanitized kwargs to git init, allowing an attacker to inject --template parameter that plants malicious git hooks for arbitrary code execution on the next git operation.
GHSA-hh9p-6wh2-4mfc
MEDIUM
[gitpython] Arbitrary file read vulnerability in IndexFile.remove() and Head.checkout() methods that forward unsanitized kwargs to git commands, allowing attackers to read arbitrary files via --pathspec-from-file and --pathspec-file-nul options with file contents returned in error messages.
🤖 Remediation details

Fix gitpython security vulnerabilities by bumping minimum version to 3.1.58

This PR remediates six security advisories (ranging HIGH to MEDIUM severity) in the gitpython package. The fix is applied in the root pyproject.toml (declared direct dependency) and reflected in uv.lock (resolved lockfile).

gitpython

gitpython is declared as a direct dependency in the root pyproject.toml. The lower bound of the >= range spec was raised from >=3.1.55 to >=3.1.58, which is the minimum patched release addressing all six advisories. Running uv lock --upgrade-package gitpython resolved the lockfile from the previously pinned 3.1.57 to 3.1.58. No parent bumps, overrides, or constraint entries were required because the package is a direct dependency and the patched version was immediately reachable under the existing resolver constraints.

Version changes

Package From To Why updated
gitpython >=3.1.55 (resolved 3.1.57) >=3.1.58 (resolved 3.1.58) Direct CVE fix

@codecov

codecov Bot commented Aug 8, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ All tests successful. No failed tests found.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants