Skip to content

Narrow the Write Guard's Launcher Assignment and Nesting-Cap Over-Denials #3341

Closed

Description

@ptr727

Context

Found by the third local review pass on the change for #3050, #3083, #3085, #3304, and #3307 (branch feature/guard-directory-tokenizer-launchers). Each is an over-denial that change introduces. Develop's guard allows each one. They are filed rather than narrowed in the lane that wrote them, since narrowing a deny while allow gaps are open has repeatedly opened a new allow. Each was confirmed with a classify probe on constructed commands.

Over-Denials

  • Every assignment after an unknown launcher is read as its environment. _launcher_prefix now collects every NAME=value word after a launcher the guard does not know, not only one after an env. So an assignment that is an argument of the launcher reads as git's environment:
    • docker run --rm -e HOME=/tmp example/image git status is denied as a HOME config directory the guard does not read.
    • docker run --rm -e GIT_CONFIG_GLOBAL=/example/config example/image git status is denied.
    • ssh example HOME=/x git status is denied.
  • The rule 6 check past the nesting cap reads words, not subcommands. _MUTATING_SUB_WORD matches a subcommand name anywhere in the overflowed text once git appears in it, where _may_run_alias already reads each git word's real subcommand.
    • echo github && rm -rf build, git log --grep=reset, and git status && mv a b, each nested six bash -c levels deep, are denied.

Possible Direction

Read an assignment after an unknown launcher only where an env precedes it among the launcher's words. Read the overflowed text's git subcommands through _unquoted and _git_subcommand_index as _may_run_alias does.

Activity

  1. added
    bugSomething isn't working
    introducedReview finding classed introduced per local-strict-review Disposing of Findings
    scriptA defect in hub tooling
    on Oct 22, 2026
  2. ptr727 commented on Oct 22, 2026

    @ptr727
    OwnerAuthor

    The first item here is fixed in #3342 before it merges: _launcher_prefix now reads an assignment after an unknown launcher only after an env among its words, so docker run --rm -e HOME=/tmp example/image git status and ssh example HOME=/x git status are allowed again. The nesting-cap item remains open.

  3. ptr727 commented on Oct 22, 2026

    @ptr727
    OwnerAuthor

    Two more over-denials #3342 introduces, from its seventh local pass, each allowed by develop:

    • BASH_BIN="$(command -v bash)"; git push --tags origin and bash -c 'command -v sh'; git push --tags origin. _prefix_walk passes command -v as a precommand, so the shell name it looks up reads as a shell run with no command string, now read inside substitutions and wrapper bodies too. _EVAL_RUNNER_OPTIONS["command"] already says only -p and -- keep command a runner.
    • flock /example/watch git push origin develop, in a checkout whose origin allows develop. _repo_may_move matches any word whose base name is watch in front of git, a lock-file path included, rather than a watch the walk passes as a launcher.
  4. ptr727 commented on Oct 22, 2026

    @ptr727
    OwnerAuthor

    Probed on develop after #3357 with offline classify seams: BASH_BIN="$(command -v bash)"; git push --tags origin and bash -c 'command -v sh'; git push --tags origin both classify as allow, so the command -v item no longer reproduces. The nesting-cap and flock /example/watch items remain.

  5. 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

    bugSomething isn't workingintroducedReview finding classed introduced per local-strict-review Disposing of FindingsscriptA defect in hub tooling

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions