GeezerVison is showing github.com — Require explicit opt-in for filesystem diffs by Byron · Pull Request #2217 · gitpython-developers/GitPython
Conversation
Byron
commented
Aug 17, 2026
•
edited
Loading
Uh oh!
There was an error while loading. Please reload this page.
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.
Advisory
GHSA-whh4-5q6c-9v3x
GHSA-whh4-5q6c-9v3x reports a repository-boundary bypass in the high-level diff API. This change requires callers to explicitly opt in before diff paths may use filesystem-wide semantics. Reproduction mechanics are intentionally omitted while the advisory is unpublished.
Advisory summary
- Severity: medium
- Package: GitPython (pip)
- Affected range:
= 3.1.59
- Patched versions: none published
- CVE: none assigned
Changes
- Classify
--no-index as an unsafe diff option.
- Cover keyword and raw-option spellings through commit and index APIs.
- Clarify the existing explicit opt-in documentation.
Validation
- Focused diff security tests: 2 passed.
- Complete
test/test_diff.py: 25 passed, 1 unrelated local-environment failure in staged conflict reporting.
- Ruff check and format checks passed.
git diff --check passed.
- Git baseline: Git 2.50.1 documents filesystem operand behavior in
Documentation/git-diff.adoc and implements it in builtin/diff.c.
- Post-commit Codex review was attempted once for
14200584 but the CLI usage allowance was exhausted before review began.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
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 hardens GitPython’s high-level diff APIs against repository-boundary bypass by requiring explicit caller opt-in before enabling filesystem-wide diff semantics (--no-index).
Changes:
- Mark
--no-index as an unsafe diff option (requires allow_unsafe_options=True).
- Add regression tests ensuring both keyword (
no_index=True) and raw-option ("--no-index") spellings are rejected by default.
- Update
Diffable.diff documentation to include --no-index in the unsafe-options description.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File |
Description |
test/test_diff.py |
Adds tests that --no-index/no_index are blocked unless explicitly allowed. |
git/repo/base.py |
Adds --no-index to the repo’s unsafe diff option allowlist/denylist used by high-level diff APIs. |
git/diff.py |
Updates the allow_unsafe_options docstring to document --no-index as unsafe. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
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 3 out of 3 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.
<!-- agent -->
Treat --no-index as an unsafe diff option because it changes path operands
from repository pathspecs to arbitrary filesystem paths. This addresses
GHSA-whh4-5q6c-9v3x without exposing advisory reproduction details.
Assisted-by: GPT 5.6
Co-authored-by: GPT 5.6 <[email protected]>
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 4 out of 4 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.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Assignees
No one assigned
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.
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.