Repository navigation
fix: backport the data home owner check and its symlink-safe repair to 0.12 - #33006
Conversation
…1602) A run as root that keeps the person's HOME (sudo on macOS keeps it) writes root-owned files into their data home. The normal account then cannot read config.json, and creating a Bot fails with only the generic "Couldn't create the Bot". kirocrew now refuses, before it touches the data home, when it runs as root and the data home belongs to another account, and names the same command without sudo. Root in its own home, `service` and `stop` are left alone. The damage an earlier run left is found and named: the gateway logs it at start, `kirocrew doctor` reports it with the repair line, /api/status carries it as data_home_access, and POST /api/agents refuses with 409 data_home_not_owned plus fix_command before it writes anything. The New Bot dialog and Settings show one sentence and the command to copy, in every shipped language. (cherry picked from commit 64beae3) # Conflicts: # docs/system-specs/modules/crew-mode.md
…32944) The data home repair line ran `sudo find <home> ... -exec chown -h <user> {} +`, which hands chown full path names after the walk. Anything that can write the home could swap a parent directory for a symlink to a system path in between, and root would re-own that path. The line now uses `find -P` and `-execdir chown -h <user> {} \;`: the walk never follows a symlink, and each chown runs inside the entry's own directory on `./<name>`, so a swapped parent is never resolved. A new test replays the swap with a stand-in chown and fails on the old line. (cherry picked from commit 3c09c74)
UX Review (Opus 5.5) — ✅ PASS (a BLOCK with no Trigger and no Outcome does not block)UX-level review of UX-Verdict: PASS cannot evaluate: missing the Settings "Couldn't check who owns the Kiro Crew files." state. No screenshot shows it, but it renders above every Settings tab whenever Evidence gaps
Notes
[UX-REVIEWED] f4485ef Description read[DESCRIPTION-READ] 84ead5300ca7bc4d26dd40259277db9767be17259b1350232d16dbeae0c9afba That sha256 names everything this verdict read: the PR description, plus the 12 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 |
First Principles Review (Opus 5.5) — ✅ PASSPremise-level review of First-Principles-Verdict: PASS This backports three fixes already merged on Notes
What this change shipsInventory (5 items) — 4 justifiedIntent: a person on 0.12 who once ran
[FIRST-PRINCIPLES-REVIEWED] f4485ef Description read[DESCRIPTION-READ] 99dd50b325312848b41cdb2466b0875a828498ec15b27e5c86bc0e552eb0f00e That sha256 names the PR description this verdict read. Recompute it with |
Design Review (Opus 5.5) — ✅ PASSDesign-level review of Design-Verdict: PASS Nothing blocks: this is a faithful backport of three fixes already on Notes
[DESIGN-REVIEWED] f4485ef Description read[DESCRIPTION-READ] 40c7a1b75305640cfd01876457053a68adf6cd32c88a2806ecf424e26265681a 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 |
Opus 5.5 Review — ✅ no blocking findingsReviewed Verdict parsed from the review's SHA-scoped output markers for commit False positive or not applicable? A repository writer can comment: |
GPT 6.1 Review — ✅ no blocking findingsGPT 6.1 completed its review of This comment is updated in place on each push. Review detailsNo findings. False positive or not applicable? A repository writer can comment: |
…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)
Problem / Motivation
Goal: Bring the data home ownership check and its symlink-safe repair line, both merged on
mainafterv0.12.0, ontorelease/0.12.0, one commit each, in a PR of its own.Why it matters
sudo kirocrew ...run, config reads and Bot creates fail with generic permission errors and no fix is shownchownas root by full path, so a writer inside the home could swap a parent for a symlink and get a system path re-ownedkirocrew mcp-*server skipped the root-run refusal#32944 and #33028 fix security findings in #31602's repair, so the three ship together: #31602 must not reach a release without them. #33028 removes the root repair line: Kiro Crew now names the folder and owner, says to stop running as root, and links a troubleshooting section for the manual fix.
Not a goal
main; nothing is changed only here.CHANGELOG.mdchange.What changed (motivation → approach → change)
Each main squash commit was cherry-picked with
-xontorelease/0.12.0@19bd79b4a8, in merge order onmain. The commit guard refuses a hand-resolved commit unless author and committer are the public identity, so the hand-resolved pick is authored by it; the PR number in each subject credits the original change.64beae3ae3e0724a02603c09c74e42e1c0e29eed8297dedeccf4485ef812Hand-resolved hunk:
docs/system-specs/modules/crew-mode.md, the New Bot dialog paragraph: release still says "mate's chat" where main says "Bot's chat" (a rename that is not on release). Release's wording kept, with the pick's new sentence on the 409data_home_not_ownednotice added after it.Backwards compatibility
Compatible: each change is the one already merged on
main, and its compatibility note applies unchanged.Removes nothing: no setting, key or caller is removed.
Tests
Proof: not provable -- other: a backport of main commits whose proofs ran on their own PRs
release/*, so related tests ran here in one pytest process with-n0onf4485ef812:test_data_home_owner.py,test_member_memory_creation_capability.py, the two doctor test files andtest_mcp_slim_entry.pygave 466 passed (13 subprocess tests intest_mcp_slim_entry.pywere left out: they needyaml, which this host's Python lacks).DataHomeOwnerNotice,MembersPage.newCrewmateOutcomes,SettingsPage.sharedCrewPreview) plus the whole i18n suite, measured againstrelease/0.12.0, gave 72 files and 1250 tests passed;tscis clean.Manual verification
N/A - each fix was verified on its own main PR. The 0.12.1 RC soak is the end-to-end check.
Screenshots / video
The #31602 notice as #33028 leaves it, from an isolated gateway on a data home this account cannot use.
Settings, above every tab:
New Bot dialog after Create is refused:
Related Issues
Backports #31602, #32944 and #33028.
Sibling sweep
Siblings: none -- a backport of two main commits; their sweeps ran on the original PRs
Pattern harvest
Not generalizable: a backport; the pattern harvest is on #32944
Checklist
feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)Contribution License Agreement
Contributed under the project's Apache-2.0 license.