Skip to content

fix: explain a data home another account owns, and refuse root mcp starts - #33028

Merged
KiroCrewCaptain merged 1 commit into
mainfrom
crew/slack/data-home-fd-repair
Nov 8, 2026
Merged

KiroCrewCaptain merged 1 commit into
mainfrom
crew/slack/data-home-fd-repair

Conversation

@buluoray

@buluoray buluoray commented Nov 8, 2026 •

Copy link
Copy Markdown
Contributor

Problem / Motivation

Goal: The data home repair can no longer be tricked into giving a system file to the person's account, and a root-started Kiro Crew MCP server no longer writes into the person's data home.

Review of the 0.12 backport (#33006) found two holes in the data home ownership work on main:

  • Hard-link swap in the repair. The repair line sudo find ... -links 1 ... -execdir chown -h checks the link count while it walks and changes the owner later, by name. Something that can write the data home (an agent) can swap a checked file for a hard link to /etc/sudoers in that gap, and root then re-owns the system file. Linux blocks that link by default (fs.protected_hardlinks); macOS does not.
  • Root MCP start skips the refusal. cli.main refuses a root run aimed at a person's data home, but the gateway's own kirocrew mcp-* servers start through mcp_entry.slim_server, which never asks. An ACP host run as root with the person's HOME still gets root-owned files written into ~/.kiro/crew.

Why it matters

The repair line runs with sudo because we tell the person to run it, so a gap there is a privilege escalation: an agent with write access to its own data home could take ownership of a root-owned system file, and nothing changes it back. The MCP start gap leaves the exact damage #31602 exists to prevent.

Not a goal

  • Changing which entries check_data_home checks, or the root-run refusal itself.
  • Any automatic re-own of the files, by Kiro Crew or by a command it hands out (maintainer decision, see the PR comment).

What changed (motivation → approach → change)

Kiro Crew no longer offers a repair line. Three review rounds found a new way to point the root repair at a file outside the data home each time, so the repair is removed and the person is told what is wrong instead.

Surface Before Now
Gateway log, kirocrew doctor the files, then a sudo ... line to run the folder, the owner, "probably started as root once", "stop running it as root", and a docs link
Settings, New Bot dialog a sentence and a command to copy the same plain-words notice with a "How to give the files back" link; no command
/api/status data_home_access, 409 data_home_not_owned fix_command owner and help_url (home and foreign stay)
Root MCP start mcp_entry.slim_server never asked root_run_refusal asks at the same step as cli.main; a refusal hands over to the full CLI, which prints it

The docs link goes to a new "Kiro Crew files belong to another account" section in src/kiro_crew/docs/troubleshooting.md. It explains the cause and, as the person's own step with Kiro Crew and every agent stopped, on the folder the notice names: first check that sudo find -P <folder> -xdev -type f -links +1 prints nothing (it only lists, and runs as root so it can see into folders the root run left unreadable) (a hard link planted earlier survives the stop), then run a filtered sudo find -P ... -xdev ! -user ... \( -type d -o -links 1 \) -execdir chown -h ... {} \;, then chmod -R u+rwX <folder> as their own account without sudo. The chmod step replaces the && chmod -R u+rwX <home> tail of the removed repair line, and on its own fixes the "can't be used by this account" case (files already theirs, only permissions wrong). The strings are translated in all 12 locales. docs/system-specs/modules/cli.md and crew-mode.md describe the new behaviour.

Backwards compatibility

Compatible: the refusal, the checked entries and the 409 code are unchanged; only the help that comes with them changes, and no release has shipped fix_command yet.

Reader: src/kiro_crew/doctor_checks/install.py:_doctor_data_home_owner -- release -- prints owner and docs link; test_doctor_reports_the_files_owner_and_docs
Reader: src/kiro_crew/data_home_owner.py:warn_if_data_home_not_owned -- release -- logs explain(); test_the_gateway_warning_is_the_explanation
Reader: src/kiro_crew/dashboard/agent_admin/crew_records.py:_api_kirocrew_agents_create (409 body) -- crew page -- sends home, owner, help_url; test_creation_refuses_a_data_home_another_account_owns
Reader: website/src/components/DataHomeOwnerNotice.tsx:DataHomeOwnerStatusNotice -- crew page -- reads owner and help_url; DataHomeOwnerNotice.test.tsx
Reader: website/src/pages/members/NewCrewmateDialog.tsx:409 branch -- crew page -- reads home, owner, help_url; MembersPage.newCrewmateOutcomes.test.tsx

Tests

Proof: not provable -- other: the fix removes the repair line instead of changing it, so there is no production hunk whose revert a changed test would catch

  • test_data_home_owner.py: the explanation names folder, owner, cause and docs and holds no chown or sudo; the docs anchor exists in troubleshooting.md; the owner is reported; the race tests for the removed script are gone; the refusal tests stay.
  • test_mcp_slim_entry.py: a refused root run returns before project detection or ensure_data_home; the slim/CLI parity test spies the refusal step on both paths.
  • Frontend: DataHomeOwnerNotice.test.tsx and MembersPage.newCrewmateOutcomes.test.tsx pin the folder/owner sentence, the docs link and that no command is shown.

Ran: the related backend files plus the flake-pattern ratchet gave 471 passed (the 13 subprocess tests in test_mcp_slim_entry.py need yaml, missing on this host). Frontend: tsc, i18n:check and 79 vitest files (1271 tests, the i18n suite included) passed.

Manual verification

Ran an isolated gateway from this worktree on a throwaway data home whose members/ this account cannot write, and looked at Settings and the New Bot dialog in a headless browser. Both show the notice below.

Screenshots / video

Settings, above every tab:

Settings data home owner notice

New Bot dialog after Create is refused:

New Bot dialog data home owner notice

Related Issues

Raised in review of #33006 (the 0.12 backport of #31602 and #32944).

Sibling sweep

Swept: git grep -n "root_run_refusal|ensure_data_home()" -- src/kiro_crew/mcp_entry.py src/kiro_crew/_bootstrap.py src/kiro_crew/cli.py
Sibling: src/kiro_crew/mcp_entry.py:136 -- changed here
Sibling: src/kiro_crew/cli.py:648 -- not affected -- the full CLI already refuses before project detection

Pattern harvest

Rule candidate: review-prompt
Pattern: a copyable privileged command that changes files inside a folder a less-privileged process can write; prefer explaining the problem and leaving the privileged step to the person

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

Contribution License Agreement

Contributed under the project's Apache-2.0 license.

@buluoray
buluoray requested review from a team and KiroCrewCaptain as code owners November 8, 2026 08:12
@buluoray
buluoray requested a review from Zedmor November 8, 2026 08:12
@github-actions github-actions Bot added the readiness: checking Automated validation is still running label Nov 8, 2026
@github-actions

github-actions Bot commented Nov 8, 2026 •

Copy link
Copy Markdown
Contributor

UX Review (Opus 5.5) — ✅ PASS

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

UX-Verdict: PASS

Nothing blocks. Both changed surfaces are in the screenshots. The blind reader read the notice and the "How to give the files back" link correctly and would click the link.

Notes

  • components.dataHomeOwnerNotice.unusable says "this account", and the reader asked whether that meant "my Kiro Crew account or something on the computer". Naming it fixes this, e.g. "…can't be used by your computer account ({{user}})…".
  • cause uses "root" and "sudo" with no explanation, and the reader said those words "mean nothing to me". Start with the plain-words step, e.g. "Stop starting {{productName}} with sudo or as an administrator, then follow the link to give the files back."
  • unusable says the same thing twice ("can't be used by this account, so {{productName}} can't read them"). Shorten it to "{{productName}} can't read some of its files in {{home}}."

[UX-REVIEWED] 4d54c48

Description read

[DESCRIPTION-READ] 7c19c0b9d5d7ce9c56e623a1c0ff43fc759fa60fa9ff2a8c17e95845354aa11e

That sha256 names everything this verdict read: the PR description, plus the 5 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 Nov 8, 2026 •

Copy link
Copy Markdown
Contributor

Design Review (Opus 5.5) — ✅ PASS

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

Design-Verdict: PASS

Nothing blocks: the repair command is removed rather than patched again, the slim MCP start now runs the same refusal step as cli.main, and no reader of fix_command is left in the tree.

Notes

  • troubleshooting.md still tells the person to run nearly the same sudo find … -execdir chown line. The hard-link race is now handled by the "stop every agent" step and the -links +1 pre-check rather than by the code. That is the right owner for the step, but the doc is now the only safeguard, and nothing tests it except that the anchor exists.

[DESIGN-REVIEWED] 4d54c48

Description read

[DESCRIPTION-READ] ad23eb197cc1f207ecb6c26a6fb27dc39e94aad20f664226125b6fcb871dcda4

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 Nov 8, 2026 •

Copy link
Copy Markdown
Contributor

First Principles Review (Opus 5.5) — ✅ PASS

Premise-level review of 4d54c484e5a9f43a3a39233770b81c42df15a2ad — 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

The fix removes the cause on both paths: there is no privileged command to race, and the one slim entry now asks the refusal. The only open point is that the docs still give out the same chown line.

Notes

  • Item 6 — inherited: ## Not a goal excludes any re-own "by a command it hands out", yet troubleshooting.md step 5 hands out the same sudo find … -links 1 … -execdir chown -h line that fix_command carried. Its safety now depends on the reader really having stopped every agent. Subtraction: delete step 5 and its pre-check (step 4), keep step 6 (chmod -R u+rwX without sudo) and the "stop running as root" step, and leave re-owning to the person without a copyable line.

What this change ships

Inventory (7 items) — 5 justified

Intent: make sure Kiro Crew can never trick its own user into a root re-own of a system file, and that root-started MCP servers stop writing into a person's data home. This is a FIX.

  1. Gateway log and kirocrew doctor show the folder, owner, likely cause and a docs link instead of a sudo repair line — justified
  2. The Settings notice drops the copy-command box and shows the cause and a "How to give the files back" link — justified
  3. The New Bot dialog shows the same thing after a 409 data_home_not_owned — justified
  4. /api/status data_home_access and the 409 body swap fix_command for owner and help_url — justified
  5. A root-started kirocrew mcp-* aimed at a person's data home is now refused (_bootstrap → slim_server was the only path around cli.main) — justified
  6. A new troubleshooting section walks through a manual sudo find/chown re-own — inherited, contradicts Not-a-goal
  7. The reported home is now the resolved real folder, not the configured path — undeclared

[FIRST-PRINCIPLES-REVIEWED] 4d54c48

Description read

[DESCRIPTION-READ] 7f850e348c6d48987483374ce9397d18aec4fe3655e8cd3cfa6558f77c406da3

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 Nov 8, 2026 •

Copy link
Copy Markdown
Contributor

Opus 5.5 Review — ✅ no blocking findings

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

Review details

No findings.

[OPUS-REVIEWED] 4d54c48

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

False positive or not applicable? A repository writer can comment:
/ai-review override fable 4d54c484e5a9f43a3a39233770b81c42df15a2ad false-positive: <reason, 20 to 500 characters>

@github-actions

github-actions Bot commented Nov 8, 2026 •

Copy link
Copy Markdown
Contributor

GPT 6.1 Review — ✅ no blocking findings

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

This comment is updated in place on each push.

Review details

No findings.
[GPT-REVIEWED] 4d54c48

False positive or not applicable? A repository writer can comment:
/ai-review override gpt 4d54c484e5a9f43a3a39233770b81c42df15a2ad false-positive: <reason, 20 to 500 characters>

@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 Nov 8, 2026
@buluoray
buluoray force-pushed the crew/slack/data-home-fd-repair branch from 3b50295 to 59fa25f Compare November 8, 2026 09:28
@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 Nov 8, 2026
@buluoray

buluoray commented Nov 8, 2026 •

Copy link
Copy Markdown
Contributor Author

Superseded: this disposition had a malformed marker and was re-posted in the correct format further down (head 3b50295, Opus span c6e7b1438497).

@buluoray

buluoray commented Nov 8, 2026 •

Copy link
Copy Markdown
Contributor Author

Superseded: this disposition had a malformed marker and was re-posted in the correct format further down (head 3b50295, GPT span 38f5990241c0).

@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 Nov 8, 2026
@buluoray
buluoray force-pushed the crew/slack/data-home-fd-repair branch from 59fa25f to 6d3a715 Compare November 8, 2026 10:39
@buluoray

buluoray commented Nov 8, 2026 •

Copy link
Copy Markdown
Contributor Author

Superseded: this disposition had a malformed marker and was re-posted in the correct format further down (head 59fa25f, Opus span 1afafa35f8da).

@buluoray

buluoray commented Nov 8, 2026 •

Copy link
Copy Markdown
Contributor Author

Superseded: this disposition had a malformed marker and was re-posted in the correct format further down (head 59fa25f, GPT span 38f5990241c0, macOS ACL finding).

@buluoray

buluoray commented Nov 8, 2026 •

Copy link
Copy Markdown
Contributor Author

Superseded: this disposition had a malformed marker and was re-posted in the correct format further down (head 59fa25f, GPT span 38f5990241c0, concurrent-save finding).

@buluoray

buluoray commented Nov 8, 2026

Copy link
Copy Markdown
Contributor Author
  • span=c6e7b1438497 The cli.md spec rewrite is corrupted

fixed in 59fa25f: the Detection bullet is rewritten whole, restoring the usability rule and memory_stores/; the hard-link sentence now reads only as the limit of the find fallback.

@buluoray

buluoray commented Nov 8, 2026

Copy link
Copy Markdown
Contributor Author
  • span=38f5990241c0 Unlinking an opened hard link bypasses the single-link guard

fixed in 59fa25f: each file another account owns is renamed into a root-only staging folder before it is opened with O_NOFOLLOW, checked and re-owned with fchown on that descriptor; while staged nothing running as the person can unlink the alias, so a planted link to a system file keeps st_nlink==2 and is skipped.
Pinned by test_unlinking_a_planted_hard_link_after_the_open_does_not_pass_the_check (red when the file is opened in place).

@buluoray

buluoray commented Nov 8, 2026

Copy link
Copy Markdown
Contributor Author
  • span=1afafa35f8da On a Mac without the Command Line Tools, /usr/bin/python3 is only a stub

fixed in 6d3a715: the Python line is chosen only when /usr/bin/python3 exists and, on macOS, xcode-select -p succeeds; otherwise the find fallback with its note. Pinned by test_a_mac_without_developer_tools_gets_the_find_line.

@buluoray

buluoray commented Nov 8, 2026

Copy link
Copy Markdown
Contributor Author
  • span=38f5990241c0 Inherited macOS ACLs bypass the root-only staging check

fixed in 6d3a715: on macOS the script clears staging ACL through its descriptor with acl_set_fd(g, acl_init(0)) before any file is moved in, and exits 1 if that fails; on Linux the 0700 mode masks a default ACL. Pinned by test_on_macos_staging_acl_is_cleared_or_the_run_stops.

@buluoray

buluoray commented Nov 8, 2026

Copy link
Copy Markdown
Contributor Author
  • span=38f5990241c0 Restoring a staged file overwrites concurrent saves

fixed in 6d3a715: a staged file goes back with link then unlink, which never replaces a name; when a save recreated it, the new file stays, the old copy is kept in staging and the run exits printing the staging path. Pinned by test_a_name_saved_again_while_staged_keeps_the_new_file.

@buluoray
buluoray force-pushed the crew/slack/data-home-fd-repair branch from 6d3a715 to a4647de Compare November 8, 2026 11:22
@buluoray

buluoray commented Nov 8, 2026

Copy link
Copy Markdown
Contributor Author
  • span=1afafa35f8da The os.link that moves a staged file back follows a symlink
    resolution: narrowed -- the restore is gated on what staging holds; staging itself is kept (retrospective verdict)

fixed in a4647de: before the link back, the staged entry is lstat-ed through the staging descriptor; only a regular file is linked back. Anything else (a name swapped for a symlink between the walk and the move) stays in root-only staging under its inode number and the run exits printing the staging path, so root never creates a hard link to a symlink target in the home.
Pinned by test_a_name_swapped_for_a_symlink_before_staging_never_links_its_target (target keeps st_nlink==1; red when the gate is removed).

@buluoray

buluoray commented Nov 8, 2026

Copy link
Copy Markdown
Contributor Author
  • span=38f5990241c0 Restoring a swapped symlink exposes sandbox-masked credentials
    resolution: narrowed -- third fix on this span changes the restore shape instead of patching the call: the link back runs only for an entry staging holds as a regular file; the staging freeze from earlier rounds stays

fixed in a4647de: the staged entry is lstat-ed through the root-only staging descriptor first; a non-regular entry (the swapped symlink) is never linked back and stays in staging under its inode number while the run exits printing the staging path. No hard link to the symlink target (SSH key or system file) is created in the home.
Pinned by test_a_name_swapped_for_a_symlink_before_staging_never_links_its_target: a regular file is swapped for a symlink to an outside key between the walk lstat and the move; the key keeps st_nlink==1 and no name is restored. Red when the S_ISREG gate is removed.

@github-actions github-actions Bot added readiness: passed Eligible automated validation passed for the current revision and removed readiness: action required A blocking check or review needs attention labels Nov 8, 2026

@KiroCrewCaptain KiroCrewCaptain left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Thanks for this. The MCP root refusal sits at the right step, and the test that makes project detection and ensure_data_home raise pins the order well. One thing needs fixing before merge.

  1. kiro_crew/docs/troubleshooting.md:622-664 (with kiro_crew/data_home_owner.py:76). Take an entry in the data home that this account owns but cannot use, for example members/ at mode 0500 or config.json at 0200. _usable() returns False for it, _other_owner() returns "", and the notice, doctor and the 409 all show "can't be used by this account" with a link to this section. The only repair in that section is sudo find ... ! -user "$(id -un)" ... -exec chown -h. That command matches nothing here, because the files already belong to this account. Step 6 says the doctor check "should now pass", and it keeps failing. On main, the repair line ended with && chmod -R u+rwX <home>, which fixed this case. The PR removes it, and the Before/Now table and the Reader list do not mention that. Smallest fix: add a step the person runs as their own account, without sudo, such as chmod -R u+rwX <folder>. Or give the "can't be used by this account" case its own short paragraph. This needs no root, so it does not reopen the privilege boundary this PR closes.

Optional:

  • Step 5 uses full-path -exec chown -h ... {} +. Main's -execdir chown -h ... {} \; form costs nothing and keeps the protection against a parent folder being swapped.
  • The PR title still says "re-own the data home through the checked file". The head commit subject describes the diff better, and the squash merge uses the title.
  • The direction changed from repair to refuse-and-explain after the PR opened. A maintainer should confirm that direction on this PR before merge.

@github-actions github-actions Bot added readiness: action required A blocking check or review needs attention and removed readiness: passed Eligible automated validation passed for the current revision labels Nov 8, 2026
@bolichen97

Copy link
Copy Markdown
Contributor

Maintainer note on 932915d, confirming the direction:

  • No automatic repair, a notice instead: confirmed. Dropping the sudo find ... chown line removes a root re-own with a hard-link race, and telling the person what is wrong is the right shape.
  • root_run_refusal on mcp_entry.slim_server: accepted. It reuses the refusal main already makes in cli.main, so it closes a bypass rather than adding a new restriction.

I agree with the one point in the open change request: the "can't be used by this account" case needs its own step without sudo, such as chmod -R u+rwX <folder>, since the chown step matches nothing for files this account already owns. With that added and the checks green, I'll approve.

@buluoray buluoray changed the title fix: re-own the data home through the checked file, and refuse root mcp starts fix: explain a data home another account owns, and refuse root mcp starts Nov 8, 2026
@buluoray
buluoray force-pushed the crew/slack/data-home-fd-repair branch from 932915d to 925c8d2 Compare November 8, 2026 14:28
@buluoray

buluoray commented Nov 8, 2026

Copy link
Copy Markdown
Contributor Author

Thanks, @KiroCrewCaptain. Answers to your review of 932915d, all in 925c8d2:

  1. "Can't be used by this account" had no working repair (required). Fixed. The troubleshooting section now ends with chmod -R u+rwX <folder>, run as the person's own account without sudo. It replaces the && chmod -R u+rwX <home> tail the removed line had, and it can change nothing the person does not own. The intro now says that when the notice reads "can't be used by this account", the files are already theirs and they can skip straight to that step. cli.md and the PR body say the same.
  2. Step 5 used full-path -exec ... {} + (optional). Taken. It is now -execdir chown -h "$(id -un)" {} \;, as on main.
  3. PR title (optional). Changed to the commit subject: "fix: explain a data home another account owns, and refuse root mcp starts".
  4. Maintainer confirmation of the direction. The maintainer confirmed refuse-and-explain on this PR; see fix: explain a data home another account owns, and refuse root mcp starts #33028 (comment).

@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: action required A blocking check or review needs attention readiness: checking Automated validation is still running labels Nov 8, 2026
…arts

When files in the data home belong to another account (an earlier
`sudo kirocrew ...`), the gateway log, `kirocrew doctor`, /api/status,
Settings and the New Bot dialog now say which folder and which account,
that Kiro Crew was probably started as root once, to stop running it as
root, and link the troubleshooting section that explains giving the
files back by hand. Kiro Crew no longer offers a command that re-owns
the files as root: every copyable version left a race in which a
process writing the folder could point root at a file outside it.

The gateway's own mcp-* servers start through mcp_entry.slim_server,
which never asked root_run_refusal, so a root-started server still wrote
into the person's home. It now asks at the same step as cli.main and
hands a refusal to the full CLI.
@buluoray
buluoray force-pushed the crew/slack/data-home-fd-repair branch from 925c8d2 to 4d54c48 Compare November 8, 2026 14:49
@buluoray

buluoray commented Nov 8, 2026

Copy link
Copy Markdown
Contributor Author
  • span=e7ee111985ef The hard-link check runs unprivileged and cannot read a root-owned 0700 folder

fixed in 4d54c48: step 4 is now sudo find -P <folder> -xdev -type f -links +1. It only lists files, and it runs as root so it can see into folders like a root-owned 0700 memory_stores/, which the earlier root run leaves unreadable. A permission error no longer stops the person before step 5. The "must print nothing, else stop" rule is unchanged, and cli.md says the same.

@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 readiness: action required A blocking check or review needs attention readiness: checking Automated validation is still running labels Nov 8, 2026
@KiroCrewCaptain
KiroCrewCaptain enabled auto-merge (squash) November 8, 2026 16:05

@KiroCrewCaptain KiroCrewCaptain left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Approving head 4d54c48. The earlier change request is resolved. Item 1 is fixed: step 6 now runs chmod -R u+rwX <folder> without sudo, and the intro sends the "can't be used by this account" case straight to it. The optional -execdir form and the title change are also in. A maintainer confirmed the refuse-and-explain direction and the slim refusal in comment 6722570282 on this PR, which signs off the design.

What the review checked on this head: mcp_entry.slim_server calls root_run_refusal before project detection and ensure_data_home, then falls back to cli.main, which refuses at the same step. No reader of fix_command or fixCommand is left under src or website/src. All 12 locales carry the new keys. The HELP_URL anchor test matches a real heading. PR Readiness is green.

Security: the root re-own race is gone from the code. The only privileged command left is a manual docs step that the person runs themselves, after the stop step and the step 4 hard-link check. A sandboxed MCP child gets an identity uid map, so it never sees euid 0 and is never refused by mistake.

Done well: the PR removes the repair line instead of patching it a fourth time. A new test makes project detection and ensure_data_home raise, which pins the refusal ahead of every data home write.

Optional:

  • Step 2 names only kirocrew and kiro-cli. Asking the person to check for "any process of the agent backend you use" would also cover other backends before step 5.
  • home is now the resolved folder, not the configured path, but the body says it "stays". One line under Backwards compatibility would record this.
  • #33006 and #31628 still carry fix_command. Hold them or re-cut them so they follow this change.

@KiroCrewCaptain
KiroCrewCaptain merged commit 8297ded into main Nov 8, 2026
99 checks passed
@KiroCrewCaptain
KiroCrewCaptain deleted the crew/slack/data-home-fd-repair branch November 8, 2026 16:05
@github-actions github-actions Bot removed the readiness: passed Eligible automated validation passed for the current revision label Nov 8, 2026
buluoray added a commit that referenced this pull request Nov 8, 2026
…arts (#33028)

When files in the data home belong to another account (an earlier
`sudo kirocrew ...`), the gateway log, `kirocrew doctor`, /api/status,
Settings and the New Bot dialog now say which folder and which account,
that Kiro Crew was probably started as root once, to stop running it as
root, and link the troubleshooting section that explains giving the
files back by hand. Kiro Crew no longer offers a command that re-owns
the files as root: every copyable version left a race in which a
process writing the folder could point root at a file outside it.

The gateway's own mcp-* servers start through mcp_entry.slim_server,
which never asked root_run_refusal, so a root-started server still wrote
into the person's home. It now asks at the same step as cli.main and
hands a refusal to the full CLI.

(cherry picked from commit 8297ded)
buluoray added a commit that referenced this pull request Nov 8, 2026
…arts (#33028)

When files in the data home belong to another account (an earlier
`sudo kirocrew ...`), the gateway log, `kirocrew doctor`, /api/status,
Settings and the New Bot dialog now say which folder and which account,
that Kiro Crew was probably started as root once, to stop running it as
root, and link the troubleshooting section that explains giving the
files back by hand. Kiro Crew no longer offers a command that re-owns
the files as root: every copyable version left a race in which a
process writing the folder could point root at a file outside it.

The gateway's own mcp-* servers start through mcp_entry.slim_server,
which never asked root_run_refusal, so a root-started server still wrote
into the person's home. It now asks at the same step as cli.main and
hands a refusal to the full CLI.

(cherry picked from commit 8297ded)
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.

3 participants