Repository navigation
Refuse replay record paths inside any Git work tree at run time - #252
Merged
Merged
Conversation
outside_repository compared the output path only with the checkout that compiled the binary and accepted every path when that checkout was gone. A binary built in another worktree, or moved, could write typed text into the current repository. The check now walks the output directory's ancestors for a .git entry and keeps the compile-time root as a second rule. Fixes #237 Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
nervouna
enabled auto-merge
November 23, 2026 02:00
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
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
Fixes #237
replay engine --recordchecked the output path only againstCARGO_MANIFEST_DIR/../..and accepted any path whenthat directory no longer existed. A binary built in another worktree, or moved after the build, could therefore write
a record holding typed text into the repository it was run from.
outside_repositorynow canonicalizes the output directory and refuses it when any ancestor holds a.gitentry(directory or worktree file). The compile-time root stays as a second rule for source trees without
.git. Thecaveat in
Core/Portable/README.mdthat pointed at this issue is replaced by the rule.Acceptance
bash macOS/scripts/test.sh portable:PASS 1 units: portable(192 s).engine_arguments_and_record_files_are_checkedbuilds a scratch directory outside thisrepository, marks it (and then only its nested directory) with a
.gitfile, and asserts that--recordinto itis refused with "outside the repository" and that nothing is written. The compile-time root cannot match that
path, so the test exercises the run-time rule alone.
owner-only mode and the refusal to write over an existing file are unchanged and still asserted.
Deviations and open issues
The rule is "inside any Git work tree", which is wider than "inside the current InkFlow work tree": a record cannot
be written into an unrelated repository either. Typed text has no place in any repository, and the rule needs no
knowledge of the working directory or the executable's location.
cargo fmtis not installed for the local toolchain, so formatting was done by hand.Delivery record
🤖 Generated with Claude Code