Skip to content

[P1][security] init_keyring() panic on Linux + ConnectionStore::new .expect() block all app launches #278

Closed

Description

@EVWorth

Context

If the OS keyring backend cannot initialize (no D-Bus Secret Service in a headless/CI/Flatpak session), the app currently panics inside init_keyring() and cannot start.

Problem

src-tauri/src/lib.rs:18-37 calls .expect() on each keyring backend. On Linux, linux_keyutils_keyring_store::Store::new() returns Err when D-Bus Secret Service is unavailable. ConnectionStore::new propagates errors via .expect("Failed to initialize connection store") if migrate_plaintext_passwords fails. Result: any user with existing profiles whose keyring is broken cannot start the app.

Files

  • src-tauri/src/lib.rs:18-37, 125
  • src-tauri/crates/mas-core/src/connection/store.rs:17-24, 304-329
  • src-tauri/crates/mas-core/src/connection/manager.rs (no degraded-mode path)

Repro

Run SQLPilot under dbus-launch --exit-with-session /bin/false (no Secret Service). App crashes on startup before reaching the connection list.

Expected

App starts normally with a status bar banner "Credentials will not be saved across sessions". Profile creation succeeds (in-memory password only). Subsequent launches prompt for password entry until keyring is fixed.

Proposed fix

Scope M. Replace .expect() with explicit error logging + store init error in AppState. Add keyring_status Tauri command returning {available: bool, reason: Option<String>}. In ConnectionStore::new, let _ = migrate_plaintext_passwords(...); when unavailable. Frontend renders banner when available=false.

Acceptance

Launch with no keyring backend available — app starts; banner shown; profile creation succeeds; restart prompts for password.

Needs human verify

Yes.

Activity

  1. added
    audit
    severity/p1
    kind/security
    area/connection
    on Jul 24, 2026
  2. EVWorth commented on Sep 7, 2026

    @EVWorth
    OwnerAuthor

    Fixed by #527. init_keyring no longer .expect()s: a missing or locked credential store is treated as a degraded mode, the app starts, and the status bar says Passwords not saved so the user learns it immediately rather than at the next launch.

    ConnectionStore::new no longer fails construction either — migrate_plaintext_passwords skips a profile it cannot move and leaves the plaintext row in place so a later launch retries.

    Worth recording: nothing was needed for the degraded path itself. keyring-core already returns NoDefaultStore as an error rather than panicking, so every password operation fails cleanly once no store is attached.

    Not auto-closed because the PR body wrote Refs #278.

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

    area/connectionauditkind/securityseverity/p1

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions