fix(security): cover HOME env spellings in the rm-rf-home deny rule - #8388
fix(security): cover HOME env spellings in the rm-rf-home deny rule#8388soroush5 wants to merge 1 commit into
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. |
2 similar comments
|
👋 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. |
|
👋 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. |
Design Review (Fable 5, fork) — ✅ PASSDesign-level review of The design checks out: the exception carve-out ( Design-Verdict: PASS Real bypass on the agent-untrusted boundary, closed at the right layer, with the exception path provably failing closed and persisted pins migrated. Suggestions
[DESIGN-REVIEWED] e7fb431 |
Opus 4.8 Review (fork) — ✅ no blocking findingsReviewed Review detailsWidened home-deletion deny rule still misses FINDING — src/kiro_crew/security.py:1282 — the new braced branch [OPUS-REVIEWED] e7fb431 |
First Principles Review (Fable 5, fork) — 🟡 CONCERNSPremise-level review of All checks are done. The mechanisms are verified: the legacy-pin alias follows the documented upgrade-monotonicity mechanism in base (security.py:1775-1785), the sensitive tier's First-Principles-Verdict: CONCERNS The fix is aimed at the real cause; four unrelated em-dash re-encodings ride along in the golden fixture, and a now-dead exception key stays behind. What this change shipsIntent: stop shell-equivalent
Watch
Subtractions
[FIRST-PRINCIPLES-REVIEWED] e7fb431 |
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.py:1284 -- Non-colon HOME expansions bypass the deny rule Adjudication (Opus 4.8) — is blocking on each finding proportionate?The adjudicable block is empty (0 findings). One fenced finding, F1. F1 — The new pattern's brace branch is |
|
On the FP CONCERNS: verified the sibling claim — |
|
The template warnings above are stale — the body has carried all required sections (plus Pattern harvest) since the update. No workflow action needed from my side beyond what is already there. |
bbe7cfb to
83512f4
Compare
|
Confirmed live ( |
1777e01 to
e7fb431
Compare
Problem / Motivation
The
rm -rf ~deny rule only recognized the tilde spelling, so the equivalent$HOME/${HOME}spellings (quoted or not — double quotes still expand) sailed through the deny gate (the sensitive tier never anchored bare home for~either, so only the deny gate changes here). Verified:rm -rf $HOME,rm -rf ${HOME}, andrm -rf "$HOME"all return "allow" whilerm -rf ~is denied.Why it matters
The shell expands these spellings to the exact path the rule exists to protect, so a destructive home deletion runs with no policy trip. Same severity class as the
~case already blocked.What changed (motivation → approach → change)
Symptom → shell-equivalent spellings bypass the home rule. Cause → the operand tail anchors at
~.*only. Change → the tail now accepts~,$HOME, and${HOME}with an optional double quote (single-quoted forms stay allowed since no expansion happens there). Also added a legacy pin alias so persistedrm -rf ~.*pins keep resolving. Kept to the operand tail only so this rebases cleanly with #8240.Tests
New
TestRmHomeEnvSpellingsStayDenied(red without the fix, green with it), golden/catalog parity green, neighbor rm/catalog/ReDoS suites green (393 passed).Manual verification
N/A — unit coverage sufficient (gate-level probes for all spellings plus lookalikes).
Fixes #8387
Pattern harvest
Rule candidate: home-directory operands need shell-equivalent-spelling coverage (
~,$HOME,${HOME}) — blocking one spelling while the shell expands the others leaves the same hole, as with flag respellings in #8240.