René's URL Explorer Experiment


Title: fix: validate checkout and submodule clone arguments by Byron · Pull Request #2347 · gitpython-developers/GitPython · GitHub

Open Graph Title: fix: validate checkout and submodule clone arguments by Byron · Pull Request #2347 · gitpython-developers/GitPython

X Title: fix: validate checkout and submodule clone arguments by Byron · Pull Request #2347 · gitpython-developers/GitPython

Description: 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 (model version unavailable). Created by Codex on behalf of Byron. Byron will review before this is ready to merge. This work came from triaging a private input-validation advisory affecting GitPython applications that pass dynamically typed values into checkout flags. Auditing the other higher-level Git calls found another flag forwarded without checking its type. Head.checkout(force=...) and Submodule.add(no_checkout=...) now require booleans before any Git call. Non-boolean values raise TypeError, including positional calls and calls with unsafe options enabled. Repo.create_submodule() receives the same protection through its existing delegation. Valid True and False behavior is preserved. Submodule clone depth also requires a positive, non-boolean integer on both add paths. This prevents depth=True from becoming a bare Git option and replaces duplicated, inconsistent checks with one input check before repository operations. Advisory summary GHSA-j3hg-fv33-37rw: medium severity; package GitPython in the pip ecosystem; reported affected range <= 3.2.1. No patched version or CVE is assigned yet. The advisory is private, so this description and regression cases omit its private reproduction and impact details. Validation The new regression tests failed before the fixes and now reject invalid values before Git process execution. They cover strings, bytes, sequences, integers, and None, positional and keyword calls, unsafe opt-in, both submodule entry points, and invalid depths on both clone paths. Reference and positional-argument suites: 220 tests and 24 subtests passed on each backend. Submodule add, re-add, first-submodule, and depth checks: 126 passing tests and one existing expected failure per backend. One integration test initially hit the local GPG signing configuration; it passed on both backends with command-local signing disabled. Ruff lint and formatting, mypy, basedpyright, and git diff --check passed. Git baseline: checkout force and clone no-checkout are no-argument switches; clone depth requires a positive numeric value. Git source was inspected at 6de20f6092dcf9bdb1c8efe03db4b70c82b423dd. Tests used Git 2.54.0 (Apple Git-157) and GixPython 0.3.0. Codex review found no actionable issues in either fix. The review environment lacked pytest; the tests above were run separately in the prepared temporary environment.

Open Graph Description: 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 C...

X Description: 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 C...

Opengraph URL: https://github.com/gitpython-developers/GitPython/pull/2347

X: @github

direct link

Domain: github.com

react-profiling0
react-import-mapreact,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322
route-pattern/:user_id/:repository/pull/:id/files(.:format)
route-controllerpull_requests
route-actionfiles
fetch-noncev2:f119982f-b9fa-1ab7-a3c5-417f259e1a16
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-id9306:363B2E:5E42B3:7EA1BC:6B00AB0B
html-safe-nonce94719ac529b177f88beb118773509ff7793048505f49e0df815d73b381bdd0cd
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5MzA2OjM2M0IyRTo1RTQyQjM6N0VBMUJDOjZCMDBBQjBCIiwidmlzaXRvcl9pZCI6Ijc4Mzg1NDgwMTgzMjMzMDMxNzkiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmac9d4de92cb8c1ba3772cd6b7e38ac8ff7fe6d022dab3e07e68ad3f25e9f71d664
hovercard-subject-tagpull_request:5322415950
github-keyboard-shortcutsrepository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///pull_requests/show/files
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/gitpython-developers/GitPython/pull/2347/files
twitter:imagehttps://avatars.githubusercontent.com/u/63622?s=400&v=4
twitter:cardsummary_large_image
og:imagehttps://avatars.githubusercontent.com/u/63622?s=400&v=4
og:image:altTasks 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 C...
og:site_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
None455b493e3402a3a3a06beac5d20bb7db3da060808b220aa48d6a7eca7c59863a
turbo-cache-controlno-preview
diff-viewunified
go-importgithub.com/gitpython-developers/GitPython git https://github.com/gitpython-developers/GitPython.git
octolytics-dimension-user_id503709
octolytics-dimension-user_logingitpython-developers
octolytics-dimension-repository_id1126087
octolytics-dimension-repository_nwogitpython-developers/GitPython
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id1126087
octolytics-dimension-repository_network_root_nwogitpython-developers/GitPython
turbo-body-classeslogged-out env-production page-responsive full-width
disable-turbotrue
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release2f575159976167242d488c0b062eb355c4e198b7
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/gitpython-developers/GitPython/pull/2347/files#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fgitpython-developers%2FGitPython%2Fpull%2F2347%2Ffiles
GitHubRepository hosting, code review, and collaborationhttps://github.com/platform
CopilotAI coding agent for tasks, projects, and automated workhttps://github.com/features/copilot
ActionsCI/CD and automationhttps://github.com/features/actions
Code QualityQuality analysis, fixes, and enforcementhttps://github.com/features/code-quality
CodespacesCloud development environmentshttps://github.com/features/codespaces
Code SecurityVulnerability detection and remediationhttps://github.com/security/advanced-security/code-security
Secret ProtectionSecret scanning and leak preventionhttps://github.com/security/advanced-security/secret-protection
All Featureshttps://github.com/features
Documentationhttps://docs.github.com/en
Traininghttps://learn.github.com/skills
Certificationshttps://learn.github.com/credentials
Build with Copilothttps://github.com/features/ai
Customize Copilothttps://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview
Integrationshttps://github.com/marketplace
Trending reposhttps://github.com/trending
GitHub Sponsorshttps://github.com/open-source/sponsors
Developer articleshttps://github.com/resources/articles
ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.https://github.blog/changelog/
Enterpriseshttps://github.com/enterprise
Teamhttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
See all industrieshttps://github.com/solutions/industry
Why GitHubhttps://github.com/why-github
Customer Storieshttps://github.com/customer-stories
Business insightshttps://github.com/solutions/executive-insights
Trust Centerhttps://github.com/trust-center
GitHub Advanced SecurityEnterprise-grade code securityhttps://github.com/security/advanced-security
Copilot for businessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Documentationhttps://docs.github.com/en
Resource centerhttps://github.com/resources
Bloghttps://github.blog/
Events & webinarshttps://github.com/resources/events
Community Forumhttps://github.com/orgs/community/discussions
Customer Storieshttps://github.com/customer-stories
Integrationshttps://github.com/marketplace
Customer supporthttps://help.github.com/
Traininghttps://learn.github.com/skills
GitHub Statushttps://www.githubstatus.com/
Abouthttps://github.com/about
Partnershttps://github.com/partners
Changeloghttps://github.blog/changelog/
GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.https://githubuniverse.com/
Pricinghttps://github.com/pricing
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fgitpython-developers%2FGitPython%2Fpull%2F2347%2Ffiles
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fpull_requests%2Fshow%2Ffiles&source=header-repo&source_repo=gitpython-developers%2FGitPython
Reloadhttps://github.com/gitpython-developers/GitPython/pull/2347/files
Reloadhttps://github.com/gitpython-developers/GitPython/pull/2347/files
Reloadhttps://github.com/gitpython-developers/GitPython/pull/2347/files
gitpython-developershttps://github.com/gitpython-developers
GitPythonhttps://github.com/gitpython-developers/GitPython
Codehttps://github.com/gitpython-developers/GitPython
Issues1 (1)https://github.com/gitpython-developers/GitPython/issues
Pull requestshttps://github.com/gitpython-developers/GitPython/pulls
Discussionshttps://github.com/gitpython-developers/GitPython/discussions
Actionshttps://github.com/gitpython-developers/GitPython/actions
Security and quality42 (42)https://github.com/gitpython-developers/GitPython/security
Insightshttps://github.com/gitpython-developers/GitPython/insights
Sign up for GitHub https://github.com/signup?return_to=%2Fgitpython-developers%2FGitPython%2Fissues%2Fnew%2Fchoose
terms of servicehttps://docs.github.com/terms
privacy statementhttps://docs.github.com/privacy
Sign inhttps://github.com/login?return_to=%2Fgitpython-developers%2FGitPython%2Fissues%2Fnew%2Fchoose
Byronhttps://github.com/Byron
mainhttps://github.com/gitpython-developers/GitPython/tree/main
head-checkouthttps://github.com/gitpython-developers/GitPython/tree/head-checkout
Conversation 1 https://github.com/gitpython-developers/GitPython/pull/2347
Commits 2 https://github.com/gitpython-developers/GitPython/pull/2347/commits
Checks 67 https://github.com/gitpython-developers/GitPython/pull/2347/checks
Files changed https://github.com/gitpython-developers/GitPython/pull/2347/files
Please reload this pagehttps://github.com/gitpython-developers/GitPython/pull/2347/files
fix: validate checkout and submodule clone arguments https://github.com/gitpython-developers/GitPython/pull/2347/files#top
Show all changes 2 commits https://github.com/gitpython-developers/GitPython/pull/2347/files
334d318 fix(refs): require a boolean checkout force flag codex Nov 15, 2026 https://github.com/gitpython-developers/GitPython/pull/2347/commits/334d3189cee1f3354068509078e5b34281080dd4
a1a9a01 fix(submodule): validate clone flag and depth arguments Byron Nov 15, 2026 https://github.com/gitpython-developers/GitPython/pull/2347/commits/a1a9a015180832b68cb0c6da06da566a1125ddaa
Clear filters https://github.com/gitpython-developers/GitPython/pull/2347/files
Please reload this pagehttps://github.com/gitpython-developers/GitPython/pull/2347/files
Please reload this pagehttps://github.com/gitpython-developers/GitPython/pull/2347/files
changes.rst https://github.com/gitpython-developers/GitPython/pull/2347/files#diff-18450dccedaf66680c6bfbfa443564198c3d480f939edb0e87f7d8078d0c2673
base.py https://github.com/gitpython-developers/GitPython/pull/2347/files#diff-44dc32942e129beb7f738ff7d487bfbddb0a7802a91d43c9b8b8952a4d0806bc
head.py https://github.com/gitpython-developers/GitPython/pull/2347/files#diff-79302e4aa7752927c17b41ff1d8f51292daf92f3798b95d3c37264bf09b7955e
test_refs.py https://github.com/gitpython-developers/GitPython/pull/2347/files#diff-0d8f1dff061a372fdf4946776e8277a271774b10c1684d1c28c1abd030340d0c
test_submodule.py https://github.com/gitpython-developers/GitPython/pull/2347/files#diff-78179a32c1d54a6b78b018ee57328d6ea9424fbfbdbb36caf15e290331621024
doc/source/changes.rsthttps://github.com/gitpython-developers/GitPython/pull/2347/files#diff-18450dccedaf66680c6bfbfa443564198c3d480f939edb0e87f7d8078d0c2673
View file https://github.com/gitpython-developers/GitPython/blob/a1a9a015180832b68cb0c6da06da566a1125ddaa/doc/source/changes.rst
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/gitpython-developers/GitPython/pull/2347/{{ revealButtonHref }}
https://github.com/gitpython-developers/GitPython/pull/2347/files#diff-18450dccedaf66680c6bfbfa443564198c3d480f939edb0e87f7d8078d0c2673
https://github.com/gitpython-developers/GitPython/pull/2347/files#diff-18450dccedaf66680c6bfbfa443564198c3d480f939edb0e87f7d8078d0c2673
git/objects/submodule/base.pyhttps://github.com/gitpython-developers/GitPython/pull/2347/files#diff-44dc32942e129beb7f738ff7d487bfbddb0a7802a91d43c9b8b8952a4d0806bc
View file https://github.com/gitpython-developers/GitPython/blob/a1a9a015180832b68cb0c6da06da566a1125ddaa/git/objects/submodule/base.py
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/gitpython-developers/GitPython/pull/2347/{{ revealButtonHref }}
https://github.com/gitpython-developers/GitPython/pull/2347/files#diff-44dc32942e129beb7f738ff7d487bfbddb0a7802a91d43c9b8b8952a4d0806bc
https://github.com/gitpython-developers/GitPython/pull/2347/files#diff-44dc32942e129beb7f738ff7d487bfbddb0a7802a91d43c9b8b8952a4d0806bc
https://github.com/gitpython-developers/GitPython/pull/2347/files#diff-44dc32942e129beb7f738ff7d487bfbddb0a7802a91d43c9b8b8952a4d0806bc
https://github.com/gitpython-developers/GitPython/pull/2347/files#diff-44dc32942e129beb7f738ff7d487bfbddb0a7802a91d43c9b8b8952a4d0806bc
https://github.com/gitpython-developers/GitPython/pull/2347/files#diff-44dc32942e129beb7f738ff7d487bfbddb0a7802a91d43c9b8b8952a4d0806bc
https://github.com/gitpython-developers/GitPython/pull/2347/files#diff-44dc32942e129beb7f738ff7d487bfbddb0a7802a91d43c9b8b8952a4d0806bc
https://github.com/gitpython-developers/GitPython/pull/2347/files#diff-44dc32942e129beb7f738ff7d487bfbddb0a7802a91d43c9b8b8952a4d0806bc
https://github.com/gitpython-developers/GitPython/pull/2347/files#diff-44dc32942e129beb7f738ff7d487bfbddb0a7802a91d43c9b8b8952a4d0806bc
git/refs/head.pyhttps://github.com/gitpython-developers/GitPython/pull/2347/files#diff-79302e4aa7752927c17b41ff1d8f51292daf92f3798b95d3c37264bf09b7955e
View file https://github.com/gitpython-developers/GitPython/blob/a1a9a015180832b68cb0c6da06da566a1125ddaa/git/refs/head.py
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/gitpython-developers/GitPython/pull/2347/{{ revealButtonHref }}
https://github.com/gitpython-developers/GitPython/pull/2347/files#diff-79302e4aa7752927c17b41ff1d8f51292daf92f3798b95d3c37264bf09b7955e
https://github.com/gitpython-developers/GitPython/pull/2347/files#diff-79302e4aa7752927c17b41ff1d8f51292daf92f3798b95d3c37264bf09b7955e
test/test_refs.pyhttps://github.com/gitpython-developers/GitPython/pull/2347/files#diff-0d8f1dff061a372fdf4946776e8277a271774b10c1684d1c28c1abd030340d0c
View file https://github.com/gitpython-developers/GitPython/blob/a1a9a015180832b68cb0c6da06da566a1125ddaa/test/test_refs.py
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/gitpython-developers/GitPython/pull/2347/{{ revealButtonHref }}
https://github.com/gitpython-developers/GitPython/pull/2347/files#diff-0d8f1dff061a372fdf4946776e8277a271774b10c1684d1c28c1abd030340d0c
https://github.com/gitpython-developers/GitPython/pull/2347/files#diff-0d8f1dff061a372fdf4946776e8277a271774b10c1684d1c28c1abd030340d0c
test/test_submodule.pyhttps://github.com/gitpython-developers/GitPython/pull/2347/files#diff-78179a32c1d54a6b78b018ee57328d6ea9424fbfbdbb36caf15e290331621024
View file https://github.com/gitpython-developers/GitPython/blob/a1a9a015180832b68cb0c6da06da566a1125ddaa/test/test_submodule.py
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/gitpython-developers/GitPython/pull/2347/{{ revealButtonHref }}
https://github.com/gitpython-developers/GitPython/pull/2347/files#diff-78179a32c1d54a6b78b018ee57328d6ea9424fbfbdbb36caf15e290331621024
https://github.com/gitpython-developers/GitPython/pull/2347/files#diff-78179a32c1d54a6b78b018ee57328d6ea9424fbfbdbb36caf15e290331621024
Please reload this pagehttps://github.com/gitpython-developers/GitPython/pull/2347/files
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.