Skip to content

Security: Move JWT secret to Electron safeStorage, restrict IPC maintenance, & sandbox renderer #277

Description

@khaira777

Feature / Security Hardening Request

Extracted from fork codewithsharma/FloCafe (branch: develop):

Overview

Security improvements to protect auth secrets on disk, restrict privileged desktop operations, and sandbox the Electron renderer process.

Proposed Changes

  1. JWT Secret Storage Migration:
    • Move from plain SQLite settings into Electron safeStorage (OS Keychain / DPAPI / Secret Service).
    • Reference: main/services/jwt-secret.ts and migration version 74 (p0_2_jwt_secret_storage_marker).
  2. IPC Maintenance Authorization:
    • Gate restart and installation IPC handlers (restart-and-install) behind Owner/Manager JWT validation to prevent unauthenticated renderer calls.
    • Reference: main/security/restart-and-install.ts.
  3. Electron Sandbox & Navigation Guards:
    • Enable renderer process sandbox and enforce strict navigation guards to block arbitrary external navigation or window spawning.
    • Reference: main/security/browser-window-security.ts.
  4. LAN Network Binding:
    • Bind HTTP server to localhost by default instead of 0.0.0.0 unless explicitly configured in settings via network_mode.
    • Reference: main/services/network-mode.ts and migration 73.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:backendBackend (Express/SQLite)enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions