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 — Validate submodule names before filesystem operations by Byron · Pull Request #2202 · gitpython-developers/GitPython

Conversation

@Byron

@Byron Byron commented Aug 1, 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.

Advisory

GHSA-hmq2-w58f-27jc

Advisory summary

  • GHSA: GHSA-hmq2-w58f-27jc
  • Severity: High
  • Package: GitPython (pip)
  • Affected versions: <= 3.1.57
  • Patched versions: not yet assigned
  • CVE: not yet assigned

This change validates submodule names before filesystem operations. Details are intentionally concise while the advisory remains a draft.

Changes

  • Reject empty, rooted, drive-qualified, and parent-component submodule names.
  • Validate before constructing module paths and before opening or mutating existing checkouts, covering repositories initialized by older vulnerable versions.
  • Validate programmatic add and rename inputs before making changes.
  • Add local regression coverage for both new initialization and an existing separate Git directory outside the clone.

Git baseline

Matches the name-validation behavior introduced by Git commit 0383bbb901 (submodule-config: verify submodule names as paths), with additional handling for Python path-join semantics.

Validation

  • pytest -q test/test_submodule.py on Python 3.14.6: 39 passed, 1 skipped, 1 xfailed
  • Ruff check and format check: passed
  • mypy for git/objects/submodule/base.py: passed

No Docker reproduction was used.

Sorry, something went wrong.

Uh oh!

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

All reactions
@Byron
Byron force-pushed the submodule-name-check branch from e1d07cc to b88d913 Compare August 1, 2026 03:10
@Byron Byron changed the title Validate submodule names before creating module paths Validate submodule names before filesystem operations Aug 1, 2026
@Byron

Byron commented Aug 4, 2026

Copy link
Copy Markdown
Member Author

@codex review

All reactions

Sorry, something went wrong.

Uh oh!

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

chatgpt-codex-connector[bot]
chatgpt-codex-connector Bot reviewed Aug 4, 2026
View reviewed changes

@chatgpt-codex-connector chatgpt-codex-connector Bot 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: b88d913950

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Sorry, something went wrong.

Uh oh!

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

All reactions
Comment thread git/objects/submodule/base.py Resolved

Uh oh!

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

@Byron @codex
Validate submodule names before filesystem operations
e4b8e7d
<!-- agent -->
Submodule names read from .gitmodules can influence the separate Git directory
path. Reject empty names, absolute or drive-qualified names, and parent
components with either path separator.

Validate before constructing module paths and before opening or mutating
existing checkouts, so a repository initialized by an older vulnerable version
cannot bypass the guard. Validate programmatic add and rename inputs before
making changes as well.

Advisory: GHSA-hmq2-w58f-27jc

Assisted-by: GPT 5.6
Co-authored-by: GPT 5.6 <[email protected]>
@Byron
Byron force-pushed the submodule-name-check branch from b88d913 to e4b8e7d Compare August 4, 2026 07:44
@Byron
Byron marked this pull request as ready for review August 4, 2026 07:44
Copilot AI lite review requested due to automatic review settings August 4, 2026 07:44
chatgpt-codex-connector[bot]
chatgpt-codex-connector Bot reviewed Aug 4, 2026
View reviewed changes

@chatgpt-codex-connector chatgpt-codex-connector Bot 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: e4b8e7d026

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Sorry, something went wrong.

Uh oh!

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

All reactions
Comment thread git/objects/submodule/base.py Resolved

Uh oh!

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

Copilot started reviewing on behalf of Byron August 4, 2026 07:48
View session
Copilot AI reviewed Aug 4, 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 pull request hardens GitPython’s submodule handling by validating submodule names (as path-like identifiers) before performing filesystem operations, addressing a high-severity security advisory around path traversal via crafted submodule names.

Changes:

  • Introduce centralized submodule name validation and apply it before key operations (module path construction, update/fetch, add/move/remove/rename, and module opening).
  • Add regression tests covering invalid submodule names (parent components, rooted paths, drive-qualified paths) including scenarios involving separate git directories and keep_going=True updates.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
git/objects/submodule/base.py Adds _validated_name() and calls it from submodule operations to reject unsafe names before filesystem interactions.
test/test_submodule.py Adds regression tests ensuring invalid submodule names are rejected and keep_going continues updating valid submodules.

💡 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/objects/submodule/base.py Resolved

Uh oh!

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

@Byron
Byron merged commit 2212c63 into main Aug 4, 2026
49 checks passed

Uh oh!

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

@Byron
Byron deleted the submodule-name-check branch August 4, 2026 08:07
@bindsi bindsi mentioned this pull request Aug 6, 2026
security(deps): bump gitpython from 3.1.57 to 3.1.58 in /training/rl microsoft/physical-ai-toolchain#1343
Closed
@it-integrations it-integrations mentioned this pull request Sep 9, 2026
🟠 [High] GitPython: Arbitrary Git Repository Creation Outside the Working Tree via Unvalidated .Gitmodules Submodule Name in GitPython Latch/connectedhomeip#50
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
@chatgpt-codex-connector chatgpt-codex-connector[bot] chatgpt-codex-connector[bot] 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.

2 participants

@Byron
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.