Skip to content

Decide How the #1998 Quote-Mask Fix Proceeds After Its Review Budget #2060

Closed

Description

@ptr727

Question

The fix for #1998, on branch feature/auto-1998 (handoff #2057, no pull request yet), has spent its two local-review edit rounds. Its third review still found one introduced finding: a command that develop denies as an unbounded wait loop, which the branch allows, and which bash really runs forever. How should the lane proceed?

Background

#1998 is a false deny, so the defect fails closed. The branch replaces the guard's quote-keeping lex, which reads no escapes, with _marked_lex, a lex that reads escapes as POSIX shlex does. That lets the quote mask survive an escape anywhere in the command, and the three commands in #1998 are now allowed.

The cost is that the mask now reaches commands where develop had no mask at all. On those, any place where shlex reads text differently from bash can mark a token as a literal operand when bash reads it as syntax. That fails open. Each review round found one more such shape:

  • round 1: a $( or backtick inside double quotes, and $'...'
  • round 2: a backtick glued to a quoted word, and a # comment
  • round 3: a heredoc fed to a shell with an unquoted delimiter, whose body bash reads twice

For each shape, the branch falls back to develop's own mask (_quote_kept_mask), so that shape's verdict equals develop's by construction. After round 2, a 150k-case fuzz found no command where the branch's mask differs from develop's where develop's mask existed. The round-3 heredoc case is not covered yet. The reviewer also started probing a second double-read shape, an escaped backtick inside a bash -c "..." payload, but did not finish, so that case is unverified.

The shapes that develop itself allows are filed as #2058 and #2059 (pre-existing).

Counts per class across the three passes: introduced 5 (4 fixed, 1 open), pre-existing 2 (filed), style 0, plus 1 docstring finding (fixed).

Options

  1. Recommended: allow one more edit round. Fall back to develop's mask for any command holding a heredoc (<< other than <<<) and for any loop read inside a sh -c/bash -c payload. Then run another local review, and drive the pull request to develop if that review finds nothing introduced.
    • Reason: the fallback pattern has held on every shape it covers. Both remaining shapes are the one class where bash reads text twice, and each fallback only restores develop's verdict.
    • Effect on the parked work: the next worker adds the two fallbacks and self-test rows to feature/auto-1998, then reviews again. It parks again if a fourth round finds another introduced flip.
  2. Close Wait-Loop Bound Check Drops Its Quote Mask on Any Escape in the Command #1998 as not planned and delete the branch.
  3. Merge the branch as it stands. The open heredoc flip would be tracked in The Wait-Loop Bound Check Counts a Comparison Bash Never Evaluates #2058.

Blocks

Activity

  1. added
    decision
    on Sep 29, 2026
  2. ptr727 commented on Sep 29, 2026

    @ptr727
    OwnerAuthor

    Answered by the maintainer on 2026-09-29: option 1, one more edit round. Fall back to develop's mask for any command holding a heredoc (<< other than <<<) and for any loop read inside a sh -c/bash -c payload, review again, and drive to develop if nothing introduced remains; park again otherwise.

  3. removed
    decision
    on Sep 29, 2026
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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions