Skip to content

Decide Whether a Shell String That Is Only an xargs Replace String Fails Closed in the Write Guard #3385

Closed

Description

@ptr727

Context

Found by the local review of the change closing #3336 and #3337, which fails closed on a shell string that xargs fills where that string runs git or gh. Develop's guard shares the case below, and it was read from _xargs_filled_body and confirmed with a classify probe on a constructed command.

A Shell String That Is Only the Replace String Keeps Its Verdict

echo 'git reset --hard' | xargs -I{} sh -c '{}', run in a primary checkout, is allowed. xargs supplies the whole script, so the string runs whatever the input holds, yet the string itself runs neither git nor gh. Before a push, the config-change scan already fails closed on this shape. Outside a push, nothing reads it.

Decision Needed

  • Fail closed where a string xargs fills holds nothing but the replace string, in a command naming git or gh. That denies a command whose script comes wholly from xargs's input, such as the case above. xargs -I{} sh -c 'echo {}' keeps its verdict.
  • Keep it allowed, as a script the guard does not read. It then stays in the same class as bash script.sh and printf ... | xargs -0 sh -c, and the README records the gap.

Activity

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

    @ptr727
    OwnerAuthor

    Decided by the maintainer: keep a shell string that is only the xargs replace string allowed. It is a script the guard does not read, in the same class as bash script.sh. The guard code does not change. What remains here is the documentation: the guard README records the gap. The decision label comes off, and this issue stays open as that documentation work.

  3. removed
    decision
    on Oct 23, 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

    pre-existingscript

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions