Commit Graph
9 Commits
Author SHA1 Message Date
ddidderr f9c64d7c18 fix(tauri): enable a Content Security Policy for the webview
Security audit finding SEC-IPC-02. `tauri.conf.json` set `"csp": null`,
which disables Tauri's CSP injection entirely. The audit found no
script-injection route in the frontend, so this is defense in depth:
should an XSS ever land through peer-supplied text, a CSP stops it from
loading remote scripts, exfiltrating over fetch/WebSocket or framing the
app, and confines IPC to Tauri's own channel.

Production policy (`csp`):
- default/script-src 'self': only the bundled Vite output runs. Tauri
  adds hashes for the init scripts it injects.
- style-src 'self' 'unsafe-inline' plus fonts.googleapis.com: React
  inline `style` props and the Bebas Neue stylesheet that index.html
  already links.
- font-src 'self' data: fonts.gstatic.com: the font files behind that
  stylesheet.
- img-src 'self' data: asset: http://asset.localhost: thumbnails arrive
  as base64 data URLs from get_game_thumbnail.
- connect-src ipc: http://ipc.localhost: Tauri does not append these
  itself; without them every `invoke` would be blocked.
- object-src/frame-src/form-action 'none', base-uri 'none'.

Development policy (`devCsp`): Vite's dev server injects the React
refresh preamble as an inline script and needs eval and a WebSocket to
localhost:1420 for HMR, so `just run` uses a permissive policy that
still forbids frames, plugins and form submission.

Verification here was limited to a static check: the production bundle
built by `deno task build` contains only external module scripts and
stylesheets, and `cargo tauri` parses the new config. The policy has
not been exercised in a running webview on this machine; if the app
shows a blank window or missing fonts/thumbnails after this change,
the WebView console will name the blocked directive.

Test plan: `just run` (dev) and `just build` then launch the binary;
confirm the library renders, thumbnails and the display font load,
IPC-backed actions (settings, log windows, Call to Play) work, and the
webview console shows no CSP violations.

Claude-Session: https://claude.ai/code/session_017C3Nbgwpdm3YNwZhhFLHwg
2026-09-02 22:37:40 +02:00
ddidderr 60fd7ba0c2 feat(peer)!: cut over to authenticated catalog sharing
Replace address-only trust and pushed peer state with installation identities,
SPKI-pinned QUIC, candidate-only discovery, and bounded responder-owned
protocol-8 pulls. The runtime now owns each network generation and all admitted
work through shutdown.

Add exact bundled content identities, reproducible manifest publishing,
capability-confined downloads, streaming BLAKE3 verification, quarantine and
retry, and crash-recoverable download and install transactions. Ship generated
fixture catalogs and fail closed when production manifests are absent.

The Tauri backend exposes durable sharing policy, redacted identity state, and
attempt-keyed transfer snapshots. Frontend consumption follows in the next
commit. Repository-wide test certificates and protocol-7 paths are removed.

BREAKING CHANGE: peers must use protocol 8 and exact catalog content artifacts;
protocol-7 frames and shared-certificate identities are no longer accepted.

Test Plan:
- `just test` -- passed on the completed stack (708 workspace tests)
- `just clippy` -- passed on the completed stack
- `just build` -- passed with fixture catalogs on the completed stack
- `just catalog-check-production` -- failed closed because the external
  production manifest corpus is absent
- `git diff --cached --check` -- passed
2026-08-10 13:59:18 +02:00
ddidderr 68594740a5 Tauri app identifier 2025-11-18 19:52:04 +01:00
ddidderr 833c8afedf game thumbnails 2025-11-14 09:03:05 +01:00
ddidderr 0f4e40383b load game.db 2025-11-12 22:56:59 +01:00
ddidderr 56c1eb0167 [ui] wait for server, rename to softlan-launcher 2024-11-15 12:29:16 +01:00
ddidderr bc70d6300b [client] unpack game works! 2024-11-15 11:20:35 +01:00
ddidderr a2a630893f [ui] better default windows size 2024-11-14 00:43:33 +01:00
ddidderr 5d45c4ce4b [ui] change framework from Tauri Leptos to Tauri Vanilla (Typescript) and React 2024-11-13 22:15:04 +01:00