Block unsafe underscored git kwargs / Fix for GHSA-rpm5-65cw-6hj4#2131
Open
WesR wants to merge 3 commits intogitpython-developers:mainfrom
Open
Block unsafe underscored git kwargs / Fix for GHSA-rpm5-65cw-6hj4#2131WesR wants to merge 3 commits intogitpython-developers:mainfrom
WesR wants to merge 3 commits intogitpython-developers:mainfrom
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR addresses GHSA-rpm5-65cw-6hj4 by ensuring unsafe git options are blocked even when supplied via underscored kwarg names (e.g., upload_pack), and expands test coverage to prevent regressions.
Changes:
- Canonicalize option/kwarg names (strip
-/--, drop values, convert_→-) before performing unsafe-option checks. - Extend remote/clone tests to include underscored unsafe kwargs.
- Add a focused unit test ensuring
check_unsafe_optionscatches multiple normalized forms.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
git/cmd.py |
Adds option-name canonicalization and uses it to match unsafe options robustly across kwarg/CLI forms. |
test/test_remote.py |
Expands fetch/pull/push unsafe option tests to include underscored kwargs. |
test/test_git.py |
Adds direct unit tests for Git.check_unsafe_options normalization behavior. |
test/test_clone.py |
Expands clone/clone_from unsafe option tests to include underscored kwargs. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Byron
reviewed
Apr 21, 2026
Member
Byron
left a comment
There was a problem hiding this comment.
Thanks a lot!
This looks good enough to me, but let's wait for Copilot.
Byron
requested changes
Apr 21, 2026
Member
Byron
left a comment
There was a problem hiding this comment.
Let's address the concerns stated in the auto review.
Author
|
Done! |
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.
No description provided.