Skip to content

fix: v0.12.2 hotfix batch 3 (8 security and data-loss fixes) - #34737

Merged
bolichen97 merged 8 commits into
release/0.12.0from
hotfix/0.12.2-batch3
Nov 10, 2026
Merged

bolichen97 merged 8 commits into
release/0.12.0from
hotfix/0.12.2-batch3

Conversation

@bolichen97

Copy link
Copy Markdown
Contributor

Problem / Motivation

Goal: Ship the third and last fix batch of the 0.12.2 hotfix: 8 security and data-loss fixes from main, on release/0.12.0.

These were merged to main after the second 0.12.2 review. At the 0.12.2 cutoff, of 111 such fixes only those whose bug is in release code AND whose effect is a security gap or lost data were taken; the rest wait for 0.12.3.

Why it matters

Each one closes a security gap or a way to lose user data that 0.12 users can hit today.

Not a goal

  • No new behaviour on release: each commit is a git cherry-pick -x of the main merge commit; a hand-port keeps release's own code and says what it left out in a Backport note: line.
  • No ordinary bug fixes, app fixes, CI-only, docs-only or test-only commits: those wait for 0.12.3.

What changed (motivation → approach → change)

The 8 picks, in main merge order, on release/0.12.0 at f0994b5e47:

# PR Main merge commit Fix
1 #34388 6eba83eacb keep one failing cleanup step from skipping the rest
2 #34487 93dfc23352 keep cli.json whole when the overlay writers cannot read it
3 #33931 1465c34658 tighten a file read check
4 #34318 e6a6a9b1eb keep a review draft when posting it fails
5 #34350 6b6b3e5364 tighten fixed tool lookups on windows
6 #34221 524e3c9f46 stop trusting localhost:3000 because a data home is set
7 #33918 81d3b143bb keep memory.db locks and read office-held files in the viewer
8 #33678 6bad93dc96 read end of input at a yes/no prompt as no

Hand-ports with a Backport note::

Backwards compatibility

No behaviour change beyond each listed fix. No config key, CLI flag or API is removed or renamed.

Tests

  • On a DevSpace with the release venv: every test file the picks change or add, 1390 passed, 14 skipped, 0 failed; flake8, isort, mypy --platform linux and black on the changed files: clean.
  • Amazon Linux 2023 smoke of the build: gateway boot, a real kiro-cli chat turn, an MCP tool call, the file viewer refusing memory.db while pragma integrity_check stays ok, restart and stop: all pass.

Proof: not provable -- other: a cherry-pick batch of already-merged main fixes, each proven in its own main PR

Manual verification

N/A: each fix was verified in its own main PR; the batch was smoke-tested on Amazon Linux 2023 as above.

Screenshots / video

N/A: no visual change.

Related Issues

0.12.2 hotfix, batch 3: #34388, #34487, #33931, #34318, #34350, #34221, #33918, #33678.

Sibling sweep

Siblings: none -- a backport batch; each pick's own PR carried its sweep

Pattern harvest

Not generalizable: a release backport batch, not a new defect fix.

Checklist

  • Each commit is a cherry-pick -x of a main commit with a Conventional Commits title
  • 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

Contributions are accepted under the project's Apache-2.0 license; see the Licensing section of CONTRIBUTING.md.

RohanK6 and others added 8 commits November 10, 2026 10:11
…34388)

aiohttp runs the gateway's on_cleanup hooks in order and stops at the
first one that raises. Several steps awaited network closes or
subprocess stops with no guard: the Kiro prerequisite and KAS login
service closes, the speech and local decision model releases, the
decision HTTP close, the config watcher, the remote report puller,
the instance tunnel shutdown and the app hook sweep. One of them
failing at shutdown (network down, process already gone) skipped every
later step, including the crew-log drain, so the sessions' buffered
log appends were lost, and the browser and app-backend teardown.

Each of those steps now logs its own failure and returns, the way the
other cleanup steps already do.

(cherry picked from commit 6eba83e)
…#34487)

The effort and Tool Search overlay writers read the workspace
.kiro/settings/cli.json, fell back to {} on any OSError, and then
rewrote the whole file. One transient read failure on a file that
exists (EACCES, EIO, a Windows sharing violation) therefore replaced
it with Kiro Crew's keys alone, dropping the other writer's settings
and any key the person kept there.

Both writers now start from {} only for an absent file, one that is
not valid JSON or one that holds no JSON object; any other OSError
propagates, so the write is refused and the file keeps every key.
Their callers already catch the error, log a warning and report the
write as failed.

Closes #24978

(cherry picked from commit 93dfc23)
An operator's file read rules also judge the image files a read
opens. A read whose image a rule covers is refused where it was
permitted; everything refused before stays refused.

Closes #32200

(cherry picked from commit 1465c34)
A failed post on review Approve or on the edit-modal submit popped the
draft first and never put it back, so the reply was lost. Approve now
re-stores the draft so a second press retries. The edit submit stores the
edited text and re-posts the review card (at channel level when the first
card was), since the modal closed and the old card is gone. A stale modal
whose draft was already claimed no longer posts.

(cherry picked from commit e6a6a9b)

Backport note: test/test_review_mode.py conflicted on the import block;
release has no slack_wire_helpers module, so only the SlackApiError
import was taken.
On Windows four fixed tool lookups (the provider CLI, the voice
decoder, the tailnet CLI and a sandbox helper) no longer try macOS and
Linux folders. macOS and Linux keep the same lists.

Part of #33558

(cherry picked from commit 6b6b3e5)
…et (#34221)

build_allowed_origins added http://localhost:3000 and
http://127.0.0.1:3000 to the trusted browser origins whenever
KIROCREW_HOME was set. Every pod gateway, the desktop app, the dev
scripts and any relocated data home set it. The session cookie is
SameSite=Lax and reaches every port of the host, and a WebSocket
upgrade is a GET the CSRF middleware does not inspect, so any page
served on :3000 could pass the CSRF check and open the dashboard
terminal WebSocket under the operator's session.

Where the data lives says nothing about who owns another loopback
port, so the entries are removed. The Vite dev server's port is now an
explicit opt-in through the existing KIROCREW_ALLOWED_LOOPBACK_PORTS.
dev-fullstack.sh adds it for the port it starts Vite on, refuses to
start when something already listens there, and pins Vite to it with
--strictPort, so the trusted port never belongs to another app.
CONTRIBUTING.md and website/README.md document the opt-in for the
manual flow.

The security spec states the rule, and
test/test_dashboard_origin_data_home.py pins it: with KIROCREW_HOME set
and no opt-in, no :3000 origin is trusted, a :3000 page fails the CSRF
check and is refused by the terminal WebSocket, the dashboard's own
origin still reaches the terminal, and the explicit opt-in still
trusts :3000.

(cherry picked from commit 524e3c9)
…33918)

- Dashboard file reads and searches no longer drop the gateway's
  memory.db SQLite locks, a close that could split the memory database.
- The Windows file viewer reads a document Word or Excel holds open
  (delete-sharing open) instead of answering HTTP 500; busy is 503.

(cherry picked from commit 81d3b14)

Backport note: learn-cron-dashboard.md conflicted; kept release's text
(no 'Editing text-backed viewers' paragraph and release's File read
headers wording) and added only the new Windows open-file paragraph.
The open_log_file_for_tail row is removed from the platform_compat
facade inventory.
`kirocrew cloud launch` with stdin closed or exhausted, and no --yes,
took the account confirmation as yes and created a billed stack; the
Session Manager plugin prompt took it as yes too and started sudo.
ui.confirm() returned its default on EOFError, and both prompts default
to yes.

No answer is never consent, so confirm() now returns False on end of
input whatever its default. A declined account confirmation off a
terminal also says to re-run the same command with --yes, the existing
way to accept the defaults non-interactively.

Closes #32102

(cherry picked from commit 6bad93d)
@bolichen97
bolichen97 requested review from a team and KiroCrewCaptain as code owners November 10, 2026 18:49
@bolichen97
bolichen97 requested review from dodgeblaster and removed request for a team November 10, 2026 18:49
@bolichen97
bolichen97 merged commit 5a41995 into release/0.12.0 Nov 10, 2026
@bolichen97
bolichen97 deleted the hotfix/0.12.2-batch3 branch November 10, 2026 18:49
@github-actions

Copy link
Copy Markdown
Contributor

Sensitive Change Review

Sensitive files changed:

  • src/kiro_crew/sandbox_argv.py

  • No reasoning template for 54bee33 yet.

How to clear this check:

  1. The PR author posts the template below as a PR comment, with
    every field filled (N/A needs a reason). Keep the
    Head commit line: it must name the current head SHA.
  2. The check turns green within a minute, with no push.
  3. A new push resets this check: post it again for the new head.

Only the author's comment counts this way. A reviewer can instead
paste the filled template into an "Approve" review on this head.
Merging still needs a reviewer's approval.

## Sensitive change review
- Head commit: 54bee33cbf87a64eb8c88b1c626e24b9e63c7a77
- What rule changed:
- Before -> after (what was allowed/blocked, now):
- Worst case if wrong (breaks commands / leaks secret / locks user out):
- Evidence checked (which sandbox result proves it):
- No regression:
  - Tools still work (which tools/commands were run, result):
  - Backward compatible (old config / old data / old callers still work, how checked):
  - Existing tests (which suites passed on this head):
- How to undo:

@github-actions

Copy link
Copy Markdown
Contributor

UX Review (Opus 5.5) — ✅ PASS

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

UX-Verdict: PASS

This backport adds or changes no dashboard control. The only user-facing text is new copy, and it already says what happened and what to do next.

Notes

  • Neither new string has a screenshot or terminal capture to check it against: the file viewer's 503 "the file is open in another program; close it there and retry" (Windows only) and the cloud wizard's "Not run from a terminal: re-run the same command with --yes to accept the defaults."

[UX-REVIEWED] 54bee33

Description read

[DESCRIPTION-READ] 71eab2fc76f0202cbe982eee99754f1cb087cc67a0923c46670c6b4c2ee8c672

That sha256 names everything this verdict read: the PR description, plus the 3 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

Copy link
Copy Markdown
Contributor

Design Review (Opus 5.5) — ✅ PASS

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

Design-Verdict: PASS

Nothing blocks: eight cherry-picks of already-merged main fixes, and nothing outside the patch still reads what they remove.

Notes

  • Two things are taken away. No code in the tree still calls open_log_file_for_tail. Dropping the automatic localhost:3000 trust means a developer who runs a bare npm run dev beside a gateway with KIROCREW_HOME set will now fail the CSRF check on every write until they set KIROCREW_ALLOWED_LOOPBACK_PORTS=3000. CONTRIBUTING.md and dev-fullstack.sh already cover this, so a one-line Reader: note under ## Backwards compatibility would make the section match.

[DESIGN-REVIEWED] 54bee33

Description read

[DESCRIPTION-READ] 16f87bfb4de7dd35e03c17d3ac2e91eba9d6b57891262a6e435eae9fedf69d66

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

Copy link
Copy Markdown
Contributor

First Principles Review (Opus 5.5) — ✅ PASS

Premise-level review of 54bee33cbf87a64eb8c88b1c626e24b9e63c7a77 — 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

Backport of eight fixes already merged on main. Each closes a named security gap or data-loss path, and nothing new rides along.

What this change ships

Inventory (10 items) — 10 justified

Intent: ship eight already-merged security and data-loss fixes to 0.12 users on release/0.12.0. This is a FIX.

  1. A failing gateway cleanup step no longer stops the later ones, including the crew-log drain — justified
  2. A workspace cli.json that can't be read (EACCES, a sharing violation) is left alone instead of being rewritten with only Kiro Crew's keys — justified
  3. Image files in a batch read are now judged by the filesystem.read governance rules — justified
  4. A Slack review draft whose edited post fails comes back as a new card instead of being lost — justified
  5. On Windows, drive-less POSIX tool paths (gh, glab, tailscale, ffmpeg, env) are no longer searched — justified
  6. A set KIROCREW_HOME no longer trusts localhost:3000; the port is trusted only when listed in KIROCREW_ALLOWED_LOOPBACK_PORTS — justified
  7. dev-fullstack.sh opts in :3000, refuses to start if the port is taken, and runs Vite with --strictPort — justified
  8. The file viewer, file watch and file grep refuse memory.db and its sidecars, so a viewer read can't drop the store's locks — justified
  9. On Windows, documents open in Word or Excel now read; a file another program won't share answers 503 file_busy — justified
  10. End of input at a cloud yes/no prompt counts as no; an account confirmation declined off a terminal points to --yes — justified

[FIRST-PRINCIPLES-REVIEWED] 54bee33

Description read

[DESCRIPTION-READ] b1a32519b7e6b646bc92134afa87e9c8fcd78cb3427ced457276343392cd9e2d

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

Copy link
Copy Markdown
Contributor

GPT 6.1 Review — ✅ no blocking findings

GPT 6.1 completed its review of 54bee33cbf87a64eb8c88b1c626e24b9e63c7a77 and found no blocking issues.

This comment is updated in place on each push.

Review details

No findings.
[GPT-REVIEWED] 54bee33

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

@github-actions

Copy link
Copy Markdown
Contributor

Opus 5.5 Review — ✅ no blocking findings

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

Review details

No findings.

[OPUS-REVIEWED] 54bee33

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

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

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