Skip to content

The Guard Reads No ANSI-C Quoted Payload #2366

Closed as not planned
Closed as not planned

Description

@ptr727

Problem

The guard's lexer does not model bash's ANSI-C quoting, $'...'. It reads $' as a $ followed by an ordinary single quote, so a loop written as an ANSI-C quoted payload is never read as one.

Reproduce (constructed)

Both are allowed on develop, and both loop under timeout 3 bash -c until the timeout kills them:

bash -c $'until false; do sleep 1; done'
eval $'until false; do sleep 1; done'

The second form needs the #2080 change, which reads an eval's arguments, to be reached at all.

Done looks like

An ANSI-C quoted word is unescaped the way bash unescapes it before it is read as a payload, both commands above are denied, and self-test rows pin them.

Found by the local strict review of the #2080 branch. It predates that branch.

Activity

  1. added
    bug
    agents
    pre-existing
    on Oct 4, 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

    agentsbugpre-existing

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions