| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
There was a problem hiding this comment.
This PR hardens GitPython’s unsafe Git option validation to block additional high-risk option spellings and close bypasses where unsafe options could be smuggled via argument transformation, while preserving explicit opt-in via allow_unsafe_options=True.
Changes:
Copilot reviewed 7 out of 7 changed files in this pull request and generated no comments.
Show a summary per file| File | Description |
|---|---|
| git/cmd.py | Expands option-candidate detection to include split single-char kwarg values that look like options. |
| git/repo/base.py | Adds --template to unsafe_git_clone_options and documents why it’s unsafe. |
| git/diff.py | Adds allow_unsafe_options and blocks unsafe revision/output options prior to diff invocation. |
| git/index/base.py | Adds allow_unsafe_options to index diff and enforces unsafe-option checks; propagates flag through delegated diff calls. |
| test/test_git.py | Adds regression tests ensuring split single-char kwarg values are included in unsafe-option candidate detection. |
| test/test_diff.py | Adds regression tests ensuring diff output options are rejected by default and allowed only with explicit opt-in. |
| test/test_clone.py | Extends clone unsafe-option tests to cover --template and template=.... |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Sorry, something went wrong.
<!-- agent --> Single-character keyword arguments are transformed into an option token and a separate value token. The unsafe-option candidate builder only checked the keyword name, allowing an option-like value to bypass guards shared by clone, remote, revision, blame, and archive operations. Include dash-prefixed values only when short options are actually split, including sequence values, while preserving bare values and the non-splitting compatibility path. Git baseline a23bace9 defines clone -n and --upload-pack as distinct options, matching the argv boundary this validation now preserves. Refs GHSA-r9mr-m37c-5fr3. Co-authored-by: Sebastian Thiel <sebastian.thiel@icloud.com>
<!-- agent --> Treat git clone --template as unsafe because caller-controlled templates can install hooks that execute during clone. Add regression coverage for both direct option and keyword forms. References GHSA-6p8h-3wgx-97gf. Validated against Git baseline a23bace9. Co-authored-by: Sebastian Thiel <sebastian.thiel@icloud.com>
<!-- agent --> Reject unsafe diff options before revision parsing or Git invocation so callers cannot write command output to arbitrary filesystem paths. Cover commit and index diffs, including option-like revisions, and preserve an explicit allow_unsafe_options escape hatch. References GHSA-fjr4-x663-mwxc. Validated against Git baseline a23bace9. Co-authored-by: Sebastian Thiel <sebastian.thiel@icloud.com>
| Back | FazBrowse Home | New Git URL |
Tasks
This section is for Byron only. Models continuing this PR must not add, remove, check, uncheck, rename, or reorder checkboxes here.
Everything below this line was generated by Codex GPT-5.
Created by Codex on behalf of Byron. Byron will review before this is ready to merge.
Summary
Harden GitPython's unsafe-option validation against three high-severity advisories affecting GitPython <= 3.1.53:
No CVEs or patched release versions are assigned yet.
Changes
Validation
Git behavior was checked against baseline a23bace9.