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 Guard's Wait-Loop Depth Cap Allows a Loop Nested Past It #2205
_unbounded_wait_loop and _sleeps stop reading at a recursion depth of four and return "no loop" past it. A loop nested five quoting levels deep is therefore allowed, although bash still runs it. That makes the cap fail open, where the rest of the wait-loop rule fails closed.
Reproduce (constructed)
Build the command by applying shlex.quote to while true; do sleep 1; done once per level and prefixing bash -c (or eval ) each time. At four levels the result is denied. At five or six it is allowed, and bash runs the loop.
Done looks like
A payload past the depth cap is read as a deny, or at least is never read as clean, and a self-test row pins a five-level case for both bash -c and eval.
Found by the local strict review of the #2080 fix (handoff #2137). The cap predates that fix, and the eval reading inherits it.
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
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.