fix(desktop): M9-audit batch C — enforced TLS policy, logout key retention, fork guard, panic-lock ordering #190

Merged
amiryahaya merged 2 commits from fix/m9-audit-desktop-rust into main 2026-11-12 08:03:46 +01:00
Owner

Closes #174, closes #175, closes #178, closes #183, closes #171 (umbrella #167; #20 partial — streaming upload is a follow-up).

#174 rustls + webpki-roots ONLY on every client (machine CAs never trusted); leaf-DER pin enforcement in-handshake for armed hosts; cert_pinner rewritten (was never called + false log). Naive TOFU rejected in-doc (LE key rotation).
#175 logout keeps the master wrap, clears unlock.* + wipe token — key fork on same device closed.
#183 fork guard: fresh device + existing server wraps = refused until pairing/recovery; three bare unlock() calls deleted.
#178 decoy setter/change distinctness vs wipe + real.
#15-sweep panic lock: local-first, server best-effort.
#171 get_api_base_url/get_auth_token commands registered.
#20 clone drop, download size cap, decoy 200 MB cap + temp sweep.

Rust 46/46, desktop 1316/1skip, fmt/check clean.

Closes #174, closes #175, closes #178, closes #183, closes #171 (umbrella #167; #20 partial — streaming upload is a follow-up). **#174** rustls + webpki-roots ONLY on every client (machine CAs never trusted); leaf-DER pin enforcement in-handshake for armed hosts; cert_pinner rewritten (was never called + false log). Naive TOFU rejected in-doc (LE key rotation). **#175** logout keeps the master wrap, clears unlock.* + wipe token — key fork on same device closed. **#183** fork guard: fresh device + existing server wraps = refused until pairing/recovery; three bare unlock() calls deleted. **#178** decoy setter/change distinctness vs wipe + real. **#15-sweep** panic lock: local-first, server best-effort. **#171** get_api_base_url/get_auth_token commands registered. **#20** clone drop, download size cap, decoy 200 MB cap + temp sweep. Rust 46/46, desktop 1316/1skip, fmt/check clean.
fix(desktop): M9-audit batch D — wipe-flow state machine + decoy settings gate (#179 partially, #173 UI side)
All checks were successful
Security CI / security-scan (pull_request) Successful in 3m53s
3d9c707e16
#12/#179: UnlockScreen wipe flow is now a state machine (idle → arming →
armed → failed → cancelled). Arm failure keeps the dedicated panel with
Retry arming — the default unlock card can no longer reappear right
after the wipe gesture (one click into the real workspace closed).
Cancel failure routes back to the retry panel instead of losing state.

#173 (UI side): SettingsPage fetches active_tree on mount; decoy
sessions see a notice + device-level prefs + DecoyVaultSection only —
account, linked logins, devices, unlock-passphrase, wipe, and recovery
sections are hidden (the shared API token makes them real-account
surfaces; the server cannot distinguish by design).

Tests: arm-failure/retry flow, decoy gating; desktop suite green
(MySharesPage flake seen once under parallel load, green standalone +
on rerun — pre-existing).
#174: every reqwest client now enforces a real TLS trust policy — rustls
with webpki-roots ONLY (machine CAs never trusted; corporate-proxy/
rogue-CA MITM dead by construction), plus SPKI/leaf-DER pin enforcement
inside the handshake for hosts with armed pins (cert_pinner rewritten:
correct hosts, rotation-safe two-pin ops recipe, was zero production
callers + a false "pinning active" log). Native TOFU rejected: LE
rotates leaf keys ~60d — public-roots-only achieves the same protection
rotation-free.

#175: logout keeps the master-key wrap (clear_session_credentials) and
clears every unlock.* layer + wipe token — deleting the wrap made the
next login mint a NEW key while stale layers wrapped the old one
(same-device key fork). clear_all (device revoke/wipe) unchanged.

#183/#17: AppState.ensure_ready_with_fork_guard — a fresh device on an
account with existing server wraps is REFUSED until it pairs or
recovers (unlock_session gains allow_fresh override; biometric guarded;
three bare state.unlock() calls deleted — unlock without key material
is structurally impossible now).

#178: decoy passphrase setter/change gain same-as-wipe + same-as-real
distinctness (wipe never arms silently).

#15-sweep: panic lock locks locally FIRST, server freeze best-effort —
offline panic no longer a total no-op.

#171: get_api_base_url + get_auth_token Tauri commands registered (the
member/invitation/tenant-request stores invoked nonexistent commands;
packaged builds broke, mocks hid it).

#20: upload clone dropped (one fewer 5 GB copy), download Content-Length
capped before buffering, decoy vault 200 MB cap + plaintext temp sweep
(on open + app start).

Rust suite 46/46; desktop suite 1316/1skip; fmt + check clean.
Sign in to join this conversation.
No description provided.