Skip to content

fix: backport the data home owner check and its symlink-safe repair to 0.12 - #33006

Merged
buluoray merged 3 commits into
release/0.12.0from
crew/slack/release-0.12-data-home
Nov 8, 2026
Merged

buluoray merged 3 commits into
release/0.12.0from
crew/slack/release-0.12-data-home

Conversation

@buluoray

@buluoray buluoray commented Nov 8, 2026 •

Copy link
Copy Markdown
Contributor

Problem / Motivation

Goal: Bring the data home ownership check and its symlink-safe repair line, both merged on main after v0.12.0, onto release/0.12.0, one commit each, in a PR of its own.

Why it matters

PR Area What a 0.12.0 user sees today
#31602 data home After one sudo kirocrew ... run, config reads and Bot creates fail with generic permission errors and no fix is shown
#32944 data home The repair line #31602 shows ran chown as root by full path, so a writer inside the home could swap a parent for a symlink and get a system path re-owned
#33028 data home, MCP Any copyable root repair line could still be raced into re-owning a system file; a root-started kirocrew 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

  • No fix that is not already merged on main; nothing is changed only here.
  • No version bump, no tag, no CHANGELOG.md change.

What changed (motivation → approach → change)

Each main squash commit was cherry-picked with -x onto release/0.12.0 @ 19bd79b4a8, in merge order on main. 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.

# PR main commit release commit pick
1 #31602 refuse root runs on a person's data home and name the repair 64beae3ae3 e0724a0260 hand-resolved
2 #32944 walk the data home repair without following a swapped symlink 3c09c74e42 e1c0e29eed clean
3 #33028 explain a data home another account owns, and refuse root mcp starts 8297dedecc f4485ef812 clean

Hand-resolved hunk:

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

  • CI does not run the backend suite on PRs into release/*, so related tests ran here in one pytest process with -n0 on f4485ef812: test_data_home_owner.py, test_member_memory_creation_capability.py, the two doctor test files and test_mcp_slim_entry.py gave 466 passed (13 subprocess tests in test_mcp_slim_entry.py were left out: they need yaml, which this host's Python lacks).
  • Frontend: the vitest files the picks touch (DataHomeOwnerNotice, MembersPage.newCrewmateOutcomes, SettingsPage.sharedCrewPreview) plus the whole i18n suite, measured against release/0.12.0, gave 72 files and 1250 tests passed; tsc is 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:

Settings data home owner notice

New Bot dialog after Create is refused:

New Bot dialog data home owner notice

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

  • 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 and others added 2 commits November 8, 2026 07:18
…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)
@buluoray
buluoray requested review from a team and KiroCrewCaptain as code owners November 8, 2026 07:21
@buluoray
buluoray requested review from Zedmor and removed request for a team November 8, 2026 07:21
@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 (a BLOCK with no Trigger and no Outcome does not block)

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

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 /api/status fails.

Evidence gaps

  • DataHomeOwnerStatusNotice error branch (components.dataHomeOwnerNotice.check_failed, testId settings-data-home-owner-check-failed): no supplied screenshot shows it. shot-01 and shot-02 show only the unusable notice, and shot-03 to shot-09 are another PR's files (temp-screenshots/10920-offline-rename/). To close the gap, attach a Settings screenshot taken while the status read fails, ideally with the gateway offline. That is the most common way to hit it, and there the line may make a user think file ownership is the problem.

Notes

  • shot-01: the red ownership notice sits right above the Overview tab's green "All systems running". The blind reader said: "I don't know which one to believe". Make the Overview status show a problem while data_home_access.ok is false.
  • shot-02: with the notice showing, the reader was "hesitant" to press "Create bot". After a data_home_not_owned refusal, say plainly that nothing was created and that creating will keep failing until the files are fixed.
  • cause copy: "Stop running it as root" assumes the reader knows root and sudo, and the reader didn't. Change it to "Stop starting it with sudo".

[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 .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 f4485ef81249cfb6d8a1529f44cbae7655afa7d4 — 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

This backports three fixes already merged on main. The end state matches main's data_home_owner.py, and nothing here exists only on the release branch.

Notes

What this change ships

Inventory (5 items) — 4 justified

Intent: a person on 0.12 who once ran sudo kirocrew should get a clear reason and the manual fix, not generic permission errors. This is a FIX (a backport).

  1. sudo kirocrew <cmd> on another account's data home is refused before it writes anything, except service and stop — justified
  2. The gateway log, kirocrew doctor and /api/status name the folder and the account that owns it — justified
  3. Creating a Bot on a data home this account cannot use returns 409 data_home_not_owned, and the dashboard shows a notice — justified
  4. A root-started kirocrew mcp-* server is refused too — justified
  5. The copyable root chown repair line is gone; a troubleshooting link replaces it — undeclared (the title still says "symlink-safe repair")

[FIRST-PRINCIPLES-REVIEWED] f4485ef

Description read

[DESCRIPTION-READ] 99dd50b325312848b41cdb2466b0875a828498ec15b27e5c86bc0e552eb0f00e

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

Design Review (Opus 5.5) — ✅ PASS

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

Design-Verdict: PASS

Nothing blocks: this is a faithful backport of three fixes already on main, and the security follow-ups ship in the same PR as the check they repair.

Notes

  • root_run_refusal now also stops root runs where KIROCREW_HOME is a volume owned by another user ID (for example, a container running as root against a mounted host folder). That holds on main too. The 0.12.1 release notes should name it, because a patch release that newly refuses to start surprises people.
  • The title still says "its symlink-safe repair". The net diff ships no repair line, because fix: explain a data home another account owns, and refuse root mcp starts #33028 removed it. The release-note wording should describe what ships: a check, a refusal and a docs link.

[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 .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

Opus 5.5 Review — ✅ no blocking findings

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

Review details

No findings.

[OPUS-REVIEWED] f4485ef

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

False positive or not applicable? A repository writer can comment:
/ai-review override fable f4485ef81249cfb6d8a1529f44cbae7655afa7d4 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 f4485ef81249cfb6d8a1529f44cbae7655afa7d4 and found no blocking issues.

This comment is updated in place on each push.

Review details

No findings.
[GPT-REVIEWED] f4485ef

False positive or not applicable? A repository writer can comment:
/ai-review override gpt f4485ef81249cfb6d8a1529f44cbae7655afa7d4 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
…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)
@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
@buluoray
buluoray merged commit 00e53a5 into release/0.12.0 Nov 8, 2026
27 of 39 checks passed
@buluoray
buluoray deleted the crew/slack/release-0.12-data-home branch November 8, 2026 16:40
@github-actions github-actions Bot removed the readiness: action required A blocking check or review needs attention label Nov 8, 2026
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.

1 participant