Skip to content

Read an Unquoted Heredoc Fed to a Shell as an Outer-Expanded Body in the Write Guard #3384

Closed

Description

@ptr727

Context

Found by the local review of the change closing #3337, which fails closed on a double-quoted wrapper body the outer shell expands where that body runs git or gh. Develop's guard shares it, and it was confirmed with a classify probe on a constructed command.

An Unquoted Heredoc Fed to a Shell Is Expanded the Same Way

The outer shell expands a $ word in a heredoc body whose delimiter is unquoted before the shell it feeds parses the body. A value holding a separator therefore adds whole commands, exactly as in a double-quoted -c body:

B="x; git push origin develop"; bash <<EOF
git status $B
EOF

This is allowed. The body runs git, so it falls inside the ruling recorded on #3337, which names the double-quoted wrapper body only.

Possible Direction

Read an unquoted-delimiter heredoc body fed to a shell as an outer-expanded body, and fail closed where it holds a $ or backtick word and runs git or gh, as _outer_expanded_body does for a -c body.

Activity

  1. added
    bug
    pre-existing
    script
    on Oct 23, 2026
  2. ptr727 commented on Oct 23, 2026

    @ptr727
    OwnerAuthor

    Closed under the maintainer's decision (ptr727, 2026-10-23) on #3391: the backlog keeps real bugs with a stated failure, features the maintainer wants, and open decisions. A finding the review loop filed on code or text a change did not touch, a refactor or consolidation chore, a tracker, a wording item, or a guard shape no session has produced is closed rather than worked. Reopen with the input and the wrong result if this issue states one.

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

    bugpre-existingscript

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions