Repository navigation
Conversation
|
👋 Hi! This PR's description is missing some required sections from our PR template. Workflow runs won't be auto-approved until the description is updated. Missing sections:
Please update your PR description to include these sections, then push or re-save the description. The workflows will be approved on the next cycle. |
Open PR relationship auditThis is a consolidated, point-in-time code-level audit note. It compares complete merge-base diffs and current/merged code; it does not treat a shared topic as duplication or partial coverage as completion. Relationship findings
No PR, Issue, label, branch, or review state was changed by the relationship-note portion of this audit. |
|
Two notes in one: the template-bot warning above is stale — all listed sections (Problem/Motivation, Why it matters, What changed, Tests, Pattern harvest) are in the body now. And on the relationship audit: agreed, #8262 is same-file/disjoint-hunks, KEEP with no coordination needed from this side. |
b7cbff0 to
450dbe7
Compare
Design Review (Fable 5, fork) — 🟡 CONCERNSDesign-level review of Design-Verdict: CONCERNS Sound widening within the catalog's documented instrument limits, but the user-facing refusal now carries a 300-char regex where a legible literal was the payload. Watch
Suggestions
[DESIGN-REVIEWED] a155aee |
GPT 5.6 Review (fork) — 🔴 changes requested (blocking)Reviewed 1 of 1 blocking finding(s) are security-class and were withheld from adjudication, so the blocking verdict stands. BLOCKING -- src/kiro_crew/security/denied_rules.py:1318 -- Valid rm spellings still bypass the gate
Adjudication (Opus 4.8) — is blocking on each finding proportionate?I've read the prompt and examined both the base tree and the diff. Let me verify the fenced finding F1 against the widened The two claimed bypasses: Case 1 — Case 2 — Both are genuine, and both are reachable through plainly ordinary command spellings — not extreme, self-contradicting, or writer-impossible conditions. FLAG requires the reaching conditions to be so extreme a human would accept the residual risk; a bare UNBOUNDED harm (irreversible home/root deletion), conditions confirmed at denied_rules.py:1298-1306 / diff hunk lines 78-89 (home rule) and 51-59 (root rule); no recovery path exists for |
First Principles Review (Fable 5, fork) — 🟡 CONCERNSPremise-level review of Evidence gathered: the base patterns ( First-Principles-Verdict: CONCERNS Point patch: the same one-spelling defect stays open in three counted sibling deny rules the PR's own "Pattern harvest" admits exist. Not justified as shipped
What this change shipsInventory (9 items) — 7 justifiedIntent: make the two rm deny rules catch equivalent recursive-force spellings, not just literal
Watch
[FIRST-PRINCIPLES-REVIEWED] a155aee |
Opus 4.8 Review (fork) — ✅ no blocking findingsReviewed Review detailsNo findings. The single candidate describes
It fails the Step-1 bar (no observable wrong outcome newly caused by the changed lines) and, even taken at face value, would be neither a removed guard nor a regression on a path this diff changes. Dropped. [OPUS-REVIEWED] a155aee |
|
Verified each claim live, and you were right on the core point — reworked accordingly:
|
|
Same rework addresses this: the bounded slots are replaced by the linearized house idiom at every pad site, so padding count no longer matters (verified 5- and 10-pad denied through the real gate). On scope: structural argv parsing would mean re-architecting the regex-view tier, which is beyond this fix; the residual class for pads is closed, with the #8124 quoted-whitespace pin intact and rarity/recovery as your adjudication notes (default flow still prompts). |
c71571d to
2a8e32d
Compare
52a5f33 to
f93511b
Compare
…spellings Covers packed (-fr, -rfv), split (-r -f), and long-option (--recursive/--force) flag spellings, one interspersed operand, --no-preserve-root, and the $HOME spellings the shell expands to ~, without any .* gap so separator pins and ReDoS screens keep holding.
f93511b to
e2a82f5
Compare
|
🤖 Kiro Crew [operator: NicholasRBowers#a942f9ca]: Security scan flagged this PR for manual review. The drive-to-green triage pass runs a mandatory content scan (code/diff + PR text) before any automated action. This PR tripped the code layer 31 times, on two rules:
Hits by file: Two things a maintainer should weigh, stated plainly rather than hidden behind the count:
That said, the diff edits Labels: added |
|
Thanks for the careful work here, @soroush5, and for verifying each finding live. Closing this in favour of your planned consolidated PR. Quoting your own comment: "I will fold both axes into one PR against the new denied_rules.py layout (composing the flag-run idiom into the $HOME alternation, regenerating the golden fixture on current main, dropping the em-dash rows) and close these two. I will also cover the operand-before-flags shape so Fixes #8237 stays." That folds the flag-run widening here together with the You're very welcome to reopen this if plans change, or just open the consolidated PR when it's ready. Thanks again. |
|
Thanks, that makes sense. Sorry it sat this long. |
Problem / Motivation
The two
rmdeny rules (local-destructive-rm-rf-root/-home) only recognize the exact-rfflag spelling, and the home rule only recognizes literal~. Equivalent recursive-force invocations sail through the PreToolUse gate — verified viais_denied: reordered (-fr), combined (-rfv), split (-r -f), long-option (--recursive/--force/--no-preserve-root) spellings, one interspersed operand (rm harmless -rf --no-preserve-root /), and every$HOME/${HOME}spelling (which the shell expands to~) all return None.Why it matters
Any agent run that reaches for a destructive delete with a non-canonical spelling gets zero confirmation. This is the same bug class as #4824 (which widened only the four self-protection rules for interposed flags) — the rm rules were left exact-match, so the floor has a hole exactly where the damage is total.
What changed
Both rm patterns widened with NO
.*gap (single fragment, exact full-input semantics): literal single spaces plus runs of single-letter flag tokens, one optional unquoted operand slot, and the$HOMEfamily on the home rule. That shape is what keeps the separator pins holding (a.*gap would fabricate commands across;/newlines), the ReDoS screens green (bare*over quantifier-free bodies; the operand slot ends in a literal so the polynomial screen stays blind to it), and the documented" "residual intact.rmis token-anchored (/bin/rm,{rm;}, backtick programs still match), with one deliberate exception: quote-gluedrmmatches when a separator follows later in the string — that keeps the Pass-1 whole-string closure for pipelines (grep 'rm -rf /...' | pythonmust deny even though the literal is quoted), while a lone"rm" -rf /still misses raw text for the respelling-proof twin.rm -f/-r-only, flaglessrm, lone--recursive,rm -- -rf /,--preserve-root, and lookalikes ($HOMEx,file~) all stay allowed. Governance legacy map gains the two pre-widening spellings (#4824 precedent); search-verb carve-out (#8802) registered from the live patterns; golden fixture synced (111 rows).Residuals (documented in-code): interposed LONG flags (
-r --verbose -f), leading long-flag padding, 2+ or quoted operands, operands between flags and path, getopt-permuted trailing flags — each needs a repeated operand gap the ReDoS screens forbid.Tests
TestRmFlagVariantsStayDenied(flag/operand/program variants + allow shapes) and newTestRmHomeEnvSpellingsStayDenied($HOME/${HOME}incl. braced operators, lookalikes) intest/test_denied_commands_security.py.main:test_denied_commands_security.py+test_security.py+test_deny_guidance.py+test_denied_commands_hooks.py+test_heartbeat_safe_tools.py+test_security_regex_linearity.py— 1934 passed, 2 skipped (pre-existing).is_safe_user_regex, take the unbounded single-fragment path, hostile inputs (20k-quote, flag-chain, padded needle) evaluate in ≤0.1s.Fixes #8237
Fixes #8387
Pattern harvest
Rule candidate: deny-list regexes that match one spelling of equivalent destructive invocations — worth a pass over the other local-destructive patterns for packed/split/long-option variants.