Skip to content

feat(browser): design secure vault backup and portability #32

Closed

Description

@trmosala

Problem

There is no portable encrypted vault backup/recovery workflow.

Implementation order

Browser backlog item 28 of 29. Phase: Optional conveniences. This is ordered planning, not a claim that Codex implements every item. Items 24–29 are optional additions.

Acceptance criteria

  • Define threat model and encrypted export/import format before implementation.
  • Require explicit authenticated export/import, integrity validation and collision handling.
  • Test wrong keys, tampering and interruption; document OS-key-loss limitations.

Dependencies

Engineering and validation

Reuse existing Chromium/Electron/OS facilities where available. Preserve main-process ownership and permission enforcement, add no placeholder controls, use existing i18n patterns, and test behavior with synthetic fixtures. Document platform limitations. Baseline: browser-tabs at 47fef3e; see packages/cm-browser/README.md and password-security.md.

Activity

  1. trmosala commented on Sep 18, 2026

    @trmosala
    OwnerAuthor

    Implemented and published in 65b6a839a (feat(browser): add encrypted vault backups).

    The design is documented before the rest of the password security evidence in packages/cm-browser/password-security.md. The portable format is separate from the live OS-wrapped vault: scrypt (N=65536, r=8, p=1) derives an AES-256-GCM key from a user passphrase, and fixed context plus all format/KDF/cipher parameters are authenticated. Live vault keys and record IDs are never exported.

    Both export and import require an unlocked vault plus a fresh OS reauthentication. Passphrases use the non-persistent native Windows credential control; export requires two matching entries. Import authenticates and validates the complete file before showing add/replace/unchanged/duplicate counts, then rechecks task/window/vault ownership and the encrypted destination baseline before the existing atomic vault writer commits. Existing origin+username IDs are retained; new records receive fresh IDs. Existing files are never overwritten.

    Verification:

    • portable format and atomic publication: 5/5 tests, covering wrong passphrases, ciphertext/header tampering, unknown fields, live-ID exclusion, collision preservation, and interruption before publication
    • complete desktop browser suite: 191/191 tests, 2,584 expectations
    • app browser tests and native translation tests passed
    • desktop and app typechecks passed
    • one serial full Windows native browser smoke passed on Chromium 152
    • scoped lint: 0 errors; normal push hook: 31/31 typechecks

    Limits remain explicit: native backup passphrase entry is currently Windows-only; backups exclude contacts/cookies/history/settings; no forgotten-passphrase recovery; a copied backup permits offline passphrase guessing; OS-key loss without a completed backup remains unrecoverable; filesystems without hard-link support reject direct export (copy a completed backup afterward). This is implementation and regression evidence, not external security assurance.

  2. trmosala commented on Sep 22, 2026

    @trmosala
    OwnerAuthor

    Validated on macOS arm64 in commit cc308d7. Detailed evidence and limitations.

    Completed the missing macOS backup passphrase path using the existing native secure-entry boundary. AppKit now has a passphrase-only mode with secure-field focus and no plaintext username field. The native helper compiles. A production subprocess-adapter fixture passes authenticated export/import, overwrite refusal, collision review, cancellation, lock termination, wrong-key/tamper rejection and missing-helper refusal. The helper interaction/authentication is synthetic; physical AppKit/Touch ID and packaged assurance remain #34 gates. Existing closed status is retained.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions