Repository navigation
Conversation
Pursue the repository-owner follow-up to `GHSA-f8wj-prgh-h9j7`, reported against released `GitPython` 3.2.1. Current `main` already rejects every leading-dash branch name through the unconditional `Git._check_operand()` guard in `Head.checkout()`, introduced in `212573bf`. Preserve that shared prevention and make its coverage and public contract explicit. Expand the existing operand tests to short options, attached option values, and terminators, with both `allow_unsafe_options` settings. Extend the scripted cloned-branch fixture with uncommitted work, and verify rejection does not launch Git or change the branch, commit, index status, file content, or untracked-file status. Document the exception and the independent branch validation in the API and unreleased changes. Git's baseline agrees: `check_branch_ref()` rejects leading-dash branch names, and `t/t1402-check-ref-format.sh` tests that rule. Reference source: `6de20f6092dcf9bdb1c8efe03db4b70c82b423dd` (`v2.56.0-116-g6de20f6092`). Placing `--` before the branch would instead select path checkout semantics. Validation used Python 3.12.14, Git 2.54.0, and GixPython 0.3.0 on macOS: - The three new cloned-branch cases failed with the unaltered `Head.checkout()` method extracted from the `3.2.1` tag at `c179357b` and loaded into the current test harness in a disposable process. This was method-level reproduction, not a full installed-release test. - `test/test_positional_args.py` and `test/test_refs.py` passed 184 tests and 24 subtests on each backend through `test/run-local.py`. - The final cloned-branch fixture passed all four cases on each backend. - Ruff lint/format, ShellCheck, and `git diff --check` passed. No new runtime guard is needed. A patched release and advisory publication remain repository-owner decisions; neither is performed by this follow-up. Agent-Model: unknown
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.
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(model version unavailable).Created by Codex on behalf of Byron. Byron will review before this is ready to merge.
This repository-owner follow-up verifies checkout protection for a security report against released GitPython 3.2.1. Current
mainalready contains the class-wide branch operand validation from212573bf; this PR locks in the additional input variants and documents that contract.Extend the existing operand and real-clone regressions to cover more option spellings under both unsafe-option settings. Rejection must happen before a Git process launches and preserve the branch, commit, index status, uncommitted file content, and untracked-file status. Document
UnsafeOptionErrorand that branch validation remains active withallow_unsafe_options=True.Advisory summary
GHSA-f8wj-prgh-h9j7 is a draft advisory with medium severity. The report concerns PyPI package GitPython and tested version 3.2.1. The advisory's structured affected range and patched version are unset, and no CVE is assigned. This description omits reproduction details from the draft advisory. This PR does not publish the advisory or assign a patched release.
Validation
Head.checkout()method from tag3.2.1(c179357b) loaded into the current harness in a disposable process. This is method-level reproduction, not a full installed-release test.test/test_positional_args.pyandtest/test_refs.pymodules pass 184 tests and 24 subtests on each backend throughtest/run-local.py. All four cloned-branch cases also pass on each backend after the final fixture edit.6de20f6(v2.56.0-116-g6de20f6092):check_branch_ref()andt/t1402-check-ref-format.shreject leading-dash branch names. A separator before the branch would select path checkout semantics.codex review --commit 671ea00invocation failed before review startup because the sandbox blocked app-server initialization. An independent Codex agent review of the committed change found no actionable issues.Commit:
671ea00—test(refs): cover all option-shaped checkout branch operands.All 67 hosted CI checks pass for
671ea00, including the Linux/macOS/Windows matrix, GixPython, supported-runtime imports, Cygwin, Alpine, lint, documentation, downstream integrations, and the backend benchmark. No CI fixes or retries were needed. There are no review comments or unresolved review threads at completion.Release preparation and advisory publication remain outside this PR.