Skip to content
SEUNGWOO CHOI edited this page Nov 14, 2026 · 8 revisions

Security model

English · 한국어

Security boundaries for the Miroven client. Report vulnerabilities through the repository's private reporting instructions.

Boundaries

  • Web Crypto encrypts entries/photos before IndexedDB storage and remote transfer. Only the recovery-code-wrapped vault key envelope goes to the server.
  • HttpOnly sessions and Origin/CSRF checks protect API requests. Production HTTPS requires Secure cookies; local development HTTP is an exception.
  • The server determines ownership from the session and rejects mismatched account hints. Client API/account binding prevents silently uploading an existing vault to another account.
  • CSP connect-src allows self and the configured API origin. The build uses an HTML parser to hash browser-normalized inline script/style text, excluding inert template content. When needed to fit hosting header limits, attribute-free classic HTML scripts are extracted using parser source locations. nginx applies generated headers to responses.
  • The Service Worker precaches only public shell and emitted JS/CSS resources with credentials omitted, never sessions, API responses, or blobs. Full precache success gates activation. Network-first shell delivery does not overwrite the installed offline build, and executable fallback reads only app-owned caches. Other root fetch representations bypass shell fallback. Cached Worker responses retain CSP/MIME headers while preserving the requested URL fragment. See PWA and updates.
  • Snapshots are committed atomically after all pages validate. Failure preserves entries and the Outbox.
  • Account deletion requires a fresh email code, CSRF, and current-account checks, and immediately revokes all sessions on acceptance. Invalid codes do not delete local entries or revoke sessions.
  • The deletion receipt is scoped to the API URL in the tab's sessionStorage. It is sent only in a bearer header, grants no login/sync access, and is excluded from URLs, diagnostics, and SW caches.
  • Deletion clears only the current local vault bound to that API/account; unrelated or unbound local vaults remain. Same-origin tabs are notified to clear in-memory views.

Limitations and validation boundaries

Lazy Account/backup/diagnostic loading changes code delivery, not encryption, PIN, authentication, account isolation, or backup formats. Features are enabled independently after loading; closing/locking cancels a pending Account open. A new Service Worker does not reload old documents, so retained chunks do not retroactively update their JavaScript or revoke keys. Continue to close/reload old-version tabs when required by the PIN/security guidance below.

E2EE does not protect against a modified client, XSS, or access to an unlocked device. The server sees email addresses, access/change times, ciphertext sizes, and operational metadata. A PIN is a convenience lock and cannot provide strong offline protection for copied browser storage. Back up encrypted files and keep the recovery code separately; browser storage is not permanent storage.

Local-server installation and paired backup/restore have been exercised. Public domains, external SMTP, actual S3 providers, independent security audit, and physical iOS/Android behavior have not been established by those checks. API browser integration uses Chromium; WebKit checks cover local photo processing and client workflows. Do not infer a certification or public-service readiness from local tests.

See cryptographic format, account and sync, backup and recovery, and image processing.

PIN key lifetime and existing vaults

PIN unlock is scoped to one document context. Reloads, new tabs, navigation, and browser-process restarts require the PIN again. Pagehide (including bfcache entry) revokes the current context; returning from bfcache rechecks the locked state. Manual/idle locks and PIN changes revoke memory sessions and clear decrypted views in participating tabs through BroadcastChannel, with storage-event notification as a fallback. No key or PIN is sent through either channel. If both messaging mechanisms are unavailable, other tabs cannot be notified immediately and must lock independently. Unlocking one tab does not unlock another. A pending slow PIN derivation cannot restore a session revoked while it was running.

Migration does not change IndexedDB version/store names, encrypted records, AAD, PIN envelope, PBKDF2 parameters, recovery codes, or backup format. The centralized key reader ignores a legacy persistent primary key whenever a PIN envelope exists. Existing plaintext-capable legacy keys are retained until the first correct PIN proves that they match the envelope, then removed before creating the memory session. This avoids silently deleting the only usable key in an inconsistent legacy vault. Until that first verified migration, the legacy key still exists on disk; complete a PIN unlock after updating. If keys do not match, fail closed and preserve the original browser data and recovery code for recovery rather than deleting either key.

Close/reload all old-version tabs after updating: old JavaScript cannot be retroactively revoked and may still use the old persistence path. The updated app never uses a legacy stored key to bypass PIN entry. PIN removal requires the correct PIN and atomically stores the verified key while deleting the PIN envelope, preserving local-only operation across restarts. Recovery/import refuses to install a persistent key underneath an existing PIN; remove the PIN first on an empty vault. Backup export uses the memory key while unlocked. Existing encrypted entries, drafts, recent searches, photos, Outbox work, and conflicts remain intact.

The PIN is still a convenience lock with limited offline entropy. This change does not defend against a compromised client/browser, XSS, OS memory inspection, or someone accessing an already unlocked tab.

On a fresh PIN-protected session, encrypted draft restoration waits until the vault is unlocked. Autosave starts only after restoration completes, so an empty locked-session editor cannot overwrite or delete the saved draft.

Diagnostic activity privacy

The in-memory diagnostic recorder accepts fixed operation labels and allowlisted error categories only. It excludes journal/search/input values, filenames, entry/account/blob identifiers, request/response payloads, addresses, credentials, error messages and stacks.

Generation resets clear history and reject stale completions/downloads on lock, pagehide, explicit sign-in/sign-out, account deletion, subsequent discovered identity changes and local reset. Explicit sign-in resets history even for the same account. The first session lookup and later same-account refreshes preserve startup history and pending completions; an initial network failure leaves authentication unresolved (null). After the first resolved session, discovering a different identity or session expiry resets history. Export before signing in as well as before locking, reloading or signing out.

History is neither persisted nor uploaded automatically. Export still contains potentially identifying metadata such as user agent, time zone, viewport and activity timing; inspect before sharing. This does not change encryption, account isolation, API or backup formats. See diagnostics.

Clone this wiki locally