GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Block unsafe Git file and URL options by Byron · Pull Request #2193 · gitpython-developers/GitPython

Conversation

@Byron

@Byron Byron commented Jul 26, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member

Tasks

This section is for Byron only. Models continuing this PR must not add, remove, check, uncheck, rename, or reorder checkboxes here.

  • refackiew

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.

  • Guard filesystem-path options forwarded by IndexFile.checkout() and TagReference.create().
  • Extend the existing archive denylist for caller-controlled additions.
  • Extend the existing clone denylist for caller-controlled bundle URLs.

Advisory summaries

GHSA-3f7w-8rr8-f37f

  • Advisory: GHSA-3f7w-8rr8-f37f
  • Severity: High
  • Package/range: GitPython (pip), <= 3.1.55
  • Patched versions: not yet assigned
  • CVE: not yet assigned

GHSA-539m-9xh6-q6rr

  • Advisory: GHSA-539m-9xh6-q6rr
  • Severity: Medium
  • Package/range: GitPython (pip), <= 3.1.55
  • Patched versions: not yet assigned
  • CVE: not yet assigned

Both advisories remain private, so exploit details are intentionally omitted here.

Validation

  • Focused security tests for both commits pass
  • Touched-file Ruff check and format check pass
  • git diff --check passes
  • Broader affected-module runs pass the changed paths; remaining failures are unrelated legacy fixture/default-branch assumptions

Git behavior was checked against Git a23bace963d508bd96983cc637131392d3face18 and the relevant git-checkout-index, git-tag, git-archive, and git-clone documentation.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@Byron Byron changed the title Block unsafe checkout-index and tag file options Block unsafe Git file and URL options Jul 26, 2026
codex and others added 2 commits July 26, 2026 07:37
@codex @Byron
Block unsafe checkout-index and tag file options
3af0c25
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 <[email protected]>
@codex @Byron
Block unsafe archive additions and bundle URI
7a4f5dc
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 <[email protected]>
@Byron
Byron force-pushed the more-unsafe-options branch from e7867e7 to 7a4f5dc Compare July 26, 2026 05:41
@Byron
Byron marked this pull request as ready for review July 26, 2026 05:41
Copilot AI review requested due to automatic review settings July 26, 2026 05:41
Copilot started reviewing on behalf of Byron July 26, 2026 05:42
View session
Copilot AI reviewed Jul 26, 2026
View reviewed changes

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

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:

  • Add unsafe-option gating to IndexFile.checkout() (--prefix) and TagReference.create() (-F/--file), controlled by allow_unsafe_options.
  • Expand the existing unsafe-option denylists for git archive (--add-file, --add-virtual-file) and git clone (--bundle-uri).
  • Add/extend focused tests asserting unsafe options raise UnsafeOptionError.

Reviewed 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.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread git/repo/base.py Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread test/test_refs.py Resolved

Uh oh!

There was an error while loading. Please reload this page.

@Byron
address review comments
52199b3
Copilot AI review requested due to automatic review settings July 26, 2026 07:03
Copilot started reviewing on behalf of Byron July 26, 2026 07:04
View session
Copilot AI reviewed Jul 26, 2026
View reviewed changes

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 7 out of 7 changed files in this pull request and generated no new comments.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@Byron
Byron merged commit d1a631d into main Jul 26, 2026
49 checks passed

Uh oh!

There was an error while loading. Please reload this page.

@Byron
Byron deleted the more-unsafe-options branch July 26, 2026 07:25
@it-integrations it-integrations mentioned this pull request Aug 6, 2026
🟠 [High] GitPython: Unguarded Git Option Forwarding in IndexFile.checkout() and TagReference.create() Enables Arbitrary File Overwrite and Arbitrary File Read Latch/connectedhomeip#36
Open
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

Copilot code review Copilot
Copilot review effort
Applies to this pull request for everyone.Learn more about Copilot code review.
Copilot left review comments

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

3 participants

@Byron @codex
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.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.