fix(reviewer): close forbidden-git detection gaps via allowlist (closes #243) #247

Merged
sysadmin merged 1 commits from feat/issue-243-forbidden-git-gaps into master 2026-07-06 11:18:32 -05:00
Owner

Closes blocklist bypass gaps in reviewer git-command detection (#243). Fail-closed allowlist: any git command not in _READONLY_REVIEWER_GIT is forbidden. Closes #243

Closes blocklist bypass gaps in reviewer git-command detection (#243). Fail-closed allowlist: any git command not in _READONLY_REVIEWER_GIT is forbidden. Closes #243
jcwalker3 added 1 commit 2026-07-06 10:42:29 -05:00
Replace blocklist-based git mutation detection with fail-closed allowlist
semantics: any git command not matching the readonly set is forbidden.
Catches checkout HEAD --, checkout ., git switch variants, and uncommon
stash subcommands that bypassed the old regex.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
sysadmin reviewed 2026-07-06 11:18:22 -05:00
sysadmin left a comment
Owner

Review summary

Reviewed PR #247 at head ec8f6abf5ba38b741318d50748308ce1a996f24b.

Scope: Matches #243 — replaces blocklist git-command detection with fail-closed readonly allowlist in reviewer_worktree.py. Closes bypass gaps (checkout HEAD --, checkout ., switch, uncommon stash subcommands).

Findings:

  • Allowlist model is cleaner and correctly forbids non-readonly git invocations.
  • Tests cover new bypass vectors via subTests.
  • Scope clean: 2 files, no unrelated changes.

Validation (detached HEAD @ pinned SHA):

  • pytest tests/test_reviewer_worktree.py -v → 17 passed
  • pytest tests/ -q → full suite passed (exit 0)
  • git diff --check → clean

Verdict: Approve. Ready to merge into master.

## Review summary Reviewed PR #247 at head `ec8f6abf5ba38b741318d50748308ce1a996f24b`. **Scope:** Matches #243 — replaces blocklist git-command detection with fail-closed readonly allowlist in `reviewer_worktree.py`. Closes bypass gaps (`checkout HEAD --`, `checkout .`, `switch`, uncommon `stash` subcommands). **Findings:** - Allowlist model is cleaner and correctly forbids non-readonly git invocations. - Tests cover new bypass vectors via subTests. - Scope clean: 2 files, no unrelated changes. **Validation (detached HEAD @ pinned SHA):** - `pytest tests/test_reviewer_worktree.py -v` → 17 passed - `pytest tests/ -q` → full suite passed (exit 0) - `git diff --check` → clean **Verdict:** Approve. Ready to merge into `master`.
sysadmin merged commit ff435ea13c into master 2026-07-06 11:18:32 -05:00
Sign in to join this conversation.
No Reviewers
No labels
2 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Scaled-Tech-Consulting/Gitea-Tools#247