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.
Found during the PR #903
.commandsubkey fix round (adjacent, pre-existing, left out of that surgical scope).block-noncanonical-commit.sh:261resolves file-based aliases viagit config --get alias.$sub, which returns empty for a file-basedalias.<name>.commanddefinition — yet git (verified 2.54.0.windows.1) honors the.commandsubkey 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-envinjection the #903 fix closed — narrower exposure, config-write paths have their own guard surface.Fix direction: resolve both spellings —
git config --get alias.$subORgit 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.