Skip to content

guardrails: block-noncanonical-commit file-based alias resolution misses alias.<name>.command subkey (git config --get returns empty) #1022

Closed

Description

@kyle-sexton

Found during the PR #903 .command subkey fix round (adjacent, pre-existing, left out of that surgical scope).

block-noncanonical-commit.sh:261 resolves file-based aliases via git config --get alias.$sub, which returns empty for a file-based alias.<name>.command definition — yet git (verified 2.54.0.windows.1) honors the .command subkey as an alias. A commit-bypassing alias written to config via the subkey spelling is therefore not resolved and not checked.

Class: under-detection (fail-open) in a security guard, BUT the threat model requires a prior git-config WRITE (config-file mutation), unlike the command-line -c/--config-env injection the #903 fix closed — narrower exposure, config-write paths have their own guard surface.

Fix direction: resolve both spellings — git config --get alias.$sub OR git config --get alias.$sub.command (last-wins semantics across the two spellings match git's behavior, verified empirically in the #903 fix round; see the cross-form last-wins tests added to lib/hook-utils.test.sh).

Origin: fixer round on PR #903, 2026-07-22.

Activity

  1. added
    needs-triageNot yet classified. Floor until a type and one priority tier are set.
    on Jul 22, 2026
  2. added
    status: readyTriaged, unblocked, and fully specified; eligible to pick up.
    and removed
    needs-triageNot yet classified. Floor until a type and one priority tier are set.
    on Jul 22, 2026
  3. added theissue type on Jul 22, 2026
  4. added
    needs-humanHuman-in-the-loop required; autonomous sessions must not resolve items carrying this.
    on Jul 23, 2026
  5. kyle-sexton commented on Jul 27, 2026

    @kyle-sexton
    MemberAuthor

    This was generated by AI (triage lane — gate-audit claim). Claiming this item for one gate-audit cycle: an independent panel re-classifies whether the needs-human / status: needs-decision gate is still warranted, or whether the item is C2/C3 and liftable to agent-ready. Outcome comment follows in this cycle.

  6. kyle-sexton commented on Jul 27, 2026

    @kyle-sexton
    MemberAuthor

    This was generated by AI (triage lane — gate audit). Independent panel: two fresh-context agents (one fable, one opus), each given only the issue content and the repo's own plugins/autonomy/reference/guardrails/work-classes.md, plus the triage lane's own read. This lane never executes work items, authors fixes, or merges.

    Gate audit: GATE UPHELD — C3 shape, security-surface floor

    Panel: 2-of-2 STAYS-GATED. Lane read concurs.

    The fix is tightly specified — resolve both alias.$sub and alias.$sub.command with git's last-wins semantics, with an existing test pattern in lib/hook-utils.test.sh to mirror. But it modifies bypass-detection logic inside a commit guard, where an implementation slip silently widens a fail-open. That is the security floor, and excellent briefing does not clear it.

    Stale pointer — important for whoever implements this: one leg verified the issue's cited location has moved. block-noncanonical-commit.sh:261 is now block-convention-violation.sh:310, still resolving only git config --get "alias.$sub". The sibling guard block-dangerous-git.sh already re-checks both spellings, so the correct behaviour is demonstrated in-repo.

    Decision required

    Ratify the near-mechanical guard change as scoped, or take the larger shared-helper refactor?

    RECOMMENDED — approve as scoped, route through human merge. Add alias.$sub.command resolution with last-wins semantics at block-convention-violation.sh:310, mirroring the sibling guard that already does it right, with cross-form contract tests following the #903 round. Smallest diff that closes a live fail-open, and the correct implementation already exists next door to copy.

    Alternative — extract the dual-spelling resolution into lib/hook-utils.sh so both guards share one implementation, eliminating the drift that caused this. Better end state, but it is a shared-lib change that fans out to the synced per-plugin copies — larger blast radius, and worth doing as a deliberate follow-up rather than folded into a fail-open fix.

  7. kyle-sexton commented on Jul 27, 2026

    @kyle-sexton
    MemberAuthor

    This was generated by AI (triage lane — claim release). Gate-audit cycle complete for this item; the triage claim posted earlier this cycle is released. No lease is held — another instance or lane may pick this up immediately. The outcome comment above this one carries the classification and either the lift rationale or the decision summary.

  8. added a commit that references this issue on Aug 12, 2026
    2d4aa17
  9. added a commit that references this issue on Aug 12, 2026
    7126430
  10. added a commit that references this issue on Aug 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    needs-humanHuman-in-the-loop required; autonomous sessions must not resolve items carrying this.status: readyTriaged, unblocked, and fully specified; eligible to pick up.

    Type

    Fields

    No fields configured for Bug.

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions