Skip to content

The Guard's Wait-Loop Rule Misses a Loop Inside a Double-Quoted Command Substitution #2206

Closed as not planned

Description

@ptr727

Problem

The guard's wait-loop rule never reads a command substitution inside double quotes. The tokenizer keeps "$(...)" as one word, so the loop inside it is never seen, although bash runs it. The unquoted form of the same substitution is denied.

Reproduce (constructed)

Allowed on develop, and bash runs the loop until something kills it:

echo "$(until false; do sleep 1; done)"

echo $(until false; do sleep 1; done) is denied. The same holds with bash -c '<loop>' or eval '<loop>' inside the quoted substitution.

Done looks like

A $(...) body inside double quotes is scanned as commands the way an unquoted one is. The command above is denied, and a self-test row pins it.

Found by the local strict review of the #2080 fix (handoff #2137). It predates that fix, and differs from #1843, which needs a line whose quoting does not parse.

Activity

  1. added
    bugSomething isn't working
    agentsAgents instructions
    pre-existingReview finding classed pre-existing per local-strict-review Disposing of Findings
    on Oct 1, 2026
  2. ptr727 commented on Oct 8, 2026

    @ptr727
    OwnerAuthor

    Closed: Folded into #1959 per #2517, approved by the maintainer. This is a case of the guard's lexer splitting a command differently from bash, and #1959's single bash-aware scanner fixes the class, with this shape kept as a self-test row there.

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

    agentsAgents instructionsbugSomething isn't workingpre-existingReview finding classed pre-existing per local-strict-review Disposing of Findings

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions