Skip to content

trap(#952): log two gate-3 misreports findings in 60-git-reconcile.sh - #967

Merged
fdaviddpt merged 2 commits into
mainfrom
trap/952-gate3-misreports
Oct 7, 2026
Merged

fdaviddpt merged 2 commits into
mainfrom
trap/952-gate3-misreports

Conversation

@fdaviddpt

Copy link
Copy Markdown
Contributor

Two non-blocking (misreports) findings from the v0.42.1 release's gate 3 security audit (round 1, range v0.42.0..HEAD): swallowed git diff --name-only errors leaving _checkout_ok set with an empty touched-path list, and core.quotePath leaving non-ASCII restore-set paths unmatched in hooks.d/after_save/60-git-reconcile.sh. Logged as trap.d/ fragments per the ranking table rather than filed as issues; the blocking destroys-class finding from the same audit is filed separately as #966.

Part-of-#952 (release gate 3 audit). No code changed -- prose fragments only.

🤖 Generated with Claude Code

[AI-generated]

Logged from the v0.42.1 release's gate 3 security audit (round 1): swallowed
git diff --name-only errors leaving _checkout_ok set with an empty touched-path
list, and core.quotePath leaving non-ASCII restore-set paths unmatched. Both
rank misreports (non-blocking); the blocking destroys-class finding from the
same audit is filed separately as #966.

Co-Authored-By: Claude Sonnet 5 <[email protected]>
@fdaviddpt fdaviddpt added the no-changelog Change is invisible to users label Oct 7, 2026
@fdaviddpt
fdaviddpt merged commit d2b974b into main Oct 7, 2026
19 checks passed
fdaviddpt added a commit that referenced this pull request Oct 7, 2026
…#967)

Logged from the v0.42.1 release's gate 3 security audit (round 1): swallowed
git diff --name-only errors leaving _checkout_ok set with an empty touched-path
list, and core.quotePath leaving non-ASCII restore-set paths unmatched. Both
rank misreports (non-blocking); the blocking destroys-class finding from the
same audit is filed separately as #966.

Co-authored-by: Claude Sonnet 5 <[email protected]>
fdaviddpt added a commit that referenced this pull request Oct 7, 2026
…ix (#970)

* fix(#969): hard-disable 60-git-reconcile.sh pending the real TOCTOU fix

`hooks.d/after_save/60-git-reconcile.sh` has produced a destroys-class
security finding in five consecutive release audits across two
releases (#932, #939, #946, #952's regression, #966), each fix closing
one race window and opening the next, narrower one. #969's gate-3
round-2 audit found a further one: a foreign write landing in the
window from the start of `git rebase --no-autostash` through the
conflict firing -- before #966's own pre/post-`rebase --quit` snapshot
is even taken -- is still silently discarded by the scoped conflict
restore, while the hook still logs "aborted, the tree is unchanged".

Per the scheduler's ruling for v0.42.1: rather than attempt a sixth
fix, the hook is hard-disabled. It now exits 0 immediately, printing a
one-line notice naming #969, before even reading `git_reconcile.enabled`
-- the kill switch does not itself depend on the flag whose read is
downstream of the disabled code path.

New regression test TestHardDisabledPending969 (in
tests/test_git_reconcile_903.py) proves the kill switch itself: against
the exact TOCTOU scenario #969 reports as still open (a shimmed `git`
that injects a foreign, in-restore-set write at the `rebase
--no-autostash` call), confirmed red against the pre-kill-switch hook
(same assertions failing because the old hook ran normally and never
emitted the #969 notice) and green after. Every other test in that file
and in tests/test_git_reconcile_mapfile_floor_952.py that drives the
hook's actual reconcile/conflict/restore/NDC-bump behavior is now
class- or test-level skipped with a reason naming #969, kept as
documentation of intended behavior for when the real fix lands and the
kill switch is removed -- rather than left to fail, or silently passing
for the wrong reason (nothing touches the tree because the hook never
runs, not because the behavior under test is correct).

docs/configuration.md's `git_reconcile.enabled` row now discloses the
hard-disable up front. changelog.d/969.fixed.md names the user-visible
change: anyone with git_reconcile.enabled=true sees no more automatic
reconcile until #969's real fix ships.

Co-Authored-By: Claude Sonnet 5 <[email protected]>

* fix(#969): self-review follow-up: route kill-switch notice through report_error()

oss:auditor self-review on the kill switch itself (Class A, absence the
caller cannot read): the notice was a bare `echo ... >&2`, not routed
through `report_error()` like every other notice in this hook file.
`log()`/`report_error()` write by path to the daily log and
hook-errors.log specifically so a hook's own disablement is never
invisible to `/remember:doctor`'s "Recent errors" -- a hook that was
silently skipped (#252) is the exact failure mode `report_error()`
exists to close, and a raw echo reproduced it for this hook's own
hard-disable. Switched to `report_error()`, and
TestHardDisabledPending969 now asserts the notice reaches both the
daily log and hook-errors.log instead of asserting on captured stderr,
which the production dispatch path never routes anywhere persistent.

Explore's self-review also found that hooks.d/after_save/50-git-backup.sh
and scripts/user-prompt-hook.sh still describe the OLD "git_reconcile may
act automatically" behavior -- now false while the kill switch is in
place. Not fixed here: 50-git-backup.sh's wording is pinned by
tests/test_git_backup_push_rejected_253.py::TestTheRejectionNoticeRespectsReconcile
(#935), and correcting it needs that test class rewritten too -- a
second file's protected test contract, past this diff's blast radius.
Logged to trap.d/969.stale-reconcile-prose-not-updated.md for /oss:curate.

Co-Authored-By: Claude Sonnet 5 <[email protected]>

* trap(#952): log two gate-3 misreports findings in 60-git-reconcile.sh (#967)

Logged from the v0.42.1 release's gate 3 security audit (round 1): swallowed
git diff --name-only errors leaving _checkout_ok set with an empty touched-path
list, and core.quotePath leaving non-ASCII restore-set paths unmatched. Both
rank misreports (non-blocking); the blocking destroys-class finding from the
same audit is filed separately as #966.

Co-authored-by: Claude Sonnet 5 <[email protected]>

---------

Co-authored-by: Claude Sonnet 5 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

no-changelog Change is invisible to users

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant