Skip to content

fix(security): read backtick bodies and glued redirects in the rm floor - #23292

Merged
bolichen97 merged 1 commit into
mainfrom
fix/rm-floor-quoting
Oct 23, 2026
Merged

bolichen97 merged 1 commit into
mainfrom
fix/rm-floor-quoting

Conversation

@JLargent42

Copy link
Copy Markdown
Contributor

Problem / Motivation

Goal: The recursive-force rm floor reads a command substitution written with backticks inside double quotes, and a redirection glued to an operand, the same way it reads their other spellings; when it cannot read a command, it refuses only one that names rm as a word.

Follow-up to #18415. Three behaviors of rm_floor, checked through is_denied on main:

  • A backtick command substitution inside double quotes was not read, while the $(…) form in the same position was.
  • A redirection written without a space after an operand (/>/dev/null) was read as part of that operand, so the operand no longer matched root or home.
  • When the floor's walker raised, every command the cheap r…m pre-check matched was refused. That pre-check also matches the letters inside words like format, so git log --format=$x would have been refused on that path.

Why it matters

The floor exists to refuse recursive-force removal of / and ~ in its common spellings. Two spellings of the same command were read differently from their equivalents, and the error path refused ordinary commands that have nothing to do with rm.

Not a goal

  • Wrappers (sudo, env), bash -c payloads, heredocs, arrays and parameter-expansion defaults. These stay out of scope for this floor, as the spec already says; the catalog rows and the OS sandbox cover them.
  • Changing which targets count as root or home, or which flags count as recursive and force.
  • The shared shell-normalizer layer the other argv floors read (shell-normalizer shared gaps #21345). This change touches only rm_floor.py and its call site.

What changed (motivation → approach → change)

The floor's segment walk handled $(…) inside double quotes but not backticks, and it treated < / > as ordinary word characters. Its error path keyed on a pre-check that matches rm anywhere in the text.

Behavior Now
Backtick body inside double quotes read as its own segment, like $(…), then the double quote resumes
Live < or > starts a new word, so a redirection target is never an rm operand
Walker error refuses only when rm appears as a word of its own (_names_rm_word: a path prefix and quote splices allowed, checked on the raw text and with ${X:-…} defaults resolved); other commands pass

The change is in src/kiro_crew/security/rm_floor.py and its error branch in src/kiro_crew/security/deny_gate.py. The security spec's Recursive-force rm floor paragraph now describes the backtick and redirection reads and the error path, and no longer lists glued redirections as out of scope.

Backwards compatibility

Compatible: the floor denies the same targets with the same flags. It now reads two more spellings of a command it already refuses, and its error path refuses fewer unrelated commands.

Removes nothing: no rule, row or allowed command is removed. The error path refusing fewer commands narrows a fail-closed path, which no caller depends on to refuse a non-rm command.

Tests

In test/test_denied_commands_security_rows.py::TestRecursiveForceRmFloor:

  • denied: a backtick body in double quotes (echo "\rm -fr ~`", with text before it), and an operand with a glued >or<` redirection, for both root and home.
  • allowed: a backtick body in double quotes that holds no rm, followed by quoted text naming the command; a backtick inside single quotes; a glued redirection after a non-root operand.
  • with the walker forced to raise: /bin/rm -fr / and the ${X:-rm} / ${X-rm} parameter-default spellings are still refused, and git log --format=$x, make format, docker run --rm and a --platform flag pass.

Nine of these cases are red on main and green with the fix. test/test_security_gate_liveness.py: the package line budget is raised by 27 lines with its reason recorded beside it.

Determinism: the class passed 20× at -n0, 10× at -n 4 --dist loadgroup --max-worker-restart=2 alongside test_denied_commands_hooks.py and test_denied_commands_security_quoting.py, and once in a seeded shuffle (seed 816, 57 ids).

Manual verification

N/A — unit coverage sufficient: every changed path is reached through is_denied, the same entry point the tool-call gate uses.

Related Issues

Closes #21365

Sibling sweep

Swept: git grep -nE "_segments(|_rm_wipe_targets|_can_fire" -- src/
Sibling: src/kiro_crew/security/rm_floor.py -- changed here
Sibling: src/kiro_crew/security/deny_gate.py -- changed here
Sibling: src/kiro_crew/security/shell_normalizer.py -- tracked in #21345

Pattern harvest

Not generalizable: the backtick and redirection reads mirror an existing $(…) branch in this one floor's own segment walk; the shared walker that other floors use is tracked separately in #21345.

Checklist

  • At most two commits (one is the norm), with a Conventional Commits title (feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)
  • Existing tests pass and new tests added for new functionality
  • Self-review completed; code follows project style guidelines
  • Documentation updated (if applicable)
  • No secrets, credentials, or internal references in the diff

@JLargent42

Copy link
Copy Markdown
Contributor Author

Local pre-push review (hand-written charters; the brief extractor reported a parity failure, so this is approximate to CI).

  • GPT charter: PASS.
  • Opus charter, blocking: on the floor-error path, the word check did not see rm written as a parameter default (${X:-rm}), which the walker itself resolves. fixed in 40e4ed3: _names_rm_word checks the raw text and the text with ${X:-…} defaults resolved; tests cover ${X:-rm} -fr / and "${X-rm}" -fr ~, and docker run --rm still passes.

@github-actions

github-actions Bot commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor

Sensitive Change Review

Sensitive files changed:

  • src/kiro_crew/security/deny_gate.py

  • src/kiro_crew/security/rm_floor.py

  • @JLargent42 posted a complete reasoning template for ac702f0.

@github-actions github-actions Bot added the readiness: checking Automated validation is still running label Oct 23, 2026
@github-actions

github-actions Bot commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor

UX Review (Opus 5.5) — ⏭️ skipped

Revision ac702f031642c70a90d2bb1940619420ef175eb0 touches no user-facing surface (no changes under website/ or committed screenshots), so the UX review was skipped. Does not block merge.

@github-actions

github-actions Bot commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor

Design Review (Opus 5.5) — ✅ PASS

Design-level review of ac702f031642c70a90d2bb1940619420ef175eb0 — updated in place on each push. A BLOCK verdict blocks PR readiness; PASS does not.

Design-Verdict: PASS

Nothing blocks: the change stays inside the rm floor's segment walk, and the error path still refuses any command that names rm as a word. The gaps below are wording, not design.

Notes

  • The description and the spec don't mention one behaviour the diff adds: a leading redirection (2>/dev/null rm -rf /, {fd}>x, 2>&1) is now skipped before the program word, using _push_token_redirection. The new tests pin it. Add it to the description and to the spec's Recursive-force rm floor paragraph.
  • The description says the line budget rose by 27 lines. The diff raises it by 71 (32_447 → 32_518). Correct the number.

[DESIGN-REVIEWED] ac702f0

Description read

[DESCRIPTION-READ] b1ed2bb24fa8729b3090b350e4a6b7d38016095019eac56237216e40d2498d08

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 Oct 23, 2026 •

Copy link
Copy Markdown
Contributor

First Principles Review (Opus 5.5) — ✅ PASS

Premise-level review of ac702f031642c70a90d2bb1940619420ef175eb0 — 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 does not.

First-Principles-Verdict: PASS

Each item is aimed at a reported mechanism (#21365) and reuses the shared shell helpers. One undeclared rider is needed: without it, splitting glued redirections would let X=1>/dev/null rm -fr / through.

Notes

  • Item 3 — oversized: rm_floor.py now holds two "r…m" recognizers, _CAN_FIRE_RE and the new _RM_WORD_RE. The floor-error path asks the same question as the pre-check, whether this command names rm. Subtraction: delete _CAN_FIRE_RE and gate _can_fire on _names_rm_word, so one recognizer decides both when the floor runs and when its error path refuses.

What this change ships

Inventory (5 items) — 5 justified

Intent: stop the rm -rf //~ floor from missing two respellings, and stop its error path from refusing commands that only contain the letters r…m. This is a FIX.

  1. A backtick body inside double quotes is read as its own command — justified
  2. A glued </> redirection is split off its operand, so rm -fr />/dev/null is refused — justified
  3. When the floor cannot read a command, it refuses only commands that name rm as a word; make format and --format= now pass — justified
  4. A leading redirection (2>, {fd}>, >>, 2>&1, a spaced target) is skipped before the program word is read — undeclared
  5. Test-liveness package line budget raised by 71 lines (32,447 → 32,518; the description says 27) — justified

[FIRST-PRINCIPLES-REVIEWED] ac702f0

Description read

[DESCRIPTION-READ] 575ee9c2cff62279afc4311aedf13a1462869a5b61e307081f3a720558efd1bd

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.

@JLargent42

Copy link
Copy Markdown
Contributor Author

Sensitive change review

  • Head commit: 40e4ed3
  • What rule changed: the recursive-force rm floor (security/rm_floor.py, called from security/deny_gate.py) behind the two local-destructive-rm-rf-* rows.
  • Before -> after (what was allowed/blocked, now): a recursive-force rm of / or ~ written as a backtick body inside double quotes, or with a redirection glued to the operand, was allowed and is now refused, matching the $(…) and spaced spellings already refused. When the floor cannot read a command, it now refuses only one that names rm as a word (raw text or with ${X:-…} defaults resolved); before, it refused any command whose text held the letters r…m anywhere (e.g. git log --format=$x).
  • Worst case if wrong (breaks commands / leaks secret / locks user out): breaks commands. A backtick or </> read too broadly could refuse an ordinary command; the error-path narrowing could let one unreadable rm spelling through, which the catalog rows and OS sandbox still cover. No secret or lockout path is touched.
  • Evidence checked (which sandbox result proves it): is_denied through TestRecursiveForceRmFloor in test/test_denied_commands_security_rows.py: the new deny cases (backtick body, glued > and <, root and home) and allow cases (backtick body with no rm, backtick in single quotes, glued redirect after a non-root operand); with the walker forced to raise, /bin/rm, ${X:-rm} and "${X-rm}" are still refused and --format, make format, docker run --rm pass. The new cases are red with the source reverted.
  • No regression:
    • Tools still work (which tools/commands were run, result): the full denied-commands, security, quoting and argv-floor suites: 7651 passed, 2 skipped; flake-pattern ratchet 60 passed.
    • Backward compatible (old config / old data / old callers still work, how checked): no config, row or API changes; a disabled row still disables its floor (test_a_disabled_row_disables_its_floor); every pre-existing allow and deny case in the class still passes.
    • Existing tests (which suites passed on this head): test_denied_commands_hooks.py, test_denied_commands_security_quoting.py, test_denied_commands_security_rows.py, test_security.py, test_security_gate_liveness.py and the test_denied* / test_deny* / test_argv_floor* / test_shell_normalizer* / test_security_* suites, plus the scoped backend test gate with no new failures against main; lint, mypy and semgrep clean.
  • How to undo: revert this one commit; no data or config migration.

@github-actions

github-actions Bot commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor

Opus 5.5 Review — ✅ no blocking findings

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

Review details

No findings.

[OPUS-REVIEWED] ac702f0

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

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

@github-actions

github-actions Bot commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor

GPT 6.1 Review — ✅ no blocking findings

GPT 6.1 completed its review of ac702f031642c70a90d2bb1940619420ef175eb0 and found no blocking issues.

This comment is updated in place on each push.

Review details

No findings.
[GPT-REVIEWED] ac702f0

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

@github-actions

github-actions Bot commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor

Security Scope Review -- ✅ PASS

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

Verdict basis: adjudicated, zero confirmed regressions.

Security scope review -- adjudicated candidates

  • macos-latest (platform posix): 15 classified, 0 newly refused, 13 still allowed.
  • ubuntu-latest (platform posix): 15 classified, 0 newly refused, 13 still allowed.
  • windows-latest (platform windows): 5 classified, 0 newly refused, 4 still allowed.

No candidate flipped from allowed to refused.

Scope-Verdict: PASS

Reason: This change tightens only the shell-command rm floor, which runs inside the deny-rules tier, so the classifier can rule on all of it. No adjudicated result was handed to me in this run, so no regression is confirmed. The one place the change loosens anything (the floor-error path gated on _names_rm_word) goes in the permissive direction and is outside this lane.

TIGHTENING: rm_floor._segments and _rm_wipe_targets now read a backtick body inside double quotes, split a live </> redirection into its own word, and step over leading redirections the way they step over VAR=val. The ONE threat it refuses: a recursive-force wipe of root or home hidden behind a redirection or a double-quoted backtick. Quoting the hunks: if step.state == 2 and step.char == "" and len(step.text) == 1: # a backtick body in double quotes is read on its own, then seg.append(" " + _pull_trailing_fd_prefix(seg) + step.text), and is_redirection, consumes_next = _shell._push_token_redirection(words[0])(tests:"RM -fr />/dev/null", "2>/dev/null RM -r -f /", 'echo "RM -fr ~"'`).

ADJUDICATED: 20 candidates, 0 confirmed newly-refused

PLATFORM COVERAGE:

  • posix (15 rows): the diff assumes POSIX redirection syntax (2>, {fd}>, >>, 2>&1, &>) and POSIX double-quoted backtick substitution. The rows cover:
    • redirections glued to an operand and spaced after it, on repo, /tmp and home descendants;
    • the fd-dup & next to a real background & and a pipe;
    • leading redirections before rm and before a non-rm program;
    • exec 2>/dev/null followed by a separate segment;
    • backtick bodies in double quotes, both escaped and executed.
  • windows (5 rows):
    • Git Bash /c/... drive spelling with 2>/dev/null;
    • drive-letter backslash rm with 2>NUL;
    • PowerShell rm -Recurse -Force ... 2>$null;
    • cmd rd /s /q ... >nul 2>&1;
    • a PowerShell string using the backtick as its escape character ("Cleaning`n") followed by rm. The new backtick reader assumes POSIX meaning for that character, and this row probes it.
  • any: no rows. Every candidate carries a path, separator or shell-specific redirection spelling.
  • Not probed: Windows UNC operands (\\server\share\...). The floor only checks root and home operands, so a UNC row could not reach the new code differently from the drive-letter rows.

[SCOPE-REVIEWED] ac702f0

@JLargent42

Copy link
Copy Markdown
Contributor Author

CI note for head 40e4ed3: Backend Tests (Windows) (2) failed in test_slot_list_rebuild.py::TestPartialDeadline::test_deadline_retries_after_dropped_tab_construction_ends, the open flake #23289; this PR changes only security/rm_floor.py and security/deny_gate.py. Recorded on #23289; the shard gets one re-run when the run completes.

@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 Oct 23, 2026
@github-actions github-actions Bot added the merge conflict Branch has merge conflicts with its base — author must resolve before merge label Oct 23, 2026
@JLargent42
JLargent42 force-pushed the fix/rm-floor-quoting branch from 40e4ed3 to 84d08f7 Compare October 23, 2026 06:53
@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 Oct 23, 2026
@JLargent42

Copy link
Copy Markdown
Contributor Author

Rebased once onto main for the #23264 Windows fix.

@github-actions github-actions Bot removed the merge conflict Branch has merge conflicts with its base — author must resolve before merge label Oct 23, 2026
@JLargent42
JLargent42 force-pushed the fix/rm-floor-quoting branch from 84d08f7 to 8d1d739 Compare October 23, 2026 07:07
@JLargent42

Copy link
Copy Markdown
Contributor Author

Sensitive change review

  • Head commit: 8d1d739
  • What rule changed: the recursive-force destructive-dir argv floor (security/rm_floor.py), behind local-destructive-rm-rf-root / -home, plus a one-line budget entry in test/test_security_gate_liveness.py. deny_gate.py is unchanged on this head beyond the rebase.
  • Before -> after (what was allowed/blocked, now): the floor now reads two more spellings of a wipe it already refuses — a backtick substitution body nested inside double quotes, and a redirection token glued directly to an operand word — and its fail-closed floor-error path now refuses only commands that name the remove program as a word of their own, so ordinary programs whose text merely contains those two letters (a format subcommand, a container run with the throwaway flag, a log format option) are no longer refused on a walker error, while path-qualified and parameter-default spellings of the remove program still are. No other command changes verdict.
  • Worst case if wrong (breaks commands / leaks secret / locks user out): a too-broad read could refuse a benign recursive remove of a descendant directory; the floor only ever refuses an operand that resolves to exactly the filesystem root or the home directory itself (optionally with a trailing slash or glob), so any descendant path stays allowed, and every other program is untouched. No secret or lockout path is involved.
  • Evidence checked (which sandbox result proves it): the Security Scope Review adjudicated 23 candidates across posix/windows with 0 confirmed newly-refused; the row tests and floor tests through the deny entry point; 14474 related tests pass including the facade mirror guards.
  • No regression:
    • Tools still work (which tools/commands were run, result): the related security + facade suites: 14474 passed, 40 skipped, 0 failed.
    • Backward compatible (old config / old data / old callers still work, how checked): no rule rows, config keys or public functions removed; the floor-error narrowing only removes over-refusals; facade mirror guards pass.
    • Existing tests (which suites passed on this head): the suites above; flake8, isort, black, mypy, docs-lint, comment-history and diff-scoped semgrep all clean.
  • How to undo: revert this one commit; no data or config migration.

@JLargent42

Copy link
Copy Markdown
Contributor Author

Applied the subtraction from the First Principles BLOCK on 84d08f73306e:

  • span=rm_floor duplicate backtick scanner — deleted the local _backtick_close helper and switched the double-quoted backtick-body branch to call the shared _shell._backtick_closer(text, step.offset + 1), mapping its -1 (no closer) to len(text) and taking the body end as closer + 1. The shared scanner is the one the two existing closers are kept beside, so there is now a single source of truth and no second copy to drift.

self-added: yes — this is my own change in response to the finding.
mechanism: one call site now reuses the shared helper; the local copy is removed. Behaviour is unchanged (same body span, same quote resume), verified by the row/floor tests through the deny entry point and the facade mirror guards.

Fixed in head 8d1d7393a27c21e408d164cbeb4723c5df63dcb2; the lane re-runs there.

@JLargent42
JLargent42 force-pushed the fix/rm-floor-quoting branch from 8d1d739 to e861cc6 Compare October 23, 2026 07:41
@JLargent42

Copy link
Copy Markdown
Contributor Author

Fixed the blocking regression Opus flagged on 8d1d7393a2.

  • span=rm_floor leading-redirection hides the program word — because a live redirection now starts its own word in the segment, a redirection appearing before the program (optionally alongside a VAR=val assignment) left a redirection token as the first word, so the program-basename check read the redirection instead of the remove program and the floor stopped refusing a recursive-force wipe of root or home that base refuses.

self-added: yes — this regression was introduced by this PR’s redirection-split and is my own to fix.
mechanism: the program-word scan in _rm_wipe_targets now steps over a leading redirection word (and its separate target when the target is not glued on) the same way it already steps over a leading assignment, via _LEADING_REDIRECT_RE. The program word is then read correctly and the wipe is refused again. Regression cases for the assignment+redirect prefix shapes are added to TestRecursiveForceRmFloor (both the refuse list and the allow list), and the Security Scope / row suites pass.

Fixed in head e861cc6da4fa29ee5331a9fb0f14ed204b10d4ea; the lane re-runs there.

@github-actions github-actions Bot removed the readiness: checking Automated validation is still running label Oct 23, 2026
@JLargent42

Copy link
Copy Markdown
Contributor Author

Rebased onto fresh main (which picked up a security gate) to clear a DIRTY merge conflict; resolved the package-line-budget comment to keep both the new entry and this PR's, budget recomputed to 32_509. New head e25cbf0, no behaviour change.

@JLargent42

Copy link
Copy Markdown
Contributor Author

Sensitive change review

  • Head commit: e25cbf0
  • What rule changed: the recursive-force destructive-dir argv floor (security/rm_floor.py), behind local-destructive-rm-rf-root / -home, plus its budget entry and regression cases. This push is a rebase onto fresh main (which merged an unrelated security gate) to clear a DIRTY conflict; no behaviour change versus the prior head.
  • Before -> after (what was allowed/blocked, now): unchanged from the prior reviewed head. The floor reads a backtick substitution body nested inside double quotes and a redirection token glued to an operand, its fail-closed error path refuses only commands that name the remove program as a word, and a leading redirection before the program (fd-numbered, {fd}, two-character, fd-dup, or spaced target) is stepped over whole so a recursive-force wipe of the filesystem root or home behind it is refused. A path digit (/tmp/2>x) is not treated as an fd prefix. No other command changes verdict.
  • Worst case if wrong (breaks commands / leaks secret / locks user out): unchanged; the floor only ever refuses an operand resolving to exactly the root or home directory, descendants stay allowed, no secret or lockout path is involved.
  • Evidence checked (which sandbox result proves it): TestRecursiveForceRmFloor (the leading-redirect wipe cases denied, path/descendant controls allowed) and the row/floor suites through the deny entry point; 14632 related tests plus the facade mirror guards pass on the rebased head; full-tree flake8/isort/black/mypy clean.
  • No regression:
    • Tools still work (which tools/commands were run, result): the related security + facade suites: 14632 passed, 40 skipped, 0 failed.
    • Backward compatible (old config / old data / old callers still work, how checked): no rule rows, config keys or public functions removed; facade mirror guards pass; the rebase only re-applied the same one commit on fresh main.
    • Existing tests (which suites passed on this head): the suites above; flake8, isort, black, mypy, docs-lint, comment-history and diff-scoped semgrep all clean. (Windows legs 1/3/4 fail with ValueError: Paths dont have the same drive / bash-on-Windows in workspace-file and proof-line tests — a Windows-runner infra issue unrelated to this Python-only change.)
  • How to undo: revert this one commit; no data or config migration.

@github-actions github-actions Bot added readiness: checking Automated validation is still running readiness: action required A blocking check or review needs attention merge conflict Branch has merge conflicts with its base — author must resolve before merge and removed readiness: action required A blocking check or review needs attention merge conflict Branch has merge conflicts with its base — author must resolve before merge readiness: checking Automated validation is still running labels Oct 23, 2026
@JLargent42
JLargent42 force-pushed the fix/rm-floor-quoting branch from e25cbf0 to ac702f0 Compare October 23, 2026 16:24
@JLargent42

Copy link
Copy Markdown
Contributor Author

Rebased onto fresh main to clear a DIRTY merge conflict; resolved the package-line-budget comment to keep both the new entry and this PR's, budget recomputed to 32_518. New head ac702f0, no behaviour change.

@JLargent42

Copy link
Copy Markdown
Contributor Author

Sensitive change review

  • Head commit: ac702f0
  • What rule changed: the recursive-force destructive-dir argv floor (security/rm_floor.py), behind local-destructive-rm-rf-root / -home, plus its budget entry and regression cases. This push is a currency rebase onto fresh main to clear a DIRTY conflict; no behaviour change versus the prior reviewed head.
  • Before -> after (what was allowed/blocked, now): unchanged from the prior reviewed head. The floor reads a backtick substitution body nested inside double quotes and a redirection token glued to an operand; its fail-closed error path refuses only commands that name the remove program as a word; a leading redirection before the program (fd-numbered, {fd}, two-character, fd-dup, spaced target) is stepped over whole so a recursive-force wipe of the filesystem root or home behind it is refused; a path digit is not treated as an fd prefix. No other command changes verdict.
  • Worst case if wrong (breaks commands / leaks secret / locks user out): unchanged; the floor only ever refuses an operand resolving to exactly the root or home directory, descendants stay allowed, no secret or lockout path is involved.
  • Evidence checked (which sandbox result proves it): TestRecursiveForceRmFloor and the row/floor suites through the deny entry point; 14632 related tests plus the facade mirror guards pass on the rebased head; full-tree flake8/isort/black/mypy clean.
  • No regression:
    • Tools still work (which tools/commands were run, result): the related security + facade suites: 14632 passed, 40 skipped, 0 failed.
    • Backward compatible (old config / old data / old callers still work, how checked): no rule rows, config keys or public functions removed; facade mirror guards pass; the rebase re-applied the same one commit on fresh main.
    • Existing tests (which suites passed on this head): the suites above; flake8, isort, black, mypy, docs-lint, comment-history and diff-scoped semgrep all clean. (Windows legs 1/3/4 fail with ValueError: Paths dont have the same drive / bash-on-Windows in workspace-file and proof-line tests — a Windows-runner infra issue unrelated to this Python-only change.)
  • How to undo: revert this one commit; no data or config migration.

@github-actions github-actions Bot added readiness: checking Automated validation is still running readiness: passed Eligible automated validation passed for the current revision and removed merge conflict Branch has merge conflicts with its base — author must resolve before merge readiness: action required A blocking check or review needs attention readiness: checking Automated validation is still running labels Oct 23, 2026
@bolichen97
bolichen97 enabled auto-merge (squash) October 23, 2026 20:07

@bolichen97 bolichen97 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed current head ac702f031642c70a90d2bb1940619420ef175eb0 as Tier 2. Deep review found no blocking issue.

Security check: the destructive-command floor now reads backticks and glued redirects. Parser failures still deny independent rm commands. Non-command text remains allowed. Auto-merge remains subject to branch protection.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

rm floor: backtick in quotes, glued redirect, and fail-closed reach

2 participants