[Aikido] Fix security issue in gitpython via minor version upgrade from 3.1.57 to 3.1.61 - #22
Closed
aikido-autofix[bot] wants to merge 1 commit into
Closed
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Upgrade GitPython to fix arbitrary file read/write, path traversal, config injection, and RCE vulnerabilities in git operations.
✅ 7 CVEs resolved by this upgrade
This PR will resolve the following CVEs:
IndexFile.remove()andHead.checkout()methods that forward unsanitized kwargs to git commands, allowing attackers to read arbitrary files by combining--pathspec-from-fileand--pathspec-file-nulflags to leak file contents through error messages.IndexFile.from_tree,reset, andmerge_treefail to sanitize caller-controlled treeish arguments passed togit read-tree, allowing injection of--index-outputto overwrite arbitrary files with git-index blobs. This enables arbitrary file destruction/corruption at process privileges.Repo.init()passes unsanitized kwargs togit init, allowing an attacker to inject--templateparameter that plants malicious git hooks for arbitrary code execution on the next git operation.=,#,;,[,], whitespace), allowing attackers to inject arbitrary git-config directives by embedding these characters in option names. This enables remote code execution through forged directives likecore.sshCommandorcore.hooksPathwhen applications forward caller-controlled option names to the config writer.split_single_char_options=False, causing the safety check to miss the smuggled option before it's transformed into a dangerous git argument. This affects all guarded methods at the defaultallow_unsafe_options=Falsesetting.core.hooksPathand execute arbitrary code through git hooks when writing config files.🔗 Related Tasks
🤖 Remediation details
Bump
gitpythonto remediate multiple security advisoriesThis PR updates the direct dependency
gitpythonin the rootpyproject.tomlto address several security advisories affecting versions below3.1.59. The change raises the declared semver floor and causesuv.lockto resolve a patched release.gitpython
gitpythonis declared as a direct dependency in the rootpyproject.toml. The existing range spec>=3.1.55was updated to>=3.1.59to enforce a patched minimum, anduv lock --upgrade-package gitpythonresolved the lockfile to3.1.61. All seven advisories (six GHSA entries requiring ≥ 3.1.58 and one Aikido advisory requiring ≥ 3.1.59) are remediated by this single spec change, as every affected version falls below3.1.59.Version changes
gitpython>=3.1.55(resolved3.1.57)>=3.1.59(resolved3.1.61)