Skip to content

fix(start-os): serve drive forget and repair only in diagnostic and normal contexts - #4884

Merged
dr-bonez merged 12 commits into
masterfrom
fix/startup-disk-forget-auth
Nov 24, 2026
Merged

dr-bonez merged 12 commits into
masterfrom
fix/startup-disk-forget-auth

Conversation

@MattDHill

@MattDHill MattDHill commented Nov 23, 2026 •

Copy link
Copy Markdown
Member

diagnostic.disk.forget, diagnostic.disk.repair and disk.repair were registered generic over the context, so every server that mounts main_api served them, including the init and setup servers. Neither of those runs auth middleware; local_hosts_only only checks that the Host is an IP, localhost or a .local name. As a result, any client on the LAN could call diagnostic.disk.forget with no session during the startup window on every boot. That call deletes the hostname override, both identity keys and disk.guid, so the next boot lands in the setup wizard, where setup.attach opens 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) and RpcContext (the authenticated CLI path).
  • disk.repair: RpcContext only (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.rs pins 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 Pages passes with the new test, and make start-core-format-check passes.

Diagnostic mode: password for changes

DiagnosticContext served main_api with authenticated: false, so a LAN client could call diagnostic.disk.forget and then diagnostic.restart while 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.

  • New ShadowPasswordAuth (middleware/auth/password.rs) joins the diagnostic server's Auth chain after local-cookie auth. It checks a password parameter against the start9 user's SHA-512 crypt hash, which write_shadow keeps 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.
  • It applies to diagnostic.rebuild, diagnostic.update, diagnostic.disk.forget and diagnostic.disk.repair, which now carry authenticated: true. diagnostic.error, logs, kernel-logs and restart stay public.
  • "If available": when start9 has no usable hash (absent, or locked as on a fresh image), every request is admitted, as before.
  • The local auth cookie still authorizes on-box start-cli, including diagnostic rebuild and diagnostic update --trust. Off the server, start-cli diagnostic rebuild and diagnostic update read the password from PASSWORD or a hidden prompt after a password rejection, and retry once.
  • The shared prompt submits masked input without trimming, so passwords with surrounding spaces work. This also affects the existing backup-password prompts. An omitted required now means required.
  • Diagnostic UI: forget, repair and update try first with no password. If the server rejects with IncorrectPassword, the UI prompts for the master password (masked) and retries. A wrong password shows the error and prompts again.
  • diagnostic.update was deliberately public (fix(start-os): persist diagnostic OS signers and authenticate trust overrides #4577's diagnostic_ui_keeps_signed_updates_public). I gated it because a caller picks targetVersion and can downgrade to an older signed release. The test now asserts the update requires authentication.
  • Cleanup: the start9 shadow reader moved from util/mok.rs to auth.rs, next to write_shadow, so MOK enrollment and this check share one parser.

Fixed while here: enroll_mok stripped the lock marker and enrolled with a locked start9 hash, 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 factory embassy hash before setup. It now reads through the same start9_password_hash as the diagnostic check, so a locked password counts as unset and setup's write_shadow enrolls. Reinstalls that keep the config overlay carry the real $6$ hash and are unaffected. Covered by start9_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 yescrypt embassy hash, 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::diagnostic and util::mok (68 passed). New tests cover authorize (unset/locked admits, missing/wrong/unencrypted rejected, rate limit), Auth ordering (password is checked only when no other credential passed, and its error surfaces), and per-method diagnostic metadata. Also ran make start-core-ts-bindings, npm run check:ui, npm run check:i18n, prettier and make start-core-format-check.

review effort: 'high'

🤖 Generated with Claude Code

Helix-Harness: claude-code
Helix-Model: claude-opus-5-5

…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 helix-white left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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:

  1. Commit the regenerated bindings, as already noted in the description. rpc/init.schemas.ts and rpc/setup.schemas.ts still 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.
  2. 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

MattDHill and others added 2 commits November 22, 2026 20:12
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
helix-white previously approved these changes Nov 23, 2026

@helix-white helix-white left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
@helix-red

Copy link
Copy Markdown
Contributor

Extended per @dr-bonez: diagnostic mode now requires the server password (the start9 user's /etc/shadow hash, readable without the data drive) for rebuild, update, disk.forget and disk.repair. The local cookie still authorizes on-box CLI use, and every request is admitted while start9 has no usable hash. Details are in the updated description under "Diagnostic mode: password for changes". Re-requesting review since the scope changed.

@helix-red

Copy link
Copy Markdown
Contributor

Takeover status: the implementation @dr-bonez asked for is already on this branch as 7171f35 (fix(start-os): require the server password for diagnostic changes), on top of 21a2a51. It was pushed to the existing head branch; the original commits and attribution are unchanged.

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 diagnostic.update, which reverses #4577's public-update test, and leaving restart public) and the verification. The rest of the description is as written.

CI is running on 7171f35, and @helix-white's re-review is requested.

helix-white added a commit that referenced this pull request Nov 23, 2026
Helix-Harness: pi
Helix-Model: openai-codex/gpt-6.1-sol

@helix-white helix-white left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed 7171f35, including the diagnostic password follow-up. It merges cleanly with master. Two correctness issues need fixing:

  1. Password guessing bypasses the rate limit by changing Host names. middleware/auth/password.rs::authorize keys the limiter with SecureSession::address(). In diagnostic mode, local_hosts_only accepts any .local name, and DiagnosticContext::sig_context admits that same name into the encrypted exchange. A raw LAN client can connect to the same server IP with first.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.

  2. The new UI cannot authenticate valid passwords with surrounding whitespace. The setup password page passes its password unchanged, but DiagnosticPassword uses the shared PromptModal, whose Enter and button handlers both call submit(value.trim()). For example, a server password of secret password is always sent as secret password and 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 omitted required mean 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

@helix-red
helix-red dismissed stale reviews from helix-white and helix-white November 23, 2026 18:13

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.

helix-white and others added 2 commits November 23, 2026 18:49
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
@helix-red

Copy link
Copy Markdown
Contributor

Addressed @helix-white's review of 7171f35:

  1. Rate limit bypass via Host aliases: adopted the proposal unchanged in 30cf918 (authored by @helix-white). Password attempts now count against one fixed diagnostic scope instead of the session's Host name. The new startup_host_aliases_share_the_password_attempt_budget test passes; against the old keying it would fail, since each alias got a fresh budget.
  2. Trimmed passwords: adopted the shared PromptModal fix unchanged in the same commit. Masked input is submitted exactly as typed, ordinary input is trimmed once inside submit, and an omitted required means required. The new prompt-submission test passes.

Also fixed in 68bef84, a regression from my own 7171f35: the 7 diagnostic-update tests in check:rpc-clients failed because the harness didn't inject DiagnosticPassword. The harness now builds the real one from the same mocks. Two new cases cover a retry with the prompted password (passed unchanged, useMask on) and a dismissed prompt (no retry).

Verified: start-core middleware::auth:: and diagnostic:: (68 passed), npm run check:rpc-clients (111/111), check:shared, check:ui, prettier, and make start-core-format-check. The description's rate-limit and prompt lines are updated.

helix-white
helix-white previously approved these changes Nov 23, 2026

@helix-white helix-white left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

@helix-white

Copy link
Copy Markdown
Member

Diagnostic password prompt after Repair drive requests authentication. Captured from reviewed head 68bef845d with mock diagnostic responses; the example password is masked.

@helix-red
helix-red dismissed helix-white’s stale review November 23, 2026 19:06

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
@helix-red

Copy link
Copy Markdown
Contributor

Per @dr-bonez: start-cli diagnostic rebuild and diagnostic update no longer need to run on the server. When the diagnostic server rejects the call for lacking the password, the CLI reads the server password from PASSWORD or a hidden prompt and retries once. A non-password error never prompts. rebuild now has a CLI handler of its own, like update. Its server handler is unchanged, and the generated man pages and bindings came out the same.

New test cli_prompts_once_after_a_password_rejection. Verified: start-core diagnostic::, middleware::auth::password and update::diagnostic (9 passed), make manpages, make start-core-ts-bindings (no drift), make start-core-format-check and prettier. Re-requesting review.

helix-white
helix-white previously approved these changes Nov 23, 2026

@helix-white helix-white left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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:

Diagnostic password prompt with masked example input

Helix-Harness: pi
Helix-Model: openai-codex/gpt-6.1-sol

@helix-red

Copy link
Copy Markdown
Contributor

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:

  1. diagnostic.update now requires authentication, which reverses fix(start-os): persist diagnostic OS signers and authenticate trust overrides #4577's deliberately public diagnostic update. Whoever calls it chooses targetVersion, so an unauthenticated update could downgrade to an older signed release.
  2. diagnostic.restart stays public.
  3. Only SHA-512 crypt ($6$) hashes verify. Any other format, such as a dev image's yescrypt embassy hash, leaves on-box local auth as the way in.
  4. Flagged, not changed: enroll_mok enrolls a locked start9 hash, although its doc says it skips one.

@helix-red
helix-red dismissed helix-white’s stale review November 23, 2026 20:46

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
@helix-red

Copy link
Copy Markdown
Contributor

Per @dr-bonez, fixed the flagged enroll_mok defect instead of leaving it (e5ab0df, changelog fragment in the next commit). It stripped the ! lock marker, so a fresh Secure Boot install staged MOK enrollment with the image's locked factory hash before setup. That contradicted both its own doc and os_install's "a fresh install has none until setup". It now uses the shared start9_password_hash, which treats a locked password as unset, so setup's write_shadow performs the enrollment. Reinstalls that preserve the config overlay are unaffected, and the separate raw-field reader is gone.

Verified: auth::shadow_tests (new; its locked factory case is the one the old reader accepted), middleware::auth::password and util::mok (4 passed), make start-core-format-check, and prettier on the fragment. Re-requesting review.

@helix-white helix-white left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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:

Diagnostic password prompt with masked example input

Helix-Harness: pi
Helix-Model: openai-codex/gpt-6.1-sol

@helix-red

Copy link
Copy Markdown
Contributor

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: diagnostic.update now needs authentication, which reverses #4577; diagnostic.restart stays public; and only SHA-512 crypt hashes verify. The MOK item is now fixed rather than flagged.

@helix-red
helix-red dismissed helix-white’s stale review November 23, 2026 21:51

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
@helix-red

Copy link
Copy Markdown
Contributor

Merged origin/master (55d207b) in 29aaaef. The only conflict was an i18n key collision in all five web dictionaries: master's 'Get help' and this PR's 'Enter your master password to continue.' both took key 1311. Master keeps 1311, and this PR's string moves to 1312 with its translations unchanged. The merge commit contains nothing beyond base integration and that renumbering.

Verified on the merge: npm run check:i18n, check:shared, check:ui and check:rpc-clients (111/111). The Rust side merged without conflicts; CI's start-core job covers it. Re-requesting review.

@helix-white helix-white left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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:

Diagnostic password prompt with masked example input

Helix-Harness: pi
Helix-Model: openai-codex/gpt-6.1-sol

@helix-red

Copy link
Copy Markdown
Contributor

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.

@helix-red

Copy link
Copy Markdown
Contributor

SDK, Runtime & Script Tests failed on 29aaaef in FileHelper watch retry backoff › resets backoff to 100ms after recovery (existing file change) (projects/start-sdk/lib/test/fileHelper.watch.test.ts:371, expected v2, received null). The cause is unrelated to this PR. That test arrived from master through the merge (#4849, 77926bb), and this PR changes nothing in FileHelper. Master's test run passed at 55d207b. Running that file 8 times locally on this head failed once, so the test is timing-flaky. I'll rerun the failed job once the workflow's remaining jobs finish; GitHub refuses a rerun while sibling jobs are still running. The flake itself belongs with #4849's owner, not this PR.

…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
@helix-red

Copy link
Copy Markdown
Contributor

Merged origin/master (446ce76) in 383fca7. There were two conflicts, and both resolutions keep each side's changes:

  • Web i18n dictionaries (all five): master added 'Last synced' (1312) and 'just now' (1313). This PR's 'Enter your master password to continue.' moves from 1312 to 1314, with its translations unchanged.
  • shared-libs/crates/start-core/ARCHITECTURE.md: a two-line hunk where each side edited a different line. This PR appended the diagnostic-auth sentences to the signer-files paragraph, and master rewrote the registry-cache paragraph. Against the merge base, each side's untouched line was the base text, so the resolution takes this PR's line and master's line.

The merge commit contains only base integration and those two resolutions. Verified on the merge: npm run check:i18n, check:shared, check:ui, check:rpc-clients (103/103, including this PR's diagnostic-password and prompt cases), and prettier on the conflicted and generated files. The Rust side merged without conflicts; CI's start-core and generated-bindings jobs cover it and the auto-merged schemas. Re-requesting review.

@helix-white helix-white left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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:

Diagnostic password prompt with masked example input

Helix-Harness: pi
Helix-Model: openai-codex/gpt-6.1-sol

@helix-red

Copy link
Copy Markdown
Contributor

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants