Skip to content

fix(start-os): keep the SMTP password out of the public database - #4892

Merged
MattDHill merged 4 commits into
integration/registry-cache-syncfrom
fix/smtp-password-private
Nov 23, 2026
Merged

MattDHill merged 4 commits into
integration/registry-cache-syncfrom
fix/smtp-password-private

Conversation

@MattDHill

Copy link
Copy Markdown
Member

Summary

serverInfo.smtp held the SMTP password in plain text. The public database is streamed to every authenticated browser, and since #4752 (RC3) each browser also keeps a copy in IndexedDB. So the password went to every signed-in browser and sat on its disk.

  • Storage. The full settings, password included, move to private.smtp. serverInfo.smtp becomes SmtpInfo: host, port, from, username, security and passwordSet.
  • server.set-smtp now takes SetSmtpParams, which adds keepPassword (CLI --keep-password). With it and no password, the saved password is kept. Without it, behavior is as before: a missing password means none.
  • server.test-smtp's password is now optional. If omitted, the saved password is used, but only when the host, port and username match the saved settings, so a test against another host can't extract it.
  • Services. The get-system-smtp effect reads and watches private.smtp, so services still get the password and their callbacks still fire on changes.
  • UI. The SMTP page no longer pre-fills the password. When one is saved it says so; saving with the field empty keeps it, and "Remove saved password" clears it. A test email with an empty field uses the saved password. Two new strings are in all five dictionaries.
  • Migration. v0_4_3 goes to migration revision 4. up() copies an existing public SMTP value to private.smtp and replaces password with passwordSet. It skips a value that already has passwordSet, so it's idempotent with revision 3, which the rest of up() and post_up() already were. down() restores the public value. The existing revision test now also covers revision 3, and three new tests cover the move, an unset password and no SMTP at all.

The public-database exposure itself predates RC3, so there's a security changelog fragment.

Needs regeneration

The TypeScript bindings (SmtpInfo, SetSmtpParams, the optional test password) and the man pages for server set-smtp and server test-smtp are stale. Commit the generated-artifacts output from the Generated Artifacts job. Until then, check:ui fails only on those types: passwordSet on serverInfo.smtp and keepPassword on the set-smtp params.

Verification

  • make start-core-format-check: clean.
  • npm run check:i18n: all keys valid.
  • Prettier and the lint-staged hooks: clean.
  • npm run check:ui: fails only on the two stale-binding errors above.
  • Not run: no Rust compile or test locally; CI is the first build.

review effort: 'high'

🤖 Generated with Claude Code

serverInfo.smtp carried the SMTP password, and the public database is
streamed to every authenticated browser and, since #4752, persisted in
each browser's IndexedDB. The full SMTP settings now live in
private.smtp; serverInfo.smtp holds the same settings with a
passwordSet flag instead of the password.

- server.set-smtp takes keepPassword, which retains the saved password
  when none is given. Without it the behavior is unchanged.
- server.test-smtp takes an optional password; omitted, it uses the
  saved password only for the saved host, port and username.
- The get-system-smtp effect reads private.smtp, so services still
  receive the password.
- The 0.4.3 migration (revision 4) moves an existing password into
  private.smtp and is idempotent with revision 3.
- The SMTP page no longer pre-fills the password; it says one is saved
  and offers to remove it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@MattDHill
MattDHill changed the base branch from master to integration/registry-cache-sync November 23, 2026 17:55

@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.

Two changes needed before approval:

  1. [P1] Commit the generated bindings and man pages. The acknowledged regeneration gap is a current build failure, not just documentation drift: the riscv64 build fails compiling the SMTP page against the committed SmtpValue/set-SMTP schema. Regenerate and commit the artifacts, then verify the affected callers against that result. The proposal intentionally does not hand-edit generated files.

  2. [P2] Reset the form after a password-only save (smtp.component.ts, save). Replacing an existing password keeps all public SmtpInfo fields unchanged, including passwordSet: true. Consequently the serverInfo.smtp watch no longer rebuilds the form as it did when the password was public. A successful password replacement leaves Save enabled, Cancel visible, and the replacement password in the control; subsequent saves silently keep resubmitting that password rather than using the saved-password path. The proposal clears the password and dirty state explicitly after a successful save, leaves failed edits intact, and adds focused regression coverage without a public-update event.

Proposed changes: d00dcbf...proposal/4892

Reviewed storage projection, migration normalization/idempotence, service-effect watching, saved-password test selection, and the form flows. git merge-tree confirms a clean merge with integration/registry-cache-sync. No builds, tests, or typechecks run during review; the proposed tests are unexecuted and need author verification. Other CI checks remain pending.

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

helix-white and others added 3 commits November 23, 2026 11:39
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…asswords

From the generated-artifacts and generated-man-pages outputs of run 45232893506.

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.

Approved at 6b766cd5f. Both earlier findings are addressed: the generated contracts/man pages are committed, and password-only saves explicitly clear the password control and dirty state while failed saves retain edits. The migration revision expectation is also corrected. The branch merges cleanly with integration/registry-cache-sync.

The password previously traveled with the public database to authenticated browsers and their IndexedDB caches. Full SmtpValue settings now belong to private.smtp; public SmtpInfo replaces the password with passwordSet. Migration revision 4 moves existing settings and supports reruns; downgrade restores the previous representation. Services reuse their existing database watch against the private value, preserving credential access and change callbacks. Previously stored browser copies are replaced on resynchronization, not remotely erased from offline browsers.

SetSmtpParams adds keepPassword, defaulting to false; the UI opts in when its blank password field means “keep.” That explicit save option retains the password even if endpoint fields change. TestSmtpParams.password becomes optional, with saved-password fallback restricted to the saved host, port and username. System → SMTP displays the saved-password message and removal action instead of prefilling credentials. Screenshots of this head with mock data follow in a separate comment.

Implementation diff: +336 / −193 lines in 19 files (excludes lockfiles, tests, docs, release notes, and changelog). Generated runtime schemas/catalog metadata are included.

For screenshots only, I built the reviewed head with npm run build:ui:dev through the build cache and rendered the actual page in Chromium using the mock API. No tests or live SMTP delivery were run during review. Current CI has passed formatting, changelog/version checks, dependency licenses, and SDK/runtime/script tests; start-core tests/man pages, generated bindings/MCP checks, other Rust suites, and platform builds remain pending. The added form regression tests therefore are not claimed as passed here.

The description's “Needs regeneration” section and stale-binding verification result are now obsolete.

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

@helix-white

Copy link
Copy Markdown
Member

Reviewed head with mock SMTP data: the password field is empty, with a saved-password notice and removal action.

Selecting Remove saved password stages the change; Save commits it and Cancel discards it.

@MattDHill
MattDHill merged commit 1c1e676 into integration/registry-cache-sync Nov 23, 2026
49 checks passed
@MattDHill
MattDHill deleted the fix/smtp-password-private branch November 23, 2026 20:07
dr-bonez pushed a commit that referenced this pull request Nov 24, 2026
…ache integration (#4903)

Revert "Merge pull request #4892 from Start9Labs/fix/smtp-password-private"

This reverts commit 1c1e676, reversing
changes made to 4c758d3.

Helix-Harness: claude-code
Helix-Model: claude-opus-5-5
MattDHill added a commit that referenced this pull request Nov 25, 2026
Re-lands #4892 on master; #4903 took it back out of
integration/registry-cache-sync so #4898 carried no SMTP change.

The full SMTP settings move to private.smtp; serverInfo.smtp becomes
SmtpInfo (no password, plus passwordSet). set-smtp takes keepPassword,
test-smtp falls back to the saved password when host, port and username
match, and get-system-smtp watches private.smtp. The SMTP page no longer
prefills the password, notes when one is saved and can remove it.

The 0.4.3 migration goes to revision 5 (master's revision 4 is the
shared-volume rename); hide_smtp_password skips a value that already has
passwordSet, so it is idempotent with revision 4. The new web strings
take IDs 1315/1316.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: helix-white <267227783+helix-a@users.noreply.github.com>
Co-Authored-By: helix-red <355572797+helix-red@users.noreply.github.com>
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.

2 participants