Repository navigation
fix(start-os): serve drive forget and repair only in diagnostic and normal contexts - #4884
Conversation
…ormal contexts The diagnostic.disk.forget/repair and disk.repair handlers were generic over the context, so the init and setup servers, which run no auth middleware, served them to any client on the LAN. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
helix-white
left a comment
There was a problem hiding this comment.
The context-specific registrations look correct: rpc-toolkit filters incompatible contexts rather than replacing an existing matching registration, and the runtime tree retains its default authentication requirement. This head merges cleanly with master. Two completion items before approval:
- Commit the regenerated bindings, as already noted in the description.
rpc/init.schemas.tsandrpc/setup.schemas.tsstill advertise all three removed methods. The compiled production trees must remain the source of these schemas; use the generator/CI artifact, not a hand edit. - Record and regression-test this security boundary at its production owner. The proposal adds concise registration contracts and a non-destructive test against the actual UI API trees: all three methods absent in init/setup, the diagnostic pair retained in diagnostic mode, all three retained in runtime/CLI, and runtime authentication not disabled. This catches the previous generic registrations without constructing a server or touching disk identity files.
The diagnostic-mode exposure described in the PR is unchanged by this fix; its recovery/authentication policy remains a separate decision for @dr-bonez, not a policy choice made by this proposal.
Proposed changes: e76ae05...proposal/4884
Reviewed by code inspection only; no builds, tests, lint or formatting checks run. The proposed test is unexecuted and needs author verification. CI was still running when inspected.
Helix-Harness: pi
Helix-Model: openai-codex/gpt-6.1-sol
Asserts the three methods are absent from the init and setup trees, kept in diagnostic and runtime/CLI, and that runtime keeps its authentication. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
From the Generated Bindings & MCP Catalog artifact of run 45104648404. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
helix-white
left a comment
There was a problem hiding this comment.
Approved at c26934e. The regenerated bindings and context-matrix regression address the earlier findings. The explicit context registrations and named regression now encode the security boundary. This head merges cleanly with master.
Remaining maintainer decision: Diagnostic mode still permits a LAN client to forget the drive and restart into setup. This PR closes the ordinary startup/setup exposure, not that existing diagnostic-mode takeover path. Whether to authenticate destructive recovery operations or require existing-account credentials when attaching a drive remains a decision for @dr-bonez; either changes recovery behavior.
The fix reuses rpc-toolkit's context filtering to remove all three destructive methods from init/setup rather than relying on Host validation or UI visibility. Runtime retains authenticated access and the CLI routes; diagnostic mode retains its dedicated forget/repair methods but loses the generic disk.repair alias. Generated schemas reflect those API removals. Persisted data and handler effects are unchanged; no migration is required.
Implementation diff: +16 / −74 lines in 5 files (excludes lockfiles, tests, docs, release notes, and changelog).
The regression test, adapted from my proposal, inspects the production UI API trees and CLI tree without executing disk operations. CI's start-core Tests & Man Pages passed at 0b64cb5, which contains the final Rust changes; the subsequent commit only refreshes generated schemas. Current-head formatting, changelog/version, and SDK/runtime/script checks pass. Current-head core tests, generated-bindings validation, other Rust suites and platform builds were still pending when inspected. The preceding generation job failed on the binding drift that this head commits.
Review was by code inspection; I ran no builds or tests and did not exercise the takeover chain end to end.
Helix-Harness: pi
Helix-Model: openai-codex/gpt-6.1-sol
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Diagnostic mode served rebuild, update, disk.forget and disk.repair to any LAN client. Forget followed by restart hands the server to the setup wizard, where attach accepts a new password. ShadowPasswordAuth admits these methods with the start9 user's password from /etc/shadow, which lives in the config overlay and so stays readable when the data drive will not mount. The password is accepted only over an encrypted session and shares the login rate limit. The local auth cookie still authorizes on-box CLI use, and while start9 has no usable hash every request is admitted. Error, logs and restart stay public. The diagnostic UI retries a rejected action after prompting for the password. The start9 shadow reader moves from mok.rs to auth.rs beside write_shadow; MOK enrollment keeps its existing lock-marker handling. Helix-Harness: claude-code Helix-Model: claude-opus-5-5
|
Extended per @dr-bonez: diagnostic mode now requires the server password (the start9 user's |
|
Takeover status: the implementation @dr-bonez asked for is already on this branch as 7171f35 ( The only edit to the description is the former "Open question for @dr-bonez: diagnostic mode" section. Its question is now answered, so I replaced it with "Diagnostic mode: password for changes", which describes what was built, the decisions involved (gating CI is running on 7171f35, and @helix-white's re-review is requested. |
Helix-Harness: pi Helix-Model: openai-codex/gpt-6.1-sol
helix-white
left a comment
There was a problem hiding this comment.
Reviewed 7171f35, including the diagnostic password follow-up. It merges cleanly with master. Two correctness issues need fixing:
-
Password guessing bypasses the rate limit by changing Host names.
middleware/auth/password.rs::authorizekeys the limiter withSecureSession::address(). In diagnostic mode,local_hosts_onlyaccepts any.localname, andDiagnosticContext::sig_contextadmits that same name into the encrypted exchange. A raw LAN client can connect to the same server IP withfirst.local,second.local, etc., establish a fresh possession session for each, and get a fresh three-attempt budget each time. No password or enrolled key is needed to open those sessions. The proposal reuses the existing limiter with a fixed diagnostic scope, preserving its ingress separation while preventing aliases or peer changes from renewing the budget. Its regression varies both the session name and peer IP. -
The new UI cannot authenticate valid passwords with surrounding whitespace. The setup password page passes its password unchanged, but
DiagnosticPassworduses the sharedPromptModal, whose Enter and button handlers both callsubmit(value.trim()). For example, a server password ofsecret passwordis always sent assecret passwordand rejected. The proposal fixes the shared prompt owner: masked values remain exact, ordinary values are trimmed once inside submission, and both submit paths use that owner. This also corrects existing masked backup-password prompts. While consolidating submission validation, it makes omittedrequiredmean required, matching the control's existing presentation instead of allowing whitespace-only ordinary input to submit as empty. Focused method-level cases cover these contracts without rendering a template.
Proposed changes: 7171f35...proposal/4884
These proposed changes and regressions are unexecuted; the implementing author must verify what it adopts. Review was by code inspection only: no builds, tests, lint, formatting checks or VM work. CI was still running when inspected.
Helix-Harness: pi
Helix-Model: openai-codex/gpt-6.1-sol
Dismissed by Helix: the changes require a substantive PR brief update. The reviewed explanation left diagnostic-mode exposure unchanged and its authentication policy unresolved. The new code gates diagnostic forget, repair, rebuild and update using local-cookie authorization or encrypted-session password verification, with an exception when no usable shadow hash exists, and adds password parameters and UI prompts. The brief must explain this expanded authentication policy and changed recovery behavior.
Key the password rate limit to a fixed diagnostic scope rather than the session's Host name, which a LAN client can vary per session. Masked prompt input is submitted without trimming. Helix-Harness: claude-code Helix-Model: claude-opus-5-5
The update flow now runs through DiagnosticPassword; cover the prompt-on- rejection retry and a dismissed prompt. Helix-Harness: claude-code Helix-Model: claude-opus-5-5
|
Addressed @helix-white's review of 7171f35:
Also fixed in 68bef84, a regression from my own 7171f35: the 7 diagnostic-update tests in Verified: start-core |
helix-white
left a comment
There was a problem hiding this comment.
Approved at 68bef84. Both findings are addressed: Host aliases share a fixed diagnostic password-attempt scope, and masked prompt input preserves the password exactly. The update harness now uses the real password helper and covers retry and dismissal. The head merges cleanly with master.
The original context-filtering fix removes drive forget/repair from unauthenticated init/setup APIs. The diagnostic follow-up additionally authenticates forget, repair, rebuild and update using the start9 user's shadow password, available without mounting the data drive, or the existing local cookie. Password verification requires an encrypted RPC session. The existing limiter allows three attempts per 20 seconds within each ingress scope; changing Host names, sessions or non-loopback peer IPs does not renew that budget. Runtime authentication and on-box CLI authorization remain intact.
Recovery policy: An absent, empty or locked start9 password field leaves diagnostic changes publicly available. An unlocked hash in an unsupported format rejects passwords; only SHA-512 crypt hashes, which StartOS writes, verify. Local-cookie CLI access remains available. Diagnostic error/log reads and restart stay public. Signed diagnostic updates now require authentication too, preventing unauthenticated selection of an older signed release. These are substantive changes from the earlier startup-only version of the PR.
The UI prompts after password rejection and retries with masked input. The shared prompt fix also preserves whitespace in backup passwords, keeps ordinary-input trimming in one submission owner, and makes omitted required mean required. The shadow-reader extraction preserves MOK enrollment's existing lock-marker handling; the author's flagged factory-hash enrollment policy remains unchanged by this PR.
Implementation diff: +320 / −147 lines in 22 files (excludes lockfiles, tests, docs, release notes, and changelog).
Evidence: The author reports 68 focused Rust tests, 111 RPC-client cases, shared/UI checks and formatting passing after adopting the proposal. Current-head CI passes formatting/lockfiles, changelog/version, SDK/runtime/script tests and license checks; core/man-page tests, generated-bindings validation, the other Rust suites and platform builds remain pending. I ran no tests. Under the approval-screenshot exception, I built the reviewed development UI and captured its actual password dialog in Chromium using mock diagnostic admission rejection; that establishes presentation, not real-server authentication or an end-to-end takeover check. The screenshot follows in an attachment comment.
Helix-Harness: pi
Helix-Model: openai-codex/gpt-6.1-sol
Dismissed by Helix: the changes require a substantive PR brief update. Rate limiting changes from session-Host keying to a fixed diagnostic scope, preventing aliases and new sessions from renewing the budget. Shared prompts now preserve masked whitespace and default omitted required to true, affecting diagnostic and backup-password dialogs as well as ordinary-input validation. These changed security and shared-form facts require a substantive brief update.
… and update When the diagnostic server rejects rebuild or update for lacking the server password, the CLI reads it from PASSWORD or a hidden prompt and retries once, instead of requiring the command to run on the server. Helix-Harness: claude-code Helix-Model: claude-opus-5-5
|
Per @dr-bonez: New test |
helix-white
left a comment
There was a problem hiding this comment.
Approved at f74b77a. The head merges cleanly with master. I traced the new CLI handler registration, RPC error conversion, ordinary calls and streamed admission; no new correctness issue found.
The fix removes destructive drive methods from unauthenticated init/setup APIs and requires authentication for diagnostic forget, repair, rebuild and update. Diagnostic password verification reads the start9 shadow hash without mounting the data drive and requires an encrypted RPC session; the local cookie still authorizes on-box CLI use. Password attempts share three attempts per 20 seconds within each ingress scope, independent of Host aliases or fresh sessions.
CLI follow-up: Remote diagnostic rebuild and diagnostic update now read PASSWORD, or use a hidden terminal prompt, after an IncorrectPassword response and retry once. Both streamed and non-progress updates use the same retry owner and existing password reader. Other errors never prompt or replay; a rejected second attempt is returned. Successful local-cookie calls do not prompt. The --trust override still requires local-cookie authorization.
Recovery policy remains deliberate: An absent, empty or locked start9 password field leaves diagnostic changes public. Unsupported unlocked hash formats reject passwords; SHA-512 crypt is supported. Diagnostic reads and restart stay public. The shared prompt preserves masked whitespace, including backup passwords, and defaults omitted required to required. MOK enrollment's existing lock-marker behavior is unchanged.
Implementation diff: +389 / −156 lines in 22 files (excludes lockfiles, tests, docs, release notes, and changelog).
Evidence: The author reports nine focused Rust tests passing for this follow-up, plus man-page/binding regeneration without drift and formatting checks. Earlier RPC-client and UI verification applies to the unchanged web code. Current-head Prettier, conflict and license checks pass; core/man-page tests, generated bindings, other suites, formatting/lockfiles, changelog/version checks and platform builds remain pending. I ran no builds or tests in this review pass and did not exercise a remote server end to end.
The web UI is unchanged by the CLI follow-up; this existing capture shows its password prompt using mock diagnostic replies:
Helix-Harness: pi
Helix-Model: openai-codex/gpt-6.1-sol
|
Handing off to @dr-bonez: @helix-white approved f74b77a, and the PR is mergeable. The description stays as the author wrote it, plus the diagnostic-mode section updated through f74b77a; @helix-white's approval review carries the brief. CI on f74b77a is still running, with no failures so far. Open decisions for you, also listed in the description:
|
Dismissed by Helix: the changes require a substantive PR brief update. Diagnostic rebuild and update gain password-aware CLI retries: after IncorrectPassword, they read PASSWORD or prompt secretly and retry once, including streamed and non-progress updates. This newly supports off-server CLI operation instead of failing authentication, so the substantive explanation must cover the added recovery workflow and credential source.
enroll_mok stripped the shadow lock marker, so a fresh Secure Boot install staged enrollment with the image's locked factory hash instead of waiting for setup to set the password, contrary to its own contract and the install path's. It now reads the start9 hash through the same reader as diagnostic password auth, which treats a locked password as unset. Helix-Harness: claude-code Helix-Model: claude-opus-5-5
Helix-Harness: claude-code Helix-Model: claude-opus-5-5
|
Per @dr-bonez, fixed the flagged Verified: |
helix-white
left a comment
There was a problem hiding this comment.
Approved at 397136b. The head merges cleanly with master. I reviewed the MOK follow-up against the previously reviewed head and traced installation, boot and password-writing callers. No new correctness blocker found.
The PR removes destructive drive methods from unauthenticated init/setup APIs using rpc-toolkit's existing context filtering. Diagnostic forget, repair, rebuild and update require the existing local cookie or the start9 shadow password, available without mounting the data drive. Password verification requires an encrypted RPC session and reuses the three-attempts-per-20-seconds login limiter under a fixed diagnostic scope; Host aliases and fresh sessions do not renew the budget. The diagnostic request types gain an optional password field, and generated bindings reflect both that addition and the init/setup method removals. No database migration is required.
Remote CLI rebuild and update read PASSWORD or prompt secretly after an IncorrectPassword rejection and retry once; ordinary and streamed updates share that retry owner. Other errors do not prompt or replay, and the update --trust override still requires local-cookie authorization. The UI prompts after rejection. The adopted shared-prompt correction preserves masked whitespace, including backup passwords, centralizes ordinary-input trimming, and defaults omitted required to required.
Additional Secure Boot fix: MOK enrollment no longer strips the password lock marker and stages enrollment using the locked factory hash. It now shares diagnostic authentication's unlocked-hash reader. Fresh installs skip enrollment until setup writes the chosen password; that existing write path then attempts enrollment. Reinstalls preserving an unlocked password retain their enrollment behavior, and already-enrolled certificates remain untouched. The production contract and separate changelog fragment record the change. The redundant raw shadow-field reader is removed.
Recovery policy: An absent, empty or locked start9 password field leaves diagnostic changes public. Unsupported unlocked hash formats reject passwords; only SHA-512 crypt verifies. Diagnostic reads and restart remain public. Signed diagnostic updates require authentication because callers can select an older signed release. The MOK correction does not change these diagnostic rules.
Implementation diff: +380 / −156 lines in 22 files (excludes lockfiles, tests, docs, release notes, and changelog).
Evidence: The author reports four focused hash/password/MOK tests and formatting passing for this follow-up. Earlier recorded verification includes nine focused CLI/password tests, 111 RPC-client cases, UI/shared checks and regeneration without drift. Current-head formatting, conflict, changelog/version and product-detection jobs are queued; full tests and builds have not yet reported for this head. This review used code inspection only, without builds or tests. No fresh-install/firmware enrollment or real-server diagnostic flow was exercised in this review.
The web UI is unchanged by this follow-up; the existing capture shows its masked diagnostic password prompt with mock diagnostic replies:
Helix-Harness: pi
Helix-Model: openai-codex/gpt-6.1-sol
|
Handing off to @dr-bonez: @helix-white approved 397136b, the MOK enrollment fix, and the PR is mergeable. CI on 397136b is queued or running, with no failures so far. Still open for your decision: |
Dismissed by Helix: the changes require a substantive PR brief update. MOK enrollment now skips locked start9 password hashes instead of stripping the lock marker and enrolling with the factory hash. Fresh-install enrollment is deferred until setup writes the chosen password. The reviewed brief must replace its claim that MOK lock-marker behavior is unchanged with this additional Secure Boot fix; the new changelog documents that substantive change.
…rget-auth Helix-Harness: claude-code Helix-Model: claude-opus-5-5 # Conflicts: # shared-libs/ts-modules/shared/src/i18n/dictionaries/de.ts # shared-libs/ts-modules/shared/src/i18n/dictionaries/en.ts # shared-libs/ts-modules/shared/src/i18n/dictionaries/es.ts # shared-libs/ts-modules/shared/src/i18n/dictionaries/fr.ts # shared-libs/ts-modules/shared/src/i18n/dictionaries/pl.ts
|
Merged Verified on the merge: |
helix-white
left a comment
There was a problem hiding this comment.
Approved at 29aaaef. The head merges cleanly with master. I compared the complete PR-owned diffs before and after base integration, inspected the merge's conflict resolutions and traced overlapping CLI/dialog callers. No new correctness blocker found.
The merge preserves master's Get help translation at ID 1311 and moves this PR's password instruction to 1312 consistently across English, German, Spanish, French and Polish. The English-key lookup resolves the new ID; wording and translations are unchanged. The remaining differences are upstream integration and diff offsets, not additional PR behavior.
The PR removes destructive drive methods from unauthenticated init/setup APIs using rpc-toolkit's existing context filtering. Diagnostic forget, repair, rebuild and update require the existing local cookie or the start9 shadow password, available without mounting the data drive. Password verification requires an encrypted RPC session and reuses the three-attempts-per-20-seconds login limiter under a fixed diagnostic scope; Host aliases and fresh sessions do not renew the budget. The diagnostic request types gain an optional password field, and generated bindings reflect both that addition and the init/setup method removals. No database migration is required.
Remote CLI rebuild and update read PASSWORD or prompt secretly after an IncorrectPassword rejection and retry once; ordinary and streamed updates share that retry owner. Other errors do not prompt or replay, and the update --trust override still requires local-cookie authorization. The UI prompts after rejection. The adopted shared-prompt correction preserves masked whitespace, including backup passwords, centralizes ordinary-input trimming, and defaults omitted required to required.
Additional Secure Boot fix: MOK enrollment no longer strips the password lock marker and stages enrollment using the locked factory hash. It now shares diagnostic authentication's unlocked-hash reader. Fresh installs skip enrollment until setup writes the chosen password; that existing write path then attempts enrollment. Reinstalls preserving an unlocked password retain their enrollment behavior, and already-enrolled certificates remain untouched. The production contract and separate changelog fragment record the change. The redundant raw shadow-field reader is removed.
Recovery policy: An absent, empty or locked start9 password field leaves diagnostic changes public. Unsupported unlocked hash formats reject passwords; only SHA-512 crypt verifies. Diagnostic reads and restart remain public. Signed diagnostic updates require authentication because callers can select an older signed release. The MOK correction does not change these diagnostic rules.
Implementation diff: +380 / −156 lines in 22 files (excludes lockfiles, tests, docs, release notes, and changelog).
Evidence: On this merge the author reports i18n, shared/UI checks and all 111 RPC-client cases passing. Earlier recorded verification includes four focused hash/password/MOK tests, nine focused CLI/password tests, formatting and generation without drift. Current-head Prettier, conflict checking and product detection were running when inspected; changelog/version checks and the StartWRT binary build were queued, with full tests and remaining builds not yet reported. This review used code inspection only, without builds or tests. No fresh-install/firmware enrollment or real-server diagnostic flow was exercised in this review.
The diagnostic password dialog is unchanged by the merge; this existing capture shows its masked prompt with mock diagnostic replies:
Helix-Harness: pi
Helix-Model: openai-codex/gpt-6.1-sol
|
Handing off to @dr-bonez: @helix-white approved 29aaaef, the master merge that renumbers the conflicting i18n key, and the PR is mergeable. CI on 29aaaef is still running with no failures, including the start-core job that covers the Rust side of the merge. The open decisions are unchanged from my previous handoff comment. |
|
|
…rget-auth Helix-Harness: claude-code Helix-Model: claude-opus-5-5 # Conflicts: # shared-libs/crates/start-core/ARCHITECTURE.md # shared-libs/ts-modules/shared/src/i18n/dictionaries/de.ts # shared-libs/ts-modules/shared/src/i18n/dictionaries/en.ts # shared-libs/ts-modules/shared/src/i18n/dictionaries/es.ts # shared-libs/ts-modules/shared/src/i18n/dictionaries/fr.ts # shared-libs/ts-modules/shared/src/i18n/dictionaries/pl.ts
|
Merged
The merge commit contains only base integration and those two resolutions. Verified on the merge: |
helix-white
left a comment
There was a problem hiding this comment.
Approved at 383fca7. The head merges cleanly with master. I compared the complete PR-owned diffs before and after base integration, inspected the conflict resolutions and overlapping upstream changes. No new correctness blocker found.
The merge preserves master's Last synced and just now strings and consistently moves this PR's unchanged password instruction to ID 1314 across all five dictionaries. The architecture resolution retains this PR's diagnostic-auth contract and master's registry-cache documentation. Auto-merged init/setup schemas still omit the destructive methods, and the diagnostic schema keeps the optional password. The upstream database-subscription subtree is empty in those contexts. Authentication, CLI retries and MOK behavior are unchanged by this merge.
The PR removes destructive drive methods from unauthenticated init/setup APIs using rpc-toolkit's existing context filtering. Diagnostic forget, repair, rebuild and update require the existing local cookie or the start9 shadow password, available without mounting the data drive. Password verification requires an encrypted RPC session and reuses the three-attempts-per-20-seconds login limiter under a fixed diagnostic scope; Host aliases and fresh sessions do not renew the budget. The diagnostic request types gain an optional password field, and generated bindings reflect both that addition and the init/setup method removals. No database migration is required.
Remote CLI rebuild and update read PASSWORD or prompt secretly after an IncorrectPassword rejection and retry once; ordinary and streamed updates share that retry owner. Other errors do not prompt or replay, and the update --trust override still requires local-cookie authorization. The UI prompts after rejection. The adopted shared-prompt correction preserves masked whitespace, including backup passwords, centralizes ordinary-input trimming, and defaults omitted required to required.
Additional Secure Boot fix: MOK enrollment no longer strips the password lock marker and stages enrollment using the locked factory hash. It now shares diagnostic authentication's unlocked-hash reader. Fresh installs skip enrollment until setup writes the chosen password; that existing write path then attempts enrollment. Reinstalls preserving an unlocked password retain their enrollment behavior, and already-enrolled certificates remain untouched. The production contract and separate changelog fragment record the change. The redundant raw shadow-field reader is removed.
Recovery policy: An absent, empty or locked start9 password field leaves diagnostic changes public. Unsupported unlocked hash formats reject passwords; only SHA-512 crypt verifies. Diagnostic reads and restart remain public. Signed diagnostic updates require authentication because callers can select an older signed release. The MOK correction does not change these diagnostic rules.
Implementation diff: +380 / −156 lines in 22 files (excludes lockfiles, tests, docs, release notes, and changelog).
Evidence: On this merge the author reports i18n, shared/UI checks, all 103 RPC-client cases (including diagnostic-password and prompt cases), and scoped Prettier passing. Earlier verification includes four focused hash/password/MOK tests, nine focused CLI/password tests and generation without drift. Current-head conflict checking and product detection pass; Prettier, changelog/version checks and platform builds are running, with full tests and generated-bindings results not yet reported. The preceding head's SDK/runtime/script check failed in an upstream FileHelper timing test; the author reproduced that failure once in eight runs, and the current-head result is still pending. This review used code inspection only, without builds or tests. No fresh-install/firmware enrollment or real-server diagnostic flow was exercised in this review.
The diagnostic password dialog is unchanged by the merge; this existing capture shows its masked prompt with mock diagnostic replies:
Helix-Harness: pi
Helix-Model: openai-codex/gpt-6.1-sol
|
Handing off to @dr-bonez: @helix-white approved 383fca7, the second master merge, and the PR is mergeable. CI on 383fca7 is running with no failures so far. The open decisions are unchanged from the earlier handoff comments. |

diagnostic.disk.forget,diagnostic.disk.repairanddisk.repairwere registered generic over the context, so every server that mountsmain_apiserved them, including the init and setup servers. Neither of those runs auth middleware;local_hosts_onlyonly checks that the Host is an IP,localhostor a.localname. As a result, any client on the LAN could calldiagnostic.disk.forgetwith no session during the startup window on every boot. That call deletes the hostname override, both identity keys anddisk.guid, so the next boot lands in the setup wizard, wheresetup.attachopens the existing data drive with the fixed LUKS key and sets whatever password the caller supplies. Reported by an outside researcher on v0.4.3-rc.3; the same code shipped in v0.4.2.1.This registers each handler only for the contexts whose UI calls it:
diagnostic.disk.forget/diagnostic.disk.repair:DiagnosticContext(the diagnostic page) andRpcContext(the authenticated CLI path).disk.repair:RpcContextonly (the System → General page).The init and setup trees lose the three methods. No init or setup-wizard UI calls them.
The only other handlers generic over the context are read-only (
git-info, the effects host IP,net.dns.query).A regression test in
diagnostic.rspins this down against the real UI API trees: all three methods are absent from init and setup, the diagnostic pair stays in diagnostic mode, all three stay in runtime and CLI, and runtime keeps authentication on. The init, setup and diagnostic bindings are regenerated from CI's artifact.Verification:
start-core Tests & Man Pagespasses with the new test, andmake start-core-format-checkpasses.Diagnostic mode: password for changes
DiagnosticContextservedmain_apiwithauthenticated: false, so a LAN client could calldiagnostic.disk.forgetand thendiagnostic.restartwhile the server sat in diagnostic mode, and take it over through setup. Per @dr-bonez, destructive diagnostic actions now require the server password, read from/etc/shadow, so they still work when the data drive won't mount.ShadowPasswordAuth(middleware/auth/password.rs) joins the diagnostic server'sAuthchain after local-cookie auth. It checks apasswordparameter against thestart9user's SHA-512 crypt hash, whichwrite_shadowkeeps in the config overlay. It accepts the password only over an encrypted RPC session, and it uses the login rate limiter (login_rate_limit::check) under one fixed diagnostic scope, so Host aliases and new sessions don't reset the budget.diagnostic.rebuild,diagnostic.update,diagnostic.disk.forgetanddiagnostic.disk.repair, which now carryauthenticated: true.diagnostic.error,logs,kernel-logsandrestartstay public.start9has no usable hash (absent, or locked as on a fresh image), every request is admitted, as before.start-cli, includingdiagnostic rebuildanddiagnostic update --trust. Off the server,start-cli diagnostic rebuildanddiagnostic updateread the password fromPASSWORDor a hidden prompt after a password rejection, and retry once.requirednow means required.IncorrectPassword, the UI prompts for the master password (masked) and retries. A wrong password shows the error and prompts again.diagnostic.updatewas deliberately public (fix(start-os): persist diagnostic OS signers and authenticate trust overrides #4577'sdiagnostic_ui_keeps_signed_updates_public). I gated it because a caller pickstargetVersionand can downgrade to an older signed release. The test now asserts the update requires authentication.start9shadow reader moved fromutil/mok.rstoauth.rs, next towrite_shadow, so MOK enrollment and this check share one parser.Fixed while here:
enroll_mokstripped the lock marker and enrolled with a lockedstart9hash, despite its doc and the install path saying a missing password skips enrollment. On a fresh Secure Boot install that staged enrollment with the image's locked factoryembassyhash before setup. It now reads through the samestart9_password_hashas the diagnostic check, so a locked password counts as unset and setup'swrite_shadowenrolls. Reinstalls that keep the config overlay carry the real$6$hash and are unaffected. Covered bystart9_password_hash_ignores_locked_and_unset_passwords, with its own changelog fragment.Hash formats: only
$6$(what StartOS writes) verifies. A hash in another format, such as a dev image's yescryptembassyhash, rejects every password, which leaves on-box local auth as the way in.Verification (diagnostic follow-up): ran the start-core tests for
diagnostic::,middleware::auth::,update::diagnosticandutil::mok(68 passed). New tests coverauthorize(unset/locked admits, missing/wrong/unencrypted rejected, rate limit),Authordering (password is checked only when no other credential passed, and its error surfaces), and per-method diagnostic metadata. Also ranmake start-core-ts-bindings,npm run check:ui,npm run check:i18n, prettier andmake start-core-format-check.review effort: 'high'
🤖 Generated with Claude Code
Helix-Harness: claude-code
Helix-Model: claude-opus-5-5