| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
GHSA-3f7w-8rr8-f37f reports that caller-controlled options forwarded by IndexFile.checkout() and TagReference.create() can make Git write to or read from arbitrary filesystem paths. Add regression coverage proving the unsafe options are rejected by default while preserving the explicit allow_unsafe_options escape hatch. Reuse GitPython's existing option candidate normalization and unsafe-option guard at both public API boundaries. Git baseline: a23bace963d508bd96983cc637131392d3face18. Documentation/git-checkout-index.adoc defines --prefix as prepending an output path, and Documentation/git-tag.adoc defines -F/--file as reading a tag message from a file. Co-authored-by: Sebastian Thiel <sebastian.thiel@icloud.com>
GHSA-539m-9xh6-q6rr reports incomplete unsafe option lists for archive inputs and clone bundle URLs. Caller-controlled archive additions can expose or inject filesystem content, while clone --bundle-uri can dereference an additional caller-controlled URL. Extend the existing archive denylist with --add-file and --add-virtual-file, and the clone denylist with --bundle-uri. Regression coverage exercises archive kwargs plus both clone multi-option and keyword paths. Git baseline: a23bace963d508bd96983cc637131392d3face18. Documentation/git-archive.adoc defines --add-file/--add-virtual-file, and Documentation/git-clone.adoc defines --bundle-uri as fetching from the supplied URI. Co-authored-by: Sebastian Thiel <sebastian.thiel@icloud.com>
There was a problem hiding this comment.
This PR strengthens GitPython’s security posture by blocking additional unsafe filesystem-path and URL options across higher-level APIs by default, while preserving an explicit allow_unsafe_options=True opt-out for callers that need these capabilities.
Changes:
Copilot reviewed 7 out of 7 changed files in this pull request and generated 2 comments.
Show a summary per file| File | Description |
|---|---|
| git/repo/base.py | Extends clone/archive unsafe option denylists to cover bundle URI and archive file-injection options. |
| git/refs/tag.py | Blocks tag message-from-file options by default in TagReference.create(), with an explicit opt-out. |
| git/index/base.py | Blocks checkout-index --prefix usage by default in IndexFile.checkout(), with an explicit opt-out. |
| test/test_clone.py | Adds clone tests covering --bundle-uri and bundle_uri being rejected by default. |
| test/test_repo.py | Adds archive tests covering add_file and add_virtual_file being rejected by default. |
| test/test_refs.py | Adds tests asserting TagReference.create() rejects -F/--file unless explicitly allowed. |
| test/test_index.py | Adds a test asserting IndexFile.checkout() rejects --prefix unless explicitly allowed. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Sorry, something went wrong.
| 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
Block unsafe filesystem-path and URL options in GitPython APIs by default while retaining the explicit allow_unsafe_options=True opt-out.
Advisory summaries
GHSA-3f7w-8rr8-f37f
GHSA-539m-9xh6-q6rr
Both advisories remain private, so exploit details are intentionally omitted here.
Validation
Git behavior was checked against Git a23bace963d508bd96983cc637131392d3face18 and the relevant git-checkout-index, git-tag, git-archive, and git-clone documentation.