You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Read a Backtick-Opened or Run-Time Git Command Word in the Write Guard #2976
Found while closing #2959 and #2961. Each shape below is allowed by develop's guard and by the #2959/#2961 fix, since both read a git command only from a word the tokenizer gives as git. Each was found by a classify probe on constructed commands, with the branch rules given as a test seam.
Git Words the Guard Never Sees as Git
A backtick-opened git word. In x=`git push origin develop` and echo `git push origin develop` the tokenizer gives x=`git and `git, which _is_git_exe does not read as git, so no push is read. The $(...) form is read, since ( is an operator there.
A run-time command word. In G=git; $G push origin develop the command word is $G, so no push is read, and the same holds for "$GIT" push and `which git` push.
Possible Direction
Fail closed rather than model the expansion: read a word opening a backtick substitution with git after it as a git word, and deny a command whose command word holds a $ or a backtick where its next word is push or commit, with the explicit-refspec, own-command workaround the other unreadable denies name.
A third shape in the same class, from Copilot on #2979: a git word inside a double-quoted command substitution, as in echo "$(git push origin develop)". The tokenizer keeps the quoted substitution as one word, so no git token forms and no push is read, on develop's guard and on #2979's. Reading the body of a quoted $(...) as a command, as a wrapper body is read, would close it.
Activity
ptr727 commentedon Oct 14, 2026
A third shape in the same class, from Copilot on #2979: a git word inside a double-quoted command substitution, as in
echo "$(git push origin develop)". The tokenizer keeps the quoted substitution as one word, so nogittoken forms and no push is read, on develop's guard and on #2979's. Reading the body of a quoted$(...)as a command, as a wrapper body is read, would close it.Fail Closed on Words the Shell Rewrites Before Git Reads Them in the …
Promote the pr_review.py Cleanup Subcommand and the Write-Guard Inclu…
Fail Closed on Split Directory Values and Hidden Git Command Words in…