fix(self-update): make script self-update opt-in, not automatic (DEVA11Y-475) - #34
fix(self-update): make script self-update opt-in, not automatic (DEVA11Y-475)#34Crash0v3rrid3 wants to merge 2 commits into
Conversation
…11Y-475) The launcher scripts fetched and applied a self-update on every invocation, before subcommand parsing. Integrity verification (SHA-256 + atomic staging) already landed on main, but the unconditional run meant a single compromise of the fetched source would still silently replace the running script on every developer machine with no way to opt out. Gate self-update behind an explicit `self-update` subcommand across all six launchers (bash/zsh/fish x cli/spm) and document it in the README. Note: the update source is still pinned to the mutable refs/heads/main; pinning to an immutable signed tag + per-tag checksum is follow-up work that depends on a release/tagging pipeline (tracked under APPSEC-415). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…1Y-475)
Code review caught that the previous commit edited all six launchers but left
their .sha256 sidecars stale, which would make the new `self-update` command
fail the integrity check on every run (dead on arrival). Regenerate all six
sidecars to match the edited scripts.
Also: update the pre-existing header comment that still claimed self-update
runs automatically ('always run the newest version'), and soften the README to
describe the checksum as a transit-integrity check rather than an authenticity
signature (script and checksum share one origin on refs/heads/main).
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude Code PR ReviewPR: #34 • Head: 0f881c4 • Reviewers: stack:pr-review (aggregated correctness/security/testing/perf/quality) SummaryMakes launcher self-update opt-in (DEVA11Y-475): self-update runs only via an explicit Review Table
Sidecar integrity verified: recomputed FindingsNo Critical/High/Medium findings. Non-gating nits only:
By-design / residual (non-gating): self-update still tracks the mutable Verdict: PASS — sidecars match, dispatch is correct and side-effect-free on the normal path, docs accurate. No gating findings. |
What & why
Addresses DEVA11Y-475 (F-003, CWE-494, Critical) — self‑update fetched a mutable ref and applied it on every invocation.
Since the ticket was filed (against
520aef6), integrity verification has already landed on main:script_self_updatenow fetches a SHA‑256 sidecar, verifies it, stages atomically, and fails closed (rc 2) on mismatch. Two of the ticket's remediation points remained:refs/heads/mainrather than an immutable signed tag. ⏳ Deferred — depends on a release/tagging + per‑tag checksum pipeline that does not exist yet (no tags in the repo). Tracked under APPSEC-415.Change
script_self_updatecall that ran before subcommand parsing.self-updatesubcommand across all six launchers (bash/zsh/fish × cli/spm); the integrity/rc‑2 handling is preserved, and the command exits with the update's return code.self-updatesubcommand in the README.Trade‑off for reviewers
The current design comment described an intentional "always‑run‑latest, never‑block" auto‑update. Making it opt‑in is a deliberate UX change requested by AppSec — devs will no longer silently get the newest launcher and must run
self-update(or re‑install). Flagging for product + AppSec sign‑off; this is why it's a draft.Testing
bash -nsyntax check passes on all six scripts.🤖 Generated with Claude Code