Repository navigation
fix: v0.12.2 hotfix batch 3 (8 security and data-loss fixes) - #34737
Conversation
…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)
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.
…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)
Sensitive Change ReviewSensitive files changed:
How to clear this check:
Only the author's comment counts this way. A reviewer can instead |
UX Review (Opus 5.5) — ✅ PASSUX-level review of 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
[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 |
Design Review (Opus 5.5) — ✅ PASSDesign-level review of Design-Verdict: PASS Nothing blocks: eight cherry-picks of already-merged main fixes, and nothing outside the patch still reads what they remove. Notes
[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 |
First Principles Review (Opus 5.5) — ✅ PASSPremise-level review of 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 shipsInventory (10 items) — 10 justifiedIntent: ship eight already-merged security and data-loss fixes to 0.12 users on
[FIRST-PRINCIPLES-REVIEWED] 54bee33 Description read[DESCRIPTION-READ] b1a32519b7e6b646bc92134afa87e9c8fcd78cb3427ced457276343392cd9e2d That sha256 names the PR description this verdict read. Recompute it with |
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: |
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: |
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
git cherry-pick -xof the main merge commit; a hand-port keeps release's own code and says what it left out in aBackport note:line.What changed (motivation → approach → change)
The 8 picks, in main merge order, on
release/0.12.0atf0994b5e47:6eba83eacb93dfc233521465c34658e6a6a9b1eb6b6b3e5364524e3c9f4681d3b143bb6bad93dc96Hand-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
flake8,isort,mypy --platform linuxand black on the changed files: clean.memory.dbwhilepragma integrity_checkstays 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
cherry-pick -xof a main commit with a Conventional Commits titleContribution License Agreement
Contributions are accepted under the project's Apache-2.0 license; see the Licensing section of CONTRIBUTING.md.