Repository navigation
Git repository check: refuse what git may take that the check would skip - #1921
Merged
Merged
Conversation
The pre-git repository check now refuses, rather than walks past, a candidate git directory git's own discovery would accept and the check would not (an `objects` or `refs` that is a file, a linked `HEAD`), refuses a linked loose ref, refuses the excludes and attributes pathname forms it does not resolve (`:(optional)`, `%(prefix)/`), resolves `core.worktree` as git does, without `~` expansion, and drops an inherited GIT_OBJECT_DIRECTORY from the untrusted git environment. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Deploying mouseterm with
|
| Latest commit: |
4f81b6a
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://daa5add2.mouseterm.pages.dev |
| Branch Preview URL: | https://audit-git-discovery.mouseterm.pages.dev |
dormouse-bot
approved these changes
Nov 30, 2026
This was referenced Nov 30, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Nightly audit follow-up for
docs/specs/security-local.md-> "Spawned programs" (S277), and theS164andS153rules that point at it. Before running git in a folder the user hasn't vouched for,localGitRepositorymust walk everything git will open. In a few places it disagreed with git about which repository git takes or which path a config value names. Each was reproduced with git 2.56.1, and each now refuses (fails closed)::(optional)from an excludes or attributes file and expands~user/and%(prefix)/, so the check was judging a different path from the one git opens. A value with any of these prefixes is now refused.core.worktreetakes no expansion in git, so~there is no longer expanded to the home directory.objectsandrefsbe searchable (access(X_OK)), which an executable file passes. The check skipped such a candidate and accepted an ancestor, and git then took the nested one. A candidate withHEAD,objects, andrefspresent but not all directories now refuses the lookup.HEADor loose ref as a symbolic ref by its text, without following it. Such a ref is now refused.untrustedGitEnvalso drops an inheritedGIT_OBJECT_DIRECTORY, which lets git take a candidate with noobjects.S277gains one clause: the check must not pass over a candidate git might take below the repository it accepts. The rationale entry carries the git evidence.Tests: seven fake-filesystem cases, a real-git test of nested
.gitand nested bare candidates, the existing real-git share test extended with an:(optional)value, and an env test. Each fix group, when reverted, turns a new test red.dor-lib-commontests pass (52, 2 skipped), as do the lib git-info/git-cli/git-upstream tests, thedor-tools-builtinfolder-viewer tests, and thedoropen-picker tests.lint:specsandlint:mdpass. Not run on Windows.🤖 Generated with Claude Code