Repository navigation
fix(o79): harden mutating git against repo filters and merge drivers - #79
Merged
Merged
Conversation
runGit only injected executableConfigOverrides when readOnly was true, so worktree-isolation's mutating calls (worktree add, add -A -N, apply --3way) still ran untrusted filter.*.smudge/clean and merge.*.driver from .git/config. Always discover and inject those overrides for every runGit child. Keep GIT_PAGER, READONLY_CONFIG, and withoutExternalDiff read-only-only. Also blank local/worktree merge.*.driver keys so apply --3way fails closed. Regression: createWorktree smudge, mutating add clean, apply --3way merge driver. Did not touch git-config-env.ts (O76 already merged; O80 later).
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
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.
Summary
O79 —
runGitonly appliedexecutableConfigOverrideswhenreadOnlywas true. AllreadOnly: falsecall sites live inworktree-isolation.ts(worktree add,add -A -N,apply --3way, prune, …), so creating a subagent worktree (and related mutating git) still ran untrusted repo.git/configfilter.*.smudge/filter.*.clean/merge.*.driver.Fix
executableConfigOverridesinrunGit(not only for read-only).GIT_PAGER=cat,READONLY_CONFIG, andwithoutExternalDiff.merge.*.driversogit apply --3wayfails closed instead of running the repo driver.src/utils/git-config-env.ts(O76 already merged; O80 rewrites that file later).worktree-isolation.ts— the hardening is entirely ingit-spawn.ts.Files
src/utils/git-spawn.tstest/git-spawn.spec.mjs(merge.driver in override unit test)test/worktree-isolation-o79.spec.mjs(new)Acceptance
qa-repro-o79-worktree-filter.spec.mjspasses (worktree created, smudge marker absent)add -A -N/ mutating add path: untrustedfilter.*.cleandoes not run (collectWorktreePatch+runGit(['add','-A'], {readOnly:false}))apply --3waypath: untrusted merge driver does not run duringapplyWorktreePatchreadOnly-only gate is restored, passes after this fixed638367(main tip with fix(o76): always inject core.hooksPath=NUL for untrusted workspaces on win32 #78 O76 + fix(o72): approval-mode copy, no-sandbox notice, once-per-folder untrusted notice #77 O72)Test plan