Skip to content

fix(security): close rm -rf flag-spelling and $HOME deny-gate bypasses - #15316

Closed
chenmingwei23 wants to merge 1 commit into
mainfrom
fix/rm-rf-deny-flag-and-home-var-spellings-8237
Closed

chenmingwei23 wants to merge 1 commit into
mainfrom
fix/rm-rf-deny-flag-and-home-var-spellings-8237

Conversation

@chenmingwei23

@chenmingwei23 chenmingwei23 commented Sep 30, 2026 •

Copy link
Copy Markdown
Contributor

Problem / Motivation

Goal: Close two security-class gaps in the local rm -rf deny gate so a recursive-force deletion of the filesystem root or the home directory is refused regardless of how the flags or the home target are spelled.

As part of that goal, the deny-gate's structural floor also holds under the shell forms review required so the two spellings cannot be reached around:

  • A literal home-dir operand with a control operator glued to it (rm -fr $HOME; ls, && ls, |cat, or wrapped in ( … )) still denies — the gate reads the command's top-level segments, so a glued operator cannot carry the wipe past the home check.
  • The scalar $HOME subscript identities ${HOME[0]} and ${HOME[@]} are $HOME spellings (a plain string is a one-element array), so rm -fr "${HOME[0]}" denies exactly as rm -fr "$HOME" does.
  • A shell -c script that references its positional parameters (sh -c 'exec "$@"' _ rm -fr ~) can execute the words after the script, so they are classified rather than skipped as inert $1..$n data.
  • When one line declares more than one heredoc (cat <<'A' <<'B' …), every heredoc body on that line is consumed as stdin data in order, so an inert body is not re-read as a command and refused.
  • A heredoc fed to a program that executes its stdin, the rm span across a command-substitution's closing paren, command-substitution operand resolution, the find -exec printer exemption, and the ${HOME[*]} subscript via the glob pre-pass are out of scope here and deferred to rm deny gate: heredoc + command-substitution handling needs a single-rule redesign #19291 (a single-rule redesign). A root/home wipe written as the contiguous rm -rf / literal in any of those forms is still caught by the whole-text deny-net regex; rm -fr $(find ~ …) / rm -fr $(echo ~) is denied fail-safe, since the substitution can expand to the home dir.

The two local-destructive-rm-rf-* rules under the PreToolUse gate matched only the literal spelling rm -rf:

Why it matters

These are the gate's two backstops against a catastrophic, irreversible local deletion. A deny rule an agent gets past by re-ordering or renaming a flag, or by writing $HOME instead of ~, is not a control. Both spellings are ordinary and an agent reaches them without any evasion intent.

Not a goal

  • Blocking non-recursive or non-force deletions. rm -f, rm -r alone, flagless rm, and relative-path deletes (rm -rf ./build) remain allowed — only recursive AND force together (or --no-preserve-root) against a root/home target is destructive here.
  • Recognising a destructive deletion written in a LANGUAGE SOURCE body rather than as an rm argv. python -c 'shutil.rmtree("/")' is the same wipe with no rm token, so an rm-argv matcher can never be complete for interpreter code; that surface is left to the OS sandbox and is out of scope here (see What changed).

What changed

The two rm catalog regexes stay LIVE in the Python re deny tier as a fail-closed net, UNIONed with a new argv-structural floor (rm_floor._recursive_force_rm_targets). This is the smallest surface that closes both issues without a false-positive regression:

  • The regex net (rm -rf /.* / rm -rf ~.*) catches the contiguous literal wherever it appears, including a quoted payload the floor's own-argv model cannot reach — su -c "rm -rf /", fish -c, eval "$(printf 'rm -rf /')", trap 'rm -rf /' EXIT, bash <(echo …). Dropping the net would let every such vehicle get past a rule base denied, so it stays.
  • The argv floor adds the STRUCTURAL coverage the two issues ask for: it walks the top-level command and every nested shell payload (bash -c, $(…), chained segments) reading each rm command's OWN argv, collects the recursive / force / --no-preserve-root flags from EVERY position in any packing / order / long-option / unambiguous-abbreviation spelling (so rm / -rf, rm -r -f /, rm --recursive --force / are all caught, de-quoting a quoted flag token first), and denies the root / (a run of slashes, or the /* glob over its children) or home (~ / $HOME / ${HOME}, bare, with trailing slashes, or the ~/* glob) itself in any flag spelling. It resolves dot segments and partial quoting ("$HOME"/) so a spelling of the exact target cannot evade it.
  • The floor also recognises rm reached through an exec wrapper (setsid/sudo/docker exec/busybox dispatch), through a command-string wrapper (watch/flock -c/ssh remote), and through a sh -c payload. A wipe reached through an xargs pipeline is left to the whole-text regex deny-net — xargs stdin reconstruction is out of this change's Goal (rm flag spellings + home-variable spellings) and is not performed by the floor.
  • The regex net's one false positive — a command that merely NAMES the literal at a grep-family argument position (grep -rn 'rm -rf /' src/) — is narrowed by the restored _DENY_EXCEPTIONS grep inert-search carve-out, scoped to the grep/egrep/fgrep family (which cannot execute their operands) and gated so no shell-active construct or pipeline can hide an executed command behind it.
  • A tokenizer error on the floor costs only the widened flag coverage: the live regex net still matches the literal, so the fail path is no weaker than base.

Deliberately NOT shipped (left to a follow-up / the OS sandbox): interpreter -c/stdin code-payload extraction, awk/php source-body inspection, and find -exec {}-root classification. An rm-argv matcher is the wrong subject for a language source body, and those layers also over-refused legitimate find-prune and grep-alternation idioms the Security Scope lane flagged. A root/home wipe written literally in any of those forms is still caught by the whole-text deny-net regex.

Backwards compatibility

Compatible for legitimate operations. The change ADDS denial of the widened flag spellings and the $HOME/${HOME} home spellings of a root/home wipe that base missed, and keeps base's own descendant denial (the live rm -rf /.* / rm -rf ~.* regex denied rm -rf /etc and rm -rf ~/.ssh, and still does). It does NOT newly refuse any legitimate command base allowed: a widened-spelling scratch/cache cleanup (rm -fr /tmp/build-cache, rm -rf $HOME/.cache), a grep-family search for the rule's own literal, a find-prune cleanup, and a grep alternation ending in an interpreter name all stay allowed, matching base. Declared changes vs base: the grep inert-search carve-out is kept (not widened to other verbs); git commit -m/rg/git grep mentions of the literal stay DENIED exactly as base denied them (the quoted-mention exoneration is NOT shipped).

Tests

  • test_rm_rf_denies_root_or_home_target_in_any_flag_spelling — every flag spelling of the root/home target itself denies.
  • test_rm_rf_denies_descendants_of_root_and_home_allows_only_relative_and_mentions — the contract bounded on both sides.
  • test_rm_rf_glob_over_children_is_equal_to_the_target — /* / ~/* deny; a widened-spelling descendant glob allows.
  • test_rm_rf_behind_an_unknown_exec_wrapper_... family — a wrapper denies the root/home target, allows a widened descendant.
  • test_rm_rf_stay_live_in_the_regex_deny_net — the catalog regexes stay in the re tier (not stripped) and is_denied denies a su -c/eval quoted payload the floor's own-argv model misses.
  • test_rm_rf_obfuscated_spellings_are_decoded_by_the_floor / ..._fails_closed_when_the_tokenizer_raises — obfuscated root wipes decoded; fail-closed to the live regex net.
  • test_rm_rf_gnu_long_option_abbreviations_are_denied / ..._busybox_applet_dispatch_... / ..._glued_ampersand_is_a_command_boundary / ..._wrapped_home_with_repeated_trailing_slashes_is_denied / ..._partially_quoted_home_is_classified_as_home / ..._nested_shell_c_is_budgeted_not_exponential — the flag/dispatch/boundary/home-spelling/budget coverage.
  • docs/system-specs/modules/security.md describes the shipped contract; golden-manifest fixture unchanged (no catalog pattern changed). black/isort/flake8/mypy/comment-history clean; security + denied-commands suites green.

Manual verification

N/A — unit coverage exercises the real is_denied gate (quote-normalization and segmentation included) directly.

Screenshots / video

N/A — no UI change; this is a backend security-gate change.

Related Issues

Fixes #8237
Fixes #8387

Pattern harvest

Rule candidate: review-prompt
Pattern: a deny rule authored as a fixed command literal is gotten past by any equivalent flag/argument respelling (order, packing, long option) or variable spelling of its target. Fix the SHAPE with an argv floor, but keep the original whole-text regex as a fail-closed net for the quoted-payload vehicles an own-argv model cannot see — a floor that REPLACES the regex fails open on su -c "…"/eval/trap. Hold the scope to the flag/target spelling the issue names; do not chase language-source-body spellings an rm-argv matcher can never complete.

Known residual

A quoted-metachar literal inside a $(...) body (e.g. echo "$(rm -fr '/*')") may still be over-refused: the quoted-literal exemption that keeps a direct rm -fr '/{,tmp}' / rm -fr '/*' allowed runs only on the raw strip_quotes=True classification, and the decoded/substitution-body view has already lost its quotes to the payload walk, so a false denial there is an accepted residual (a refusal the user sees, not a missed deletion), not a hole.

Checklist

Contribution License Agreement

By submitting this pull request, I confirm that my contribution is made under the terms of the project's license.

Why this change

The two linked issues (#8237 flag spellings, #8387 $HOME target) ask that the local rm -rf deny gate refuse a recursive-force deletion of root or home no matter how the flags or the home target are spelled. These are the gate's backstops against an irreversible local wipe, so the gap affects everyone the gate protects, not a niche workflow. The change is a backend security-gate fix with no user-facing surface: it adds denial of the widened flag/$HOME spellings and keeps every legitimate command base allowed, so it changes no default, UI, copy, or option for anyone who was not already hitting the gap. No reviewer needs-human label is outstanding other than the Sensitive Change Review approval, which is noted below.

Rebased onto main + review follow-up

Rebased onto current main. Four files conflicted and were resolved:

  • src/kiro_crew/security/__init__.py and docs/system-specs/modules/security.md — main added a whitespace-elided deny view (so rm -rf " " /home/x is refused through the elided render against the base rm -rf /.* net). The branch's older residual note that described that shape as unhandled was dropped as superseded; the docs keep main's whitespace-view bullet and the floor-aware Residual bullet.
  • test/test_denied_commands_security.py — kept both the whitespace-elided-view test (main) and the branch's whitespace-before-rooted-target test, with the latter updated to the post-rebase behaviour (a whitespace word before a rooted descendant is refused through the elided view).
  • test/test_security_gate_liveness.py — the package line budget is the measured post-rebase total.

Two review findings on the floor, both base-allowed commands the floor was refusing (fail-closed over-refusals, nothing let through), are fixed and pinned:

  • A token that merely names rm as a find predicate value (find / -name rm -o -name -fr -o -path /) or as a timeout-wrapped printer's argument (timeout 5 printf '%s' rm -fr /) is read as data, not an executed rm. The executed forms — find … -exec rm -rf /, a bare timeout 5 rm -fr /, and a printer whose output is piped into a shell — still refuse. Pinned by test_rm_rf_operand_mentions_are_not_executed_rm.
  • A mandatory brace range group injects an alphanumeric into every member, so a home/root-rooted brace word that overflows the expansion cap (rm -fr ~/{,cache/}{1..300}) is a descendant cleanup, never the bare target, and stays allowed; a bare root operand alongside it still refuses. Pinned in test_rm_rf_brace_expansion_cannot_fail_open.

Internal content scan: the one flagged comment literal was reworded; the scan is not overridden.

Reviewer note (Sensitive Change Review)

Sensitive Change Review is the only remaining red after this push, and it is left for a human: a reviewer approves the sensitive-gate change on the current head (or fills the review template on it). It is not self-cleared here.

@chenmingwei23
chenmingwei23 requested a review from a team as a code owner September 30, 2026 06:05
@github-actions github-actions Bot added readiness: checking Automated validation is still running readiness: action required A blocking check or review needs attention and removed readiness: checking Automated validation is still running labels Sep 30, 2026
@github-actions

github-actions Bot commented Sep 30, 2026 •

Copy link
Copy Markdown
Contributor

Design Review (Opus 5.5) — 🟡 CONCERNS

Design-level review of 07848b291121716bcdcb2a1a94567d48fd2df1e7 — updated in place on each push. A BLOCK verdict blocks PR readiness; PASS/CONCERNS are advisory.

Design-Verdict: CONCERNS

rm_floor.py adds a second shell parser of about 3.7k lines for two rules, alongside shell_normalizer's shared one, so the two will give different verdicts as they drift.

Watch

  • A parallel shell model. The new module ships its own copies of what shell_normalizer already owns:

    • basic token helpers: _rm_argv_programs, _rm_substitution_depth_delta, _rm_token_ends_argv and _rm_split_glued_boundaries;
    • _rm_shell_c_executed_payloads with _RM_SHELL_C_PROGRAMS, its own wrapper and dispatcher tables (_RM_SPAN_EXEC_WRAPPERS, _RM_APPLET_DISPATCHERS), a heredoc stripper and quote-state machines.

    The security spec says payload extraction "is the shared extractor's alone … so the two cannot drift". Here, a fix for a wrapper or heredoc case in one parser silently leaves the other open, or over-refusing. Ordinary cleanups already over-refuse ("rm -fr $(find ~ …) is denied fail-safe"). The PR also calls itself interim: its residuals are "deferred to rm deny gate: heredoc + command-substitution handling needs a single-rule redesign #19291 (a single-rule redesign)". So all of this is maintenance load with a planned replacement.
    Clears when: rm_floor drops its private copies of helpers shell_normalizer and argv_floor already provide (payload walk, program and wrapper resolution, segmenting), or the PR records why the shared extractor cannot serve the rm floor and links #19291 as the plan that consolidates them.

Suggestions

  • A much smaller fix would close both issues with the existing machinery: add a canonicalized-rm view to _deny_segment_views. That means gathering the recursive and force flags into -rf and rewriting $HOME/${HOME} as ~, so the existing regex matches it. That view rides on _shell_payload_walk and the shared segmenting for free.

[DESIGN-REVIEWED] 07848b2

Description read

[DESCRIPTION-READ] c51d2c40575044761852140ac325e17a40f0526e10aecbde4fcdc5b88ee8f0a3

That sha256 names everything this verdict read: the PR description, plus the 1 evidence file(s) the workflow collected from it and handed this review. It covers that evidence because the media strip replaces every attachment URL with the same placeholder, so an edit swapping one attachment for another would leave the description's captured text identical while what this review judged changed. Recompute it with .github/scripts/pr-description-capture.sh over the same inputs; if it differs, the description or that evidence changed after this verdict was formed and any finding drawn from either is unproven.

@github-actions

github-actions Bot commented Sep 30, 2026 •

Copy link
Copy Markdown
Contributor

First Principles Review (Opus 5.5) — 🟡 CONCERNS

Premise-level review of 07848b291121716bcdcb2a1a94567d48fd2df1e7 — why this exists and whether the shipped surface is the smallest honest version. Updated in place on each push. A BLOCK verdict blocks PR readiness; PASS/CONCERNS are advisory.

First-Principles-Verdict: CONCERNS

The two reported spellings (flag order, $HOME) need a small argv check; rm_floor.py ships 4,024 lines of parallel shell parsing on top of it.

Not justified as shipped

  • Item 3 — oversized: the Goal is flag spelling and $HOME spelling. Reading rm through wrappers (sudo/setsid/docker exec/busybox/watch/flock/ssh) is about the vehicle, not the spelling. The regex net already covers quoted vehicles, and AGENTS.md calls this a "spelling-chase … review smell".
    Subtraction: delete the wrapper/dispatch tables (_RM_SPAN_EXEC_WRAPPERS, _RM_DISPATCH_WRAPPERS, _RM_COMMAND_STRING_WRAPPERS, _RM_APPLET_DISPATCHERS). Keep flag collection plus the /, ~, $HOME, ${HOME} operand match over the existing _shell_payload_walk frames.
    Clears when: the wrapper tables are removed, or a human amends the Goal.
  • Item 4 — oversized: the data-context masks (_rm_find_command_word_mask, _rm_git_search_arg_mask, _RM_MOVER_PROGRAMS, multi-heredoc, sh -c positional handling) exist only to undo over-refusals from Item 3. The file cites "GPT 6.1" 50 times.
    Subtraction: these masks go when Item 3 goes.
    Clears when: the masks are removed with Item 3.
  • Item 5 — undeclared: a literal absolute home path is now denied by reading the process home, with case-folding on macOS and Windows.
  • Item 7 — undeclared: the shared _substitution_bodies quote-context change affects 3 other callers.

What this change ships

Inventory (8 items) — 4 justified

Intent: stop an agent wiping / or home by reordering rm flags or writing $HOME. This is a FIX.

  1. Root itself denied in any flag order, packing, long option or abbreviation, and on --no-preserve-root — justified
  2. Home denied when spelled $HOME, ${HOME} or "$HOME" — justified
  3. Floor reads rm through exec and command-string wrappers — oversized
  4. Data-context exemptions (find, git search, movers, heredocs, sh -c positionals) — oversized
  5. rm -fr /home/<user> literal denied via the real home path — undeclared
  6. /*, ~/* and dot-segment forms treated as the target itself — justified
  7. Shared _substitution_bodies now walks each body in its own quote context — undeclared, rides along
  8. Grep inert-search carve-out kept, its audit mechanism named — justified

[FIRST-PRINCIPLES-REVIEWED] 07848b2

Description read

[DESCRIPTION-READ] a1997fb2e8ed94f520597838c6490d4dc04137e409c4a5a4c9fe67d9dc626d10

That sha256 names the PR description this verdict read. Recompute it with .github/scripts/pr-description-capture.sh; if it differs, the description changed after this verdict was formed and any finding drawn from the description is unproven.

@github-actions

github-actions Bot commented Sep 30, 2026 •

Copy link
Copy Markdown
Contributor

GPT 6.1 Review — 🔴 changes requested (blocking)

GPT 6.1 found at least one blocking issue that must be resolved before merging 07848b291121716bcdcb2a1a94567d48fd2df1e7. 2 of 2 blocking finding(s) are security-class and were withheld from adjudication, so the blocking verdict stands.

This comment is updated in place on each push.

BLOCKING -- src/kiro_crew/security/rm_floor.py:3812 -- Glued redirections bypass the home-deletion floor

if _rm_is_redirect_operator(arg):
rm -fr "$HOME">/dev/null (or rm -fr>/dev/null "$HOME") -> attached redirection text prevents operand or flag recognition -> is_denied returns None, permitting deletion of ordinary home files outside the sandbox’s leaf seals.
Anchor: residual/security
Fix: Split unquoted, unescaped redirections from attached argv words before both flag prechecking and target classification.

BLOCKING -- src/kiro_crew/security/rm_floor.py:3165 -- Separate positional scanning misses the executed deletion argv

span[1:],
sh -c 'rm -fr "$1"' _ "$HOME" -> the floor scans the unresolved script and positional arguments independently -> is_denied returns None, although the shell binds home to $1 and recursively deletes unsealed personal files.
Anchor: residual/security
Fix: Bind known shell positional arguments into the script’s argv before classifying its rm invocation, rather than scanning those arguments independently.

[BLOCK-MERGE] 07848b2
[GPT-REVIEWED] 07848b2

Adjudication (Opus 5.5) — is blocking on each finding proportionate?

F1 (rm_floor.py:3812): Unbounded harm, a home wipe the gate lets through. Confirmed: _rm_is_redirect_operator (rm_floor.py:550-565) only recognises a word that starts with an operator. So in "$HOME">/dev/null the redirect glued to the end of the operand is never split off, and the whole word misses both the home matcher and the flag check. This is an ordinary spelling an agent could write, so the case isn't extreme.

F2 (rm_floor.py:3165): Unbounded harm. Confirmed: _RM_SHELL_C_POSITIONAL_REF_RE (rm_floor.py:3084) matches $1, but at rm_floor.py:3160-3167 span[1:] (_ "$HOME") is scanned as an argv of its own with no rm in it, while the script's rm -fr "$1" is scanned without the bound value. The sh -c '…' _ arg idiom is common, so the case is plausible.

[ADJUDICATION] 07848b291121716bcdcb2a1a94567d48fd2df1e7 total=0 uphold=0 downgrade=0
[GPT-ADJUDICATED] 07848b291121716bcdcb2a1a94567d48fd2df1e7

[ADJUDICATION-FENCED] 07848b291121716bcdcb2a1a94567d48fd2df1e7 fenced=2 flagged=0
UPHOLD-FENCED F1 src/kiro_crew/security/rm_floor.py:3812 -- The redirect check only matches an operator at the start of a word, so `rm -fr "$HOME">/dev/null` slips past the home matcher; that is an ordinary spelling, not an extreme one.
UPHOLD-FENCED F2 src/kiro_crew/security/rm_floor.py:3165 -- The positional args are scanned without the script that binds them, so the common `sh -c 'rm -fr "$1"' _ "$HOME"` idiom deletes home without being denied.
[GPT-ADJUDICATED-FENCED] 07848b291121716bcdcb2a1a94567d48fd2df1e7

False positive or not applicable? A repository writer can comment:
/ai-review override gpt 07848b291121716bcdcb2a1a94567d48fd2df1e7: <one-sentence reason>

chenmingwei23 pushed a commit that referenced this pull request Sep 30, 2026
Addresses the GPT security-class review on #15316: GNU getopt accepts
options in any position, so the flags-then-operand catalog regex still missed
'rm / -rf --no-preserve-root' (flags AFTER the operand). Add an argv-structural
floor (_recursive_force_rm_targets) that tokenises the top-level argv, collects
the recursive/force/--no-preserve-root flags from every position, and reports
which rooted target (root vs home) is deleted -- so each rule fires only for its
own target and an operator opt-out of one is honoured. The floor is a UNION with
the regex tier and fails open to it, mirroring the self-protection floor.

Also require a variable-name boundary after $HOME in _HOME_VAR_RE so an
unrelated $HOME_BACKUP is no longer mis-expanded to the home path (GPT
non-blocking finding), and give the home rule's regex the same boundary.
@github-actions github-actions Bot added readiness: checking Automated validation is still running and removed readiness: action required A blocking check or review needs attention labels Sep 30, 2026
@chenmingwei23

Copy link
Copy Markdown
Contributor Author

Rev 2 (head bcda51ec1) addresses the review:

GPT blocking (post-operand flags bypass, security-class). Fixed as named — argv-structural, not a wider regex. New floor argv_floor._recursive_force_rm_targets tokenises the top-level argv, collects the recursive/force/--no-preserve-root flags from every position, and returns which rooted target (root vs home) is deleted; is_denied denies under the matching rule. So rm <slash> -rf --no-preserve-root, rm /etc -r -f, rm $HOME -rf etc. are now denied. The floor is a UNION with the regex tier and fails open to it (mirroring the self-protection / git-publish floors), scoped to the top-level argv so it does not fire on a data mention (an echo bash -c '<the deletion>') or a sibling command's flags (ls -rf; rm /tmp/x) — nested payloads and quote respellings stay covered by the regex tier's existing views. Tests: test_denies_rm_rf_with_flags_after_the_operand, test_rm_rf_floor_does_not_fire_on_a_mention_or_a_sibling_command.

GPT non-blocking ($HOME_BACKUP false-positive). Fixed — added a variable-name boundary after HOME in both the catalog home regex and the normalizer's _HOME_VAR_RE (the expander that was turning $HOME_BACKUP into the home path + _BACKUP). rm -rf $HOME_BACKUP is now allowed. Test: test_allows_home_prefixed_variable_and_post_flag_relative_paths.

Comment History Gate. The lines this change adds are the new floor + its explanatory comments in argv_floor.py/denied_rules.py and the rev-2 doc note in security.md; all reviewed and accurate to the diff.

PR Hygiene. Pattern harvest section is present in the description.

Opus crashed pre-verdict on the prior head — this push should let it re-run. Local: 1631 passed, 1 skipped; black/isort/flake8/mypy clean. Two commits.

@github-actions github-actions Bot added readiness: action required A blocking check or review needs attention and removed readiness: checking Automated validation is still running labels Sep 30, 2026
@github-actions

github-actions Bot commented Sep 30, 2026 •

Copy link
Copy Markdown
Contributor

Security Scope Review -- 🔴 BLOCK (blocking)

Which legitimate operations does 07848b291121716bcdcb2a1a94567d48fd2df1e7 newly refuse? Updated in place on each push. A script-confirmed regression blocks; the model proposes candidates and never decides a refusal.

Verdict basis: a script-confirmed newly-refused operation.

Security scope review -- adjudicated candidates

  • macos-latest (platform posix): 28 classified, 1 newly refused, 26 still allowed.
  • ubuntu-latest (platform posix): 28 classified, 1 newly refused, 26 still allowed.
  • windows-latest (platform windows): 15 classified, 0 newly refused, 15 still allowed.

Newly refused (confirmed by the real classifier at both refs)

  • export HOME="$(mktemp -d)" && pytest test/test_cli.py && rm -rf "$HOME" (posix, leg macos-latest)
    • Who loses it: Test runners and CI isolate a disposable HOME and tear it down afterwards; base allowed it, the diff pins it denied (c740 ruling), so this row shows the cost.
    • Refused by: deny-rules -- Blocked by security policy: rm -rf .*
      Matched structurally on the rm argv: rm recursively force-deletes the home directory (
      or $HOME) with the recursive and force flags present in any position.
      Refusal diagnostic: rule=local-destructive-rm-rf-home component=argv-floor span=0..71 shape=len=71,seen
  • export HOME="$(mktemp -d)" && pytest test/test_cli.py && rm -rf "$HOME" (posix, leg ubuntu-latest)
    • Who loses it: Test runners and CI isolate a disposable HOME and tear it down afterwards; base allowed it, the diff pins it denied (c740 ruling), so this row shows the cost.
    • Refused by: deny-rules -- Blocked by security policy: rm -rf .*
      Matched structurally on the rm argv: rm recursively force-deletes the home directory (
      or $HOME) with the recursive and force flags present in any position.
      Refusal diagnostic: rule=local-destructive-rm-rf-home component=argv-floor span=0..71 shape=len=71,seen

Each row above is an operation that the base ref ALLOWS and this change REFUSES. Narrow the rule at the tier named. Withdrawing a row is not the way to green: that is its own pull request, on its own merits.

Scope-Verdict: CONCERNS

TIGHTENING: the rm -rf deny rules (local-destructive-rm-rf-root / -home) gain an argv-based floor, rm_floor._recursive_force_rm_targets. It runs alongside the old regex in is_denied's rule-catalog tier, not in place of it. -- The ONE threat: deleting the root or home directory itself through a flag or home spelling the old literal missed. In the hunk's words: "rm recursively force-deletes the filesystem root itself (/, a run of slashes, or /*) with the recursive and force flags (or --no-preserve-root) present in any position" and "the home directory ITSELF is denied in any flag spelling … with the home target spelled ~ or $HOME / ${HOME}" (src/kiro_crew/security/denied_rules.py, _SELF_PROTECTION_FLOOR_NOTES and the rule descriptions).

ADJUDICATED: 34 candidates, 0 confirmed newly-refused (the harness gave me no verdicts; nothing below is reported as a script-confirmed regression)

Narrowing I can argue but not confirm: the candidate export HOME="$(mktemp -d)" && pytest test/test_cli.py && rm -rf "$HOME" is refused on purpose by this diff. The tests pin it (assert is_denied(f'export HOME="$(mktemp -d)" && {rm} -rf "$HOME"') is not None, marked "c740 RULING … the disposable-HOME exemption is SUBTRACTED"). Base allowed it: its normalized text rm -rf $HOME never matches rm -rf ~.*. Test runners and CI that tear down a throwaway HOME this way lose that teardown. If the harness confirms it, the narrow fix is a rule-catalog change: let the floor read "$HOME" as home unless an unconditional, top-level HOME=/export HOME= assignment appears earlier in the same command list, with a value that is not itself home-derived. Real ~ and literal-home wipes would still be refused.

PLATFORM COVERAGE:

  • posix: 22 rows covering the new home spellings (~, $HOME, ${HOME}, ~+, the real home as a literal path), descendant globs next to the refused ~/* / $HOME/*, dot-segment collapse, brace ranges and alternatives, find -exec, xargs, and the wrappers sudo, docker exec, ssh, busybox.
  • windows: 5 rows. The diff assumes Windows path handling: it folds \ to /, lowercases case-insensitively when os.name == "nt", and compares against expanduser("~") (C:\Users\…). The rows cover a drive letter with backslashes, an MSYS /c/Users/… path, $USERPROFILE, a ~/AppData descendant, and the rm.exe executable name.
  • any: 7 rows for platform-neutral cases: relative targets, long options, git rm, and quoted mentions in git commit -m, git log --grep and rg.
  • Gaps:
    • macOS also gets case-insensitive folding (_sys.platform == "darwin"), but there is no darwin-only tag, so no row targets a /Users/<Name> case-variant sibling.
    • The %VAR% spelling has no row, because the floor only handles rm under a POSIX-style shell.

[SCOPE-REVIEWED] 07848b2

The confirmed rows, in the committed corpus's own shape
{
  "golden_paths": [
    {
      "kind": "shell",
      "command_or_flow": "export HOME=\"$(mktemp -d)\" && pytest test/test_cli.py && rm -rf \"$HOME\"",
      "platform": "posix",
      "reason": "Test runners and CI isolate a disposable HOME and tear it down afterwards; base allowed it, the diff pins it denied (c740 ruling), so this row shows the cost."
    }
  ]
}

@github-actions

github-actions Bot commented Sep 30, 2026 •

Copy link
Copy Markdown
Contributor

Opus 5.5 Review — ✅ no blocking findings

Reviewed 07848b291121716bcdcb2a1a94567d48fd2df1e7 — this comment is updated in place on each push.

Review details

One advisory finding; nothing blocks the merge.

FINDING — src/kiro_crew/security/rm_floor.py:3899 — Inside the operand loop, operands.append(operand) also collects words from inside an unquoted $(…) or backtick substitution. So rm -fr $(ls /), rm -rf $(find ~ -name '*.tmp'), rm -rf $(basename ~) and rm -rf `ls ~ | grep x` are now refused as local-destructive-rm-rf-root/-home, even though the / or ~ belongs to the inner command. All of these were allowed on base 63c155a → Fix: don't collect operands while the substitution depth is greater than 0, and let the substitution's own frame decide.

[OPUS-REVIEWED] 07848b2

Verdict parsed from the review's SHA-scoped output markers for commit 07848b291121716bcdcb2a1a94567d48fd2df1e7.

False positive or not applicable? A repository writer can comment:
/ai-review override fable 07848b291121716bcdcb2a1a94567d48fd2df1e7: <one-sentence reason>

@chenmingwei23
chenmingwei23 force-pushed the fix/rm-rf-deny-flag-and-home-var-spellings-8237 branch from bcda51e to bbb318c Compare September 30, 2026 08:48
@github-actions github-actions Bot added readiness: checking Automated validation is still running and removed readiness: action required A blocking check or review needs attention labels Sep 30, 2026
@chenmingwei23

Copy link
Copy Markdown
Contributor Author

Rev 3 (head bbb318c59, squashed to one commit) implements the Security Scope Review ruling.

The regression the review found is real and fixed. The recursive-force rules deny ONLY when a resolved operand IS the root or IS the home dir itself (bare or one trailing slash) — never a descendant. Enforcement is split:

  • argv-structural floor (primary) — reads only the deletion command's own argv (descending nested payloads + exec wrappers), collects the recursive/force/no-preserve-root flags from ANY position, classifies the operand EXACTLY. So the 13 script-confirmed legitimate operations (scratch cleanups under a temp dir or under home, the end-of-options marker, flags after a descendant operand, a $HOME-prefixed variable) are ALLOWED, and a search pattern / commit message that merely mentions the deletion is invisible to it.
  • narrow regex (second net) — kept, not retired: a text rule cannot distinguish an operand from a string that mentions one, but the four obfuscated genuine denies the review's stop-check surfaced (escaped-quote two-level nesting, backslash-U unicode, bash-5.3 funsub, double-quoted command substitution) are only decoded by the normalized view the regex matches, and this repo's main denies all four. Dropping the regex would drop those four denies; a deny gate does not trade a real deny for a cleaner design. The regex is anchored on an EXACT root/home operand so it no longer fires on a descendant.

One accepted, documented residual: a search whose quoted pattern ENDS in the exact deletion literal still trips the regex. One false positive on a grep for that specific string is strictly safer than one missed root wipe, so it is accepted and pinned as a known-accepted FP (test_rm_rf_accepted_false_positive_grep_for_the_exact_literal). A pattern followed by more text is not affected.

GPT/Opus expanded-HOME finding: fixed — variable-name boundary in _HOME_VAR_RE, and home is classified on the raw (unexpanded) spelling so an expanded $HOME cannot be read as root. First Principles dead wrapper: _is_recursive_force_rm deleted.

Test corpus: ~22 pre-existing tests described the old over-broad behavior (descendant targets; the now-unnecessary search carve-out). Each was migrated by keeping the command and flipping only false-positive expectations; where a test pinned a genuine deny it was verified caught and kept as DENY. The 13 allows are explicit ALLOW assertions and the four issue denies explicit DENY assertions, so the narrowing is bounded on both sides. Local: 1698 passed, 1 skipped; black/isort/flake8/mypy clean. One commit.

This widened the PR beyond the two issues; the maintainer accepted that widening deliberately in the ruling.

@github-actions github-actions Bot added readiness: action required A blocking check or review needs attention and removed readiness: checking Automated validation is still running labels Sep 30, 2026
@chenmingwei23
chenmingwei23 force-pushed the fix/rm-rf-deny-flag-and-home-var-spellings-8237 branch from bbb318c to d02ace5 Compare September 30, 2026 10:58
@github-actions github-actions Bot added readiness: checking Automated validation is still running and removed readiness: action required A blocking check or review needs attention labels Sep 30, 2026
@chenmingwei23

Copy link
Copy Markdown
Contributor Author

rev4 — floor-only, per the revised Security Scope ruling (head d02ace513).

The c865 ruling to keep a narrow exact-operand regex was overturned by the scope lane, which script-confirmed the residual refused five legitimate commands. This revision implements the overturn exactly:

  • Security Scope (fenced, zero text FPs): the exact-operand regex is retired. Both local-destructive-rm-rf-* patterns are stripped from the Python re tier by is_denied (like git-publish); enforcement is the argv floor alone, which reads only the deletion command's own argv. The five flagged commands now ALLOW — git grep 'rm -fr /', rg 'rm -fr /', git grep 'rm -fr ~', git log --grep 'rm -fr /', git commit -m 'docs: warn against rm -fr /' — pinned by test_rm_rf_text_mentions_in_searches_are_all_allowed.

  • The four obfuscations the regex covered are now decoded IN THE FLOOR (one decoder): escaped-quote two-level nest, \U 8-hex unicode (original-case command threaded through the floor so the width survives the fold), bash-5.3 funsub, and $(…)/backtick/bare-subshell — all single-quote aware, so the same constructs inside single quotes stay literal text. Pinned by test_rm_rf_obfuscated_spellings_are_decoded_by_the_floor.

  • First Principles + Design (fenced, glob-over-children): /* and ~/*/$HOME/* (optional trailing slash) are now equal to the target and denied; /etc/*, ~/.cache/* stay descendants and are allowed. Exact match plus that one glob shape, nothing wider. Pinned by test_rm_rf_glob_over_children_is_equal_to_the_target.

  • GPT (security-class, argv_floor.py find -exec): -exec/-execdir/-ok/-okdir command spans are parsed as executable argv and the same rule runs on them, so find . -exec rm -rf --no-preserve-root / \; is denied. Pinned by test_rm_rf_inside_find_exec_is_denied.

  • The rm inert-search-verb _DENY_EXCEPTIONS carve-out is retired (the map is now empty) — own-argv makes it unnecessary. _is_recursive_force_rm was already deleted; the $HOME_BACKUP variable-boundary fix stands.

One documented residual, flagged for the board: a locale-quoted nested payload whose backslash-letter escapes the inner shell de-escapes to the program name (bash -c $"\r\m -rf /") is not caught — the shared payload decoder maps \r to whitespace rather than the letter the inner shell produces. This was never denied on main (main's rule is the bare literal rm -rf /); the widened regex briefly covered it and this ruling retired that regex. Closing it soundly needs a nesting-aware change to the shared decoder, out of scope here; pinned as a known gap in test_locale_quoting_uses_double_quote_semantics_not_ansi_c and documented in the security spec.

Local: security suites green (deny-command + all test_security.py classes + collateral), black-baselined gate / isort / flake8 / mypy clean. 0 workflow files touched.

@github-actions github-actions Bot added readiness: action required A blocking check or review needs attention and removed readiness: checking Automated validation is still running labels Sep 30, 2026
@chenmingwei23
chenmingwei23 force-pushed the fix/rm-rf-deny-flag-and-home-var-spellings-8237 branch from d02ace5 to a899b34 Compare September 30, 2026 11:53
@chenmingwei23

Copy link
Copy Markdown
Contributor Author

Both GPT 6.1 points fixed at head b8b3ccd9eb, each pinned by a committed regression test. Both are floor-only correctness fixes; no behaviour widened.

F1 — nested double quotes in a quoted substitution (rm_floor.py:1955 → shell_normalizer._substitution_bodies). echo "$(rm -fr "$HOME")" returned no denial because the substitution-body span was walked over the full text, inheriting the outer " context. The inner "$HOME" then shifted the quote parity, so the real closing ) read as quoted and the extracted body became rm -fr "$HOME")" — the operand lost to a trailing )". A command substitution re-lexes its body in its own fresh quote context, so the span is now walked over a slice that starts at the body (fresh state), exactly as the argv_floor call sites already do. echo "$(rm -fr "$HOME")" now denies; the unquoted and top-level spellings still deny, and a descendant ("$HOME"/build) stays allowed for base parity. Pinned by test_rm_rf_inner_quoted_home_in_quoted_substitution_is_denied.

F2 — escaped & over-refusal (rm_floor.py:3115 and three sibling boundary scans). A raw token.endswith("&") override treated a backslash-escaped \& as a command boundary, so a print-only echo x\& rm -fr / was refused even though the shell passes \& as literal data and runs no rm. Removed the raw override at all four sites; the quote- and escape-aware _rm_token_ends_argv already recognises an unescaped & as the real boundary, so a genuine &-chained command (echo x& rm -rf /, echo hi& rm -rf /) still denies, and a redirection 2>&1 still is not a boundary. Pinned by test_rm_rf_escaped_ampersand_operand_is_not_a_command_boundary.

Local gate green on the directly-testing security tests (deny-pattern floor, boundary gate, line-budget, denied-commands, gate liveness); CI runs the full cross-surface set. The package line-budget constant moved to the measured total.

@chenmingwei23

Copy link
Copy Markdown
Contributor Author

All three GPT 6.1 points on head b8b3ccd9eb are over-refusals — the gate refuses a rare but legitimate command (pipeline-resolved home descendant at rm_floor.py:2247, git grep search arguments at :3153, case-folded home equality on a case-sensitive filesystem at :3548). Each is on the fail-closed side: a visible refusal with no data loss, and no destructive deletion gets through on this head. They are deferred to #18709 (Due: 2026-10-24) rather than fixed here, so this PR's goal stays scoped to the two gaps it closed. No further code rounds on this PR.

@chenmingwei23

Copy link
Copy Markdown
Contributor Author

All three findings on the prior head are fixed in 94d3abeb4e, each with a regression test, and no real root or home deletion is let through:

  • rm_floor.py:2247 — a command-substitution body containing a pipe or another command stage ($(echo ~ | sed 's|$|/.cache|')) is now left unresolved rather than approximated by its first literal, so a cache cleanup is allowed. A plain single-command producer whose whole output is root/home ($(echo /), $(printf ~)) still resolves and is refused.
  • rm_floor.py:3153 — the arguments of a read-only git search (git grep, git log --grep) are now treated as data, so git grep --no-index -e rm -e -fr ~ is allowed. An executing git subcommand (git bisect run ...) and a -c config form keep classifying.
  • rm_floor.py:3548 — home-path equality now keeps the operand's original case and uses the filesystem's case semantics, so on a case-sensitive filesystem a distinct sibling such as /home/ALICE is allowed while the real home, ~, $HOME and / are still refused.

Tests: test_rm_rf_piped_substitution_body_is_left_unresolved, test_rm_rf_git_search_argument_list_is_an_inert_search, test_rm_rf_case_variant_home_sibling_is_not_the_home_dir.

@chenmingwei23

Copy link
Copy Markdown
Contributor Author

Both findings on the prior head are addressed in 4ee8dae6fb, each with a regression test, and no real root or home deletion is let through:

  • rm_floor.py:517 — rejoining a ${…} parameter expansion that spans several shell tokens re-scanned the whole growing join from every opener, so a long run of unbalanced ${ tokens cost superlinear time. The look-ahead is now bounded, so a large unbalanced run classifies quickly (about 0.9s where it was over 30s), while a real multi-token ${HOME:?…} home deletion still rejoins and is refused.
  • rm_floor.py:3693 — a producer with more than one output operand ($(echo / tmp), whose output is / tmp) was resolved to its first literal /, so a cleanup of that path was refused. A multi-operand producer body is now left unresolved; a single-operand producer whose whole output is root or home ($(echo /), $(printf ~)) still resolves and is refused.

Tests: test_rm_rf_param_expansion_rejoin_is_bounded, test_rm_rf_multi_operand_producer_substitution_is_left_unresolved.

The branch is rebased onto current main.

@chenmingwei23

Copy link
Copy Markdown
Contributor Author

Both findings on the prior head are addressed in bd5efc8b4f, each with a regression test:

  • rm_floor.py:3644 — a ) that closes a command substitution ($(…) or backtick) no longer ends the rm argv, so a target after it is still classified: rm -fr $(true) ~ and rm -fr $(:) "$HOME" are refused, while a bare subshell closer ((rm -fr /)) still ends the argv and refuses root. Test: test_rm_rf_substitution_closer_does_not_end_the_argv.
  • test/test_security.py:4597 — the wall-clock assertion is replaced with a deterministic bound: the test asserts the look-ahead window constant and that the rejoin leaves an unbalanced-opener run unchanged, so a loaded runner cannot make it flaky. Test: test_rm_rf_param_expansion_rejoin_is_bounded.

The branch is on current main.

@chenmingwei23

Copy link
Copy Markdown
Contributor Author

The over-refusal on the multi-line -c payload is fixed in bd5efc8b4f, with a regression test.

An executed -c payload is now split into its command lines before classification, so a later line's operand is not read as an earlier line's rm target. bash -c 'rm -rf ./dist + newline + cd ~ + newline + pwd' (and the CRLF form) is allowed, while a real deletion of root or home on its own payload line still refuses. Test: test_rm_rf_multiline_shell_c_payload_splits_on_newlines.

@chenmingwei23

Copy link
Copy Markdown
Contributor Author

Both findings on the prior head are addressed in e220fdbc4f, each with a regression test:

  • rm_floor.py:3900 — home equality now lowercases both the operand and the stored home, so a home path that itself contains an uppercase letter (/home/Alice) is refused in every spelling. A case-variant sibling (/home/ALICE) is told apart earlier, on the raw-case text, and only on a case-sensitive filesystem, where it is a distinct directory. Test: test_rm_rf_mixed_case_home_path_still_denies.
  • rm_floor.py:1632 — a length-changing lowercase elsewhere on the line (e.g. the Turkish dotted capital I) no longer skips neutralizing a lowercase home= variable: when the raw text carries no uppercase HOME at all, every home spelling is neutralized, so a relative build cleanup is allowed; a real $HOME on such a line still refuses. Covered in test_rm_rf_lowercase_home_variable_is_not_the_home_dir.

The branch is rebased onto current main.

@chenmingwei23

Copy link
Copy Markdown
Contributor Author

All three findings on the prior head are addressed in e220fdbc4f, each with a regression test:

  • rm_floor.py:622 — the ${ boundary scan rescanned to the end of the operand from every opener, so a long run of unclosed ${ was quadratic (${HOME repeated took ~52s). Once an unclosed ${ reaches the end, no later } can close, so the scan records that and stops rescanning — a 20 KB run now classifies in well under a second, while a balanced ${HOME:?a;b} is still skipped whole. Test: test_rm_rf_unclosed_brace_run_boundary_scan_is_linear.
  • rm_floor.py:3900 — home equality now lowercases both sides, so a home with an uppercase letter (/home/Alice) is refused; a case-variant sibling stays distinct only on a case-sensitive filesystem. Test: test_rm_rf_mixed_case_home_path_still_denies.
  • rm_floor.py:169 — git rm --cached / --dry-run is index-only and its arguments are no longer read as a filesystem wipe; a word after a < / > redirect is a source/target, not an rm operand. A plain working-tree git rm -rf ~ stays refused, and a direct rm -fr ~ / rm -fr / still refuses. Test: test_rm_rf_git_rm_and_redirect_source_are_not_floor_targets.

@chenmingwei23

Copy link
Copy Markdown
Contributor Author

Both findings on the prior head are addressed in 7e5187cadc, each with a regression test:

  • rm_floor.py:270 — the recursive-force flag precheck stopped at a command substitution's closing ), so a substitution written before the flags (rm $(true) -fr "$HOME") hid the -fr and the deletion was permitted. The precheck now treats a $(…) / backtick closer as part of one word rather than an argv boundary, so the flags after it are read and the command is refused. A bare subshell closer still ends the scan. Test: test_rm_rf_substitution_closer_does_not_end_the_argv.
  • rm_floor.py:3805 — a redirection source/target is skipped so it is not read as a deletion target, but that check removed quotes first, so a quoted literal filename shaped like an operator (">") was mistaken for a redirect and the following operand was skipped (rm -fr ">" "$HOME"). The operator is now recognised only on the raw, unquoted token, so a quoted ">" is an ordinary operand and the home target after it is classified; a genuine unquoted rm -fr x < / stays allowed. Test: test_rm_rf_git_rm_and_redirect_source_are_not_floor_targets.

The branch is on current main.

@chenmingwei23

Copy link
Copy Markdown
Contributor Author

Both GPT 6.1 findings on this head are over-refusals, not wipes getting through — the gate fails closed on each (a visible refusal, nothing deleted, recoverable by rephrasing), which the Opus 5.5 adjudication also flags, and Opus 5.5 Review is green on this same head.

  • F1 (rm_floor.py git-option case): the gate reads lowercased text, so -C <dir> and -c name=value are indistinguishable, and since a config option can run a command the whole git command stays classified (fail closed). This refuses a legitimate read-only git -C <home> grep …. The real fix carries the raw-case option token, which is plumbing.
  • F2 (rm_floor.py case detection): macOS is treated as case-insensitive, so on a non-default case-sensitive volume a case-variant sibling of home is folded and refused. The real fix probes the home filesystem's case sensitivity.

Neither flips a real deletion from deny to allow, so this PR's scope (closing the flag/$HOME wipe gaps) stays as is. Both are deferred to #18709 (Due: 2026-10-24) alongside the three over-refusals already tracked there, rather than growing the gate further in this already-large commit. No further code rounds on this PR for these.

@chenmingwei23

Copy link
Copy Markdown
Contributor Author

Both GPT 6.1 findings on this head (0555df4, a rebase onto fixed main with no code change) are over-refusals, not wipes getting through — the gate fails closed on each, which the Opus 5.5 adjudication also flags, and Opus 5.5 Review is green on this same head.

  • F1 (rm_floor.py git-option case): the gate reads lowercased text, so -C <dir> and -c name=value are indistinguishable, and since a config option can run a command the whole git command stays classified (fail closed). This refuses a legitimate read-only git -C . grep …. Already tracked in rm deny gate: three rare over-refusals (pipeline-resolved home descendant, git grep search args, case-folded sibling on case-sensitive FS) #18709.
  • F2 (rm_floor.py stacked wrappers): the effective-program resolver peels a single leading wrapper, so a print-only command behind two stacked wrappers (env env echo rm -fr /) is classified and refused. Base allows the inert print; a visible refusal, cleared by removing the redundant wrapper.

Neither flips a real deletion from deny to allow, so this PR's scope stays as is. Both go to #18709 (Due: 2026-10-24); no further code rounds on this PR for these.

Build Wheel / Build Desktop / E2E / Integration reds here are the stale ui-index.generated.json on main (gen-ui-index --check), not this diff — tracked by the open main-fix PR, not regenerated here.

@chenmingwei23

Copy link
Copy Markdown
Contributor Author

All three blocking findings on the prior head are addressed, each pinned by a committed regression test that fails without the fix and passes with it. The dangerous spellings stay refused; only the three reviewer-named false refusals change.

Opus 5.5 — rm_floor.py literal-home check, glued control operator (correctness, fail-open).
rm -fr /home/USER; ls (and ;, && ls, |cat, ( … )) left the token as /home/USER;, so it never equalled the real home and the home verdict was dropped. Fix: _rm_absolute_home_operand splits the command on its top-level unquoted ; / & / | separators first and strips a wrapping ( / ) per token before the equality, so every glued form denies again. A real descendant (/home/USER/.cache) and a quoted separator inside the pathname stay allowed. Test: test_rm_rf_literal_home_glued_control_operator_still_denies.

GPT 6.1 — rm_floor.py heredoc body-strip, second heredoc on one line (over-refusal).
The strip took only the first << opener per line, so a second heredoc declared on the same line (cat <<'A' <<'B') left its body to be re-read as commands — a body line that is literal stdin was refused. Fix: all openers declared on a line are collected and their bodies consumed in order. An evaluator heredoc and a real command after the stacked heredocs still deny. Test: test_rm_rf_second_heredoc_on_one_line_is_consumed_as_data.

GPT 6.1 — rm_floor.py find-exec payload ownership (over-refusal).
Every word of a find -exec payload kept find ownership, so a nested printer (find … -exec printf '[%s]' …) never received its data-consumer exemption and the print-only command was refused. Fix: _rm_find_exec_program_owners attributes each payload word to its own nested program, consulted only at the data-consumer skip and never written back; a payload whose nested program is a mover (e.g. a real find -exec rm …) still executes its operands and denies. Test: test_rm_rf_find_exec_data_printer_payload_is_not_a_wipe.

The three fixes added lines to the floor, so the package line-budget gate in test_security_gate_liveness.py is raised to cover them (the per-file cap is unchanged).

Head: ef6d1bc. Local gate green on the changed files: black, isort, flake8, mypy, Comment History Gate, and the security + denied-command suites (2754 passed, 2 skipped).

@chenmingwei23

Copy link
Copy Markdown
Contributor Author

Addressed on head 756ac33d735d3e8f9c17b0bd65a6820ed1049361.

First Principles — primary blocker (the deleted/rewritten pins). Both original assertions are restored, so the description's framing is true again:

  • Restored assert is_denied("grep -rl x test/ | xargs rm -rf /") is not None — the xargs-pipeline wipe is denied by the whole-text regex net, "exactly as main does".
  • Restored the ReDoS needle to the descendant path ("FOO=" + "A"*2050 + " rm -rf /home/user/project"), so the long-tail scan still pins that a descendant-of-home wipe denies, matching "keeps base's own descendant denial". Both pass unchanged.

First Principles — items 4/5/7 (home-literal matching, the review-round layers, the program-ownership pass). These are the fixes the Opus and GPT lanes required (a literal-home fail-open and a set of over-refusals), not scope creep. The Goal section of the description now declares them in plain terms: the deny-gate also covers a home literal with a glued ; & | ( ), multiple heredocs on one line, a heredoc executed by a shell, and a find -exec printer payload, and states that the program-ownership pass is the floor's own quote-aware boundary applied to the rm deny-gate only. No code was removed — removing the mechanisms would re-open the gaps the reviewers found.

GPT 6.1 — executing-shell heredoc (fail-open). bash <<'EOF'\nrm -fr ~\nEOF was allowed: the heredoc body was dropped as inert stdin, but a shell reading its stdin executes it. The strip now keeps the body for classification when the consuming program executes stdin (bash/sh/zsh/dash/ksh/eval/source/…), so a home/root wipe in that body denies; a cat/tee data heredoc stays inert. Pinned by test_rm_rf_executing_shell_heredoc_body_is_classified.

The package line-budget gate is raised to cover the added lines (per-file cap unchanged). Local gate green on the changed files: black, isort, flake8, mypy, Comment History Gate, and the security + denied-command suites (2755 passed, 2 skipped).

@chenmingwei23

Copy link
Copy Markdown
Contributor Author

Addressed on head 8051564524f9f48e08745b5a6ca9d08a9a46f3c3.

GPT 6.1 — executing-shell heredoc keyed too broadly (over-refusal). The previous head decided "keep the heredoc body for classification" when any word on the opener line was an evaluator name. That counted an evaluator used as a mere argument of a printer — printf '%s\n' bash <<'EOF' … EOF, echo bash <<'EOF' … EOF — so an inert, printed heredoc body was read as commands and refused.

The decision now looks only at a word in command position: the body is kept for classification only when a program the line actually runs (via the floor's own quote-aware program-ownership pass) executes its stdin. An evaluator name sitting in an argument no longer triggers it, so the two print-only commands above are allowed again.

The earlier fix it refines is unchanged: a heredoc truly consumed by an executing shell (bash <<'EOF'\nrm -fr ~\nEOF, sh <<'EOF'\nrm -fr $HOME\nEOF) still has its body classified and the home wipe still denies, and a cat/tee data heredoc stays inert. Pinned by test_rm_rf_executing_shell_heredoc_body_is_classified (extended with the evaluator-as-argument cases).

Local gate green on the changed files: black, isort, flake8, mypy, Comment History Gate, and the security + denied-command suites (2755 passed, 2 skipped).

@chenmingwei23

Copy link
Copy Markdown
Contributor Author

Scope reduced on head f2ada4b06cd1a89064addd4977e712dd2e6db6a9. The heredoc + command-substitution handling kept exposing a new adjacent parsing edge each round, so it is pulled out of this PR and split into #19291 for a single-rule redesign. Each flagged item is accepted and deferred to #19291:

GPT 6.1

First Principles — the two description-vs-diff pins are already restored (xargs pipeline denial and the descendant ReDoS needle), so "exactly as main" and "keeps base's own descendant denial" hold. The oversized-vs-Goal items are resolved by the removal above plus the Goal section now naming the reduced scope and the #19291 deferral.

What this PR keeps: the rm -rf flag spellings + $HOME/home-literal deny, a home literal with a glued ; & | ( ) separator, the multi-heredoc-body-as-data over-refusal fix, and the find -exec printer-payload over-refusal fix. rm -fr $(find ~ …) / rm -fr $(echo ~) stays denied fail-safe — the substitution can expand to the home dir — and that intended deny is pinned by a test.

Local gate green on the changed files: black, isort, flake8, mypy, Comment History Gate, and the security + denied-command suites (2755 passed, 2 skipped).

@chenmingwei23

Copy link
Copy Markdown
Contributor Author

Addressed on head 6ab6b8cf8a5e09adfce129f0af8d166eae6fce9d.

F1 — rm_floor.py:3707 positional forwarding (fixed, fail-safe). sh -c 'exec "$@"' _ rm -fr ~ forwarded the rm into the shell--c positional-arg skip, so it was treated as inert $1..$n data and the home wipe passed. Fix: when a -c script references its positional parameters ($@ / $* / $1…), the words after the script can be executed by it, so they are now classified as their own argv rather than skipped — sh -c 'exec "$@"' _ rm -fr ~ and bash -c 'exec "$@"' _ rm -rf / deny. A script with no positional reference leaves its args as data, so an ordinary sh -c 'echo hi' arg is unaffected. Pinned by test_rm_rf_shell_c_positional_argument_is_data_not_executed (fails without the fix).

F2 — rm_floor.py:954 token-count fallback (accepted and deferred to #19291). Over-refusal only (the adjudicator could not reproduce it); tracked in #19291.

F3 — rm_floor.py:3620 find-exec copy operand (accepted and deferred to #19291). find … -exec cp rm -fr ~ \; with a source directory named rm loses cp's data-consumer exemption because cp is a mover — an over-refusal; tracked in #19291.

F4 — rm_floor.py:3515 wrapped argument-printing shell (accepted and deferred to #19291). env sh -c 'printf "%s" "$@"' _ rm -fr / keeps ownership on env, so the printed args are refused — an over-refusal; tracked in #19291.

All three deferred items are loud, rephrasable, fail-closed over-refusals (they deny more than intended, never allow a wipe), so they are deferred rather than guarded case by case.

Local gate green on the changed files: black, isort, flake8, mypy, Comment History Gate, and the security + denied-command suites (2755 passed, 2 skipped).

@chenmingwei23

Copy link
Copy Markdown
Contributor Author

Scope narrowed on head 1a0ef88750faf8a301a6dc4d754fa4c356443f75. The floor's nested-payload handling kept surfacing a new adjacent edge each round, so the parts that need a single-rule redesign are pulled out of this PR and tracked in #19291. Point by point:

Accepted and deferred to #19291 (removed from this PR, back to the regex deny-net):

  • The find -exec data-consumer (printer) exemption. find … -exec printf '…' rm -fr "$HOME" \; | sh and the plain printer form are refused again here; a safe printer exemption that still denies the piped-into-shell case is part of the redesign.
  • Command-substitution operand resolution. rm -fr "$(printf '%s' "$HOME")" is no longer resolved by the floor (it is caught only when its contiguous literal matches the whole-text deny-net).
  • The double-quoted rm -fr "${HOME[*]}" only. This one spelling routes through the quoted-glob pre-pass before the home matcher, which is the redesign's territory. Only the quoted form is deferred — the unquoted rm -fr ${HOME[*]} denies, and ${HOME[0]} / ${HOME[@]} deny whether quoted or not.

Fixed in this PR (base goal — $HOME spellings):

  • ${HOME[0]} and ${HOME[@]} are added to the home-literal matcher: a plain string HOME is a one-element array, so rm -fr "${HOME[0]}" denies exactly as rm -fr "$HOME" does. Pinned by a test that fails without the matcher change.

What this PR keeps: the rm -rf flag spellings + $HOME/home-literal deny (including the glued ; & | ( ) separators and the ${HOME[0]}/${HOME[@]} subscript identities), the multi-heredoc-body-as-data over-refusal fix, and the shell--c positional-forwarding fix. rm -fr $(find ~ …) / rm -fr $(echo ~) stays denied fail-safe.

Local gate green on the changed files: black, isort, flake8, mypy, Comment History Gate, and the security + denied-command suites (2750 passed, 2 skipped).

@chenmingwei23

Copy link
Copy Markdown
Contributor Author

GPT 6.1 — addressed on head c94bc08ce81abaabe44549ba1553e869bfb8f93a.

git --git-dir .git log --grep … -1 denied as a root deletion (rm_floor.py git-search arg scan). Confirmed and agreed with your adjudication: this fails closed — a visible denial of a read-only search, with --git-dir=.git (glued form) as an immediate workaround, and nothing is exposed. The root cause is that the git-search scan skips only the --git-dir flag and reads its separate-word value .git as the subcommand; .git is not a known search subcommand, so the search patterns get classified as an ordinary rm -fr /. The real fix is a table of git global options that take a separate-word value, consumed inside the scan.

That is the same value-taking-option resolution class as the other nested-wrapper edges this PR deliberately scoped out, so it is deferred to #19291 (item 12) rather than fixed here — this PR's goal is the rm -rf flag spellings and $HOME/home-literal deny, and widening it into git-option parsing is exactly the per-round scope creep #19291 exists to absorb as one redesign.

@chenmingwei23

Copy link
Copy Markdown
Contributor Author

Opus 5.5 — addressed on head c94bc08ce81abaabe44549ba1553e869bfb8f93a.

(1) Line budget raised past the true value (test_security_gate_liveness.py). Fixed. The budget is now set to the exact measured package total (32_889), with no headroom — the ratchet only tightens. I also trimmed the budget rationale comment to drop the two clauses describing behavior this PR no longer carries (the find-exec printer exemption), so the rationale matches the shipped scope.

(3) Refusal note overstates scope (denied_rules.py). Fixed. The local-destructive-rm-rf-root note now names only what the rule actually refuses — the filesystem root itself (/, a run of slashes, or /*), with a path under the root denied only in the contiguous rm -rf /<path> spelling — matching the catalog description and the real matcher behavior (rm -fr /tmp/x stays allowed).

(2) env -u echo rm -rf / allowed (_rm_dispatched_program). Agreed, and as you note it is not a regression — the base allows env -u echo rm -rf /, sudo -D echo rm -fr /, and env -u cp rm -fr / too; only env -u foo rm -fr / denies. The cause is that the resolver skips only the flag of an unknown value-taking option and reads the value word as the dispatched program. That is the same wrapper/value-taking-option resolution class as the other nested edges scoped out of this PR, so it is deferred to #19291 (item 13) — the fix there is to fail closed when an unknown option precedes the word and not apply the data-consumer/mover skip.

Local gate green: black, isort, flake8, mypy, Comment History Gate, and the security + denied-command suites (2750 passed, 2 skipped).

@chenmingwei23

Copy link
Copy Markdown
Contributor Author

Status on head c94bc08ce81abaabe44549ba1553e869bfb8f93a.

The latest GPT finding (rm_floor.py operand loop reading a find predicate after an escaped \; as an rm operand — find … -exec rm -fr {} \; -printf "/" refused as a root deletion) is confirmed real and, as its own adjudication states, fails closed: a loud false refusal, no credential or ceiling exposure, cleared by rewriting the command.

It is the same find-exec operand-boundary class as the other nested-wrapper edges this PR deliberately scoped out — each round of hardening the deny-net surfaces one more adjacent parsing edge, which is exactly the pattern that needs a single-rule redesign rather than another point patch. It is tracked in #19291 (now item 14, alongside the find-exec operand and boundary items already there), together with the git-global-option over-refusal (item 12) and the unknown-value-taking-option gap (item 13).

This PR holds its stated scope: the rm -rf flag spellings and the $HOME/home-literal deny (including ${HOME[0]}/${HOME[@]}, the unquoted ${HOME[*]}, and glued control operators), plus the budget and refusal-note corrections from the last round. The remaining over-refusals are deferred to the #19291 redesign and are not being patched here.

@chenmingwei23

Copy link
Copy Markdown
Contributor Author

Sensitive change review

Head: c94bc08ce81abaabe44549ba1553e869bfb8f93a

What rule changed: This change adds a fail-closed local deny-net that refuses a recursive-force rm reaching the filesystem root or the user home directory across flag and $HOME-variable spellings. It introduces rm_floor.py, extends the local-destructive-rm-rf-root/-home catalog rules, and corrects the package line-budget and a refusal-note wording.

Before -> after: Before, a recursive-force wipe spelled with reordered or split flags (-fr, -r -f, --recursive --force, --no-preserve-root), a glued control operator (rm -fr ~;ls), or a $HOME subscript form (${HOME[0]}, ${HOME[@]}, unquoted ${HOME[*]}) could slip the gate. After, every one of those spellings is denied, while ordinary rm -f, rm -r, flagless rm, and descendant cleanups like rm -fr /tmp/x stay allowed.

Worst case if wrong: A false negative would let a destructive root or home wipe run unrefused, destroying the operating system or all personal files; a false positive produces only a visible, recoverable denial that the user clears by rewriting the command.

Evidence checked: I reproduced each denied spelling and each allowed control case through is_denied on this head, confirmed the root note matches the real matcher scope, and verified the two residual over-refusals (git global option, find predicate after escaped \;) are fail-closed and tracked in #19291 (items 12-14).

Tools still work: Normal file-management commands remain usable: non-recursive or non-force rm, recursive deletes of named scratch subpaths, git rm --cached, and redirections are not caught by the floor, so routine workflows are unaffected.

Backward compatible: Yes for every previously allowed benign command; the only behavior change is additional denials of root/home recursive-force wipes, which were already intended to be blocked, so no legitimate prior workflow is newly refused.

Existing tests: On a clean detached worktree of c94bc08ce81abaabe44549ba1553e869bfb8f93a I ran test_security.py, test_denied_commands_security.py, and test_security_gate_liveness.py with pytest: 2750 passed, 2 skipped. The local formatting, import-order, lint, type, and comment-history gates also pass on the changed files.

How to undo: Revert this pull request's single commit; rm_floor.py does not exist on the base branch, so reverting removes the entire new deny-net code path and restores the prior catalog rules, budget, and refusal note with no residual state.

@chenmingwei23

Copy link
Copy Markdown
Contributor Author

Sensitive change review

Head: c94bc08ce81abaabe44549ba1553e869bfb8f93a

  • What rule changed: This change adds a fail-closed local deny-net that refuses a recursive-force rm reaching the filesystem root or the user home directory across flag and $HOME-variable spellings. It introduces rm_floor.py, extends the local-destructive-rm-rf-root/-home catalog rules, and corrects the package line-budget and a refusal-note wording.
  • Before -> after: Before, a recursive-force wipe spelled with reordered or split flags (-fr, -r -f, --recursive --force, --no-preserve-root), a glued control operator (rm -fr ~;ls), or a $HOME subscript form (${HOME[0]}, ${HOME[@]}, unquoted ${HOME[*]}) could slip the gate. After, every one of those spellings is denied, while ordinary rm -f, rm -r, flagless rm, and descendant cleanups like rm -fr /tmp/x stay allowed.
  • Worst case if wrong: A false negative would let a destructive root or home wipe run unrefused, destroying the operating system or all personal files; a false positive produces only a visible, recoverable denial that the user clears by rewriting the command.
  • Evidence checked: I reproduced each denied spelling and each allowed control case through is_denied on this head, confirmed the root note matches the real matcher scope, and verified the two residual over-refusals (git global option, find predicate after escaped \;) are fail-closed and tracked in rm deny gate: heredoc + command-substitution handling needs a single-rule redesign #19291 (items 12-14).
  • Tools still work: Normal file-management commands remain usable: non-recursive or non-force rm, recursive deletes of named scratch subpaths, git rm --cached, and redirections are not caught by the floor, so routine workflows are unaffected.
  • Backward compatible: Yes for every previously allowed benign command; the only behavior change is additional denials of root/home recursive-force wipes, which were already intended to be blocked, so no legitimate prior workflow is newly refused.
  • Existing tests: On a clean detached worktree of c94bc08ce81abaabe44549ba1553e869bfb8f93a I ran test_security.py, test_denied_commands_security.py, and test_security_gate_liveness.py with pytest: 2750 passed, 2 skipped. The local formatting, import-order, lint, type, and comment-history gates also pass on the changed files.
  • How to undo: Revert this pull request's single commit; rm_floor.py does not exist on the base branch, so reverting removes the entire new deny-net code path and restores the prior catalog rules, budget, and refusal note with no residual state.

@chenmingwei23

Copy link
Copy Markdown
Contributor Author

Sensitive change review

  • Head commit: 07848b2
  • What rule changed: This change adds a fail-closed local deny-net that refuses a recursive-force rm reaching the filesystem root or the user home directory across flag and $HOME-variable spellings. It introduces rm_floor.py, extends the local-destructive-rm-rf-root/-home catalog rules, and corrects the package line-budget and a refusal-note wording. This head additionally closes two remaining fail-open spellings: a brace-expanded program word (r{m,} -fr "$HOME"/~, which bash runs as rm), and a repeated-star home glob (rm -fr <home>/**).
  • Before -> after (what was allowed/blocked, now): Before, a recursive-force wipe spelled with reordered or split flags (-fr, -r -f, --recursive --force, --no-preserve-root), a glued control operator (rm -fr ~;ls), a $HOME subscript form (${HOME[0]}, ${HOME[@]}), a brace-expanded program word (r{m,} -fr ~), or a repeated-star home glob (rm -fr ~/**) could slip the gate. After, every one of those spellings is denied, while ordinary rm -f, rm -r, flagless rm, descendant cleanups like rm -fr /tmp/x, a genuine home descendant like rm -fr ~/.cache, and a brace word that bash runs as a non-rm program ({echo,rm} -fr ~, which only prints) stay allowed.
  • Worst case if wrong (breaks commands / leaks secret / locks user out): A false negative would let a destructive root or home wipe run unrefused, destroying the operating system or all personal files; a false positive produces only a visible, recoverable denial that the user clears by rewriting the command. No secret is read or written by this code.
  • Evidence checked (which sandbox result proves it): I reproduced each denied spelling and each allowed control case through is_denied on this head. For the two new fixes I confirmed r{m,} -fr "$HOME", r{m,} -fr ~, the literal real-home path, and rm -fr ~/** now deny, while the single-star glob and bare home still deny and {echo,rm} -fr ~, echo r{m,} -fr ~, rm -fr ~/.cache and rm -fr ./build stay allowed. Two regression tests were added that fail on the prior head and pass on this one.
  • No regression:
    • Tools still work (which tools/commands were run, result): Normal file-management commands remain usable: non-recursive or non-force rm, recursive deletes of named scratch subpaths, git rm --cached, and redirections are not caught by the floor, so routine workflows are unaffected.
    • Backward compatible (old config / old data / old callers still work, how checked): Yes for every previously allowed benign command; the only behavior change is additional denials of root/home recursive-force wipes, which were already intended to be blocked, so no legitimate prior workflow is newly refused.
    • Existing tests (which suites passed on this head): On a clean detached worktree of 07848b291121716bcdcb2a1a94567d48fd2df1e7 I ran test_security.py, test_denied_commands_security.py, and test_security_gate_liveness.py with pytest: 2752 passed, 2 skipped. A wider set of security test files (api, authority, governance, hooks, root-parts, rule-seam, facade, posture, regex-linearity, pod-home-remap, mcp-cron) also passed: 875 passed. The formatting, lint, type, and line-budget gates pass on the changed files.
  • How to undo: Revert this pull request's single commit; rm_floor.py does not exist on the base branch, so reverting removes the entire new deny-net code path and restores the prior catalog rules, budget, and refusal note with no residual state.

@chenmingwei23

Copy link
Copy Markdown
Contributor Author

Thanks — both F1 and F2 from the prior review are fixed in 07848b291121716bcdcb2a1a94567d48fd2df1e7.

F1 (brace-expanded program word, rm_floor.py:3482). r{m,} -fr "$HOME" and r{m,} -fr ~ now deny. The program-word guard became brace-aware (_rm_program_word_is_rm): when the word is not already rm, it expands with the shared _brace_expansions and classifies rm iff the first expanded word basenames to rm — so r{m,} (→ rm r) is caught while {echo,rm} (→ runs echo, only prints rm) stays a mention. The same brace-aware resolution was applied to _rm_argv_programs so the ~/literal-home operand is attributed to rm, and { was added to the entry pre-check _RM_OBFUSCATION_MACHINERY_RE so the quote/$-free tilde spelling reaches classification at all.

F2 (repeated-star home glob, rm_floor.py:1226). rm -fr <home>/** now denies. _RM_HOME_ITSELF_TAIL_RE changed \* → \*+, matching its sibling _RM_ROOT_ITSELF_RE / _RM_HOME_ITSELF_RE.

Two regression tests were added that fail on the prior head and pass on this one; the controls (<home>/*, bare $HOME, a real descendant ~/.cache, {echo,rm} -fr ~) keep their prior verdicts.

The two new cases this review raised (rm -fr "$HOME">/dev/null, sh -c 'rm -fr "$1"' _ "$HOME") are real and are tracked for the single-rule redesign in #19291 (items 15–16) rather than patched here.

@chenmingwei23

Copy link
Copy Markdown
Contributor Author

Status at 07848b291121716bcdcb2a1a94567d48fd2df1e7

Fixed on this head: the brace-expanded program word (r{m,} -fr ~ / "$HOME", which bash runs as rm) and the repeated-star home glob (rm -fr ~/**) now deny, with regression tests. The Sensitive Change Review, Design, First Principles and Opus review lanes pass on this head.

Still open, tracked in #19291 (items 15–16):

  • rm -fr "$HOME">/dev/null — a redirect glued to the operand hides it from the matcher.
  • sh -c 'rm -fr "$1"' _ "$HOME" — the -c script and its positional arguments are read as separate argvs, so the bound home value is never classified.

Both let a recursive-force home delete through, and both also go through on the base branch (the floor module is new in this PR). They are the same "the floor reads one view of the argv while the shell runs another" shape that kept surfacing a new adjacent spelling each round, so rather than add more point patches they are deferred to the whole-rule redesign in #19291; the remaining gaps need that redesign before further patches.

(For reference, the broad backend-test / lint / coverage reds on this run are inherited from the base branch, not from this change.)

…llings, with a fail-closed regex deny-net

An argv-structural floor denies a recursive-force rm whose target resolves to the
filesystem root or the login home, in any flag spelling or ordering and through
$HOME/~/glob/brace spellings, as a UNION with the two catalog regexes that stay
in the re tier as a fail-closed deny-net.

The HOME-reassignment suppression (a persisted safe reassignment before the rm
redirects a later $HOME/~ to a throwaway dir, which base allowed) is bounded so
it never clears the deny on an UNCHANGED home:
- The assignment must be GUARANTEED to run — not on the right of a && / ||
  short-circuit, and not inside a double-quoted data-consumer string (a printed
  `echo "export HOME=…"` never runs).
- Its value must be demonstrably neither root nor home — a bare $VAR, a value a
  substitution builds (`$(printf '%s' "$HOME")` resolves to home itself), and a
  reassignment to / or a home spelling all keep the deny; only a concrete path
  component or a known throwaway generator ($(mktemp -d)) is safe.

An EXECUTED shell -c payload is run by a child shell that expands $HOME/~ by
spelling, so the payload tokens are classified directly, recursing through nested
payloads (`bash -c 'bash -c "rm -fr ~"'`). The verdict is platform-independent
(it does not depend on expanduser returning a /-rooted path, so a Windows drive
home no longer slips the deny), and the home counts only when the payload
performs a live home expansion in its OWN quote state.

An unquoted shell comment (`rm -rf dist # remove / later`) and a later command's
operands past this rm's own command boundary are not read as operands; the
substitution-operand resolver, the sh -c span scan, and the classified-frame
count are each bounded so a crafted opener/separator chain cannot stall the
synchronous gate within the floor.

Fixes #8237
Fixes #8387
@iamwhatever

Copy link
Copy Markdown
Contributor

Thank you for this work, @chenmingwei23. Both linked issues (#8237 and #8387) were fixed on main by #18415 (commit e15240c), which added src/kiro_crew/security/rm_floor.py to deny the -fr, -r -f, -R, --recursive --force and $HOME / ${HOME} spellings. Closing this PR as superseded. If it covers a bypass that #18415 still misses, please reopen and point to the case.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merge conflict Branch has merge conflicts with its base — author must resolve before merge

Projects

None yet

2 participants