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
The Wait-Loop Bound Check Counts a Comparison Bash Never Evaluates #2058
gh-write-guard.py requirement 7 allows some unbounded wait loops. In each of them, the comparison that counts as the loop's bound is text bash never evaluates as a test argument. _bound_in_condition reads the shell tokens from POSIX shlex, together with the quote mask, and it accepts that comparison as the bound. Every shape below is allowed on develop at dd4ca98e, and each is a loop that bash runs forever.
One more shape of the same cause, found by the local strict review of the #2080 fix (handoff #2137): a bash -c or eval payload read a second time. Inside double quotes the outer lex keeps a backslash before a backtick, where bash removes it, so the payload carries \`, the quote-keeping mask marks that token quoted, and the backtick substitution's -lt counts as the bound.
bash -c "until [ -f x \`[ 1 -lt 2 ]\` ]; do sleep 1; done"eval"until [ -f x \`[ 1 -lt 2 ]\` ]; do sleep 1; done"
Both are allowed and both loop under timeout 3 bash until the timeout ends them. The loop written out with bare backticks is denied. The bash -c form is allowed on develop too, so it predates that fix, and the eval form reaches it once #2080's fix reads eval payloads. Backslash-dollar inside double quotes likely reads the same way.
Declined per #2517, approved by the maintainer, under GOVERNANCE.md "Trust Boundaries and Hardening Effort": The guard backstops an agent's own mistakes, and this is a command shape built to defeat it rather than one an agent session writes, so a miss does not realistically occur. See #2517 for the per-issue reason.
Activity
Keep the Guard's Quote Mask When an Escape Sits Outside the Loop Cond…
ptr727 commentedon Sep 30, 2026
One more shape of the same cause, found by the local strict review of the #2080 fix (handoff #2137): a
bash -corevalpayload read a second time. Inside double quotes the outer lex keeps a backslash before a backtick, where bash removes it, so the payload carries\`, the quote-keeping mask marks that token quoted, and the backtick substitution's-ltcounts as the bound.Both are allowed and both loop under
timeout 3 bashuntil the timeout ends them. The loop written out with bare backticks is denied. Thebash -cform is allowed on develop too, so it predates that fix, and theevalform reaches it once #2080's fix reads eval payloads. Backslash-dollar inside double quotes likely reads the same way.ptr727 commentedon Oct 8, 2026
Declined per #2517, approved by the maintainer, under GOVERNANCE.md "Trust Boundaries and Hardening Effort": The guard backstops an agent's own mistakes, and this is a command shape built to defeat it rather than one an agent session writes, so a miss does not realistically occur. See #2517 for the per-issue reason.