From 1c05ef6a7a1a76646d378aa91b7287df9da186f9 Mon Sep 17 00:00:00 2001 From: Jared Vititoe Date: Thu, 2 Jul 2026 09:37:31 -0400 Subject: [PATCH] =?UTF-8?q?fix(config):=20drop=20the=20=5F=5Fcsp=5Fnotes?= =?UTF-8?q?=20field=20=E2=80=94=20Tauri=20config=20schema=20is=20strict?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit `app.security.__csp_notes` failed `tauri.conf.json` schema validation ("Additional properties are not allowed") on BOTH platforms before any compile. JSON can't hold comments and Tauri forbids extra keys, so the rationale lives here instead: CSP rationale (audit 2026-07): tightened from the fully-open policy. - 'unsafe-eval' MUST stay: the native→web bridge (forward_deeplink / emit_to_web) uses window.eval, governed by page CSP; also covers crypto wasm. - The sha256 hash allowlists the single inline `window.global ||= window;` shim in cinny's index.html (~line 96). If that snippet or its indentation changes, recompute the hash or the shim is silently blocked. - connect-src / img-src / media-src keep http: (plain-http homeservers). - Review-added: Google Fonts (VT323) + OpenStreetMap iframe (m.location). - style-src keeps 'unsafe-inline' for React style attributes. Co-Authored-By: Claude Opus 4.8 --- src-tauri/tauri.conf.json | 1 - 1 file changed, 1 deletion(-) diff --git a/src-tauri/tauri.conf.json b/src-tauri/tauri.conf.json index 9158d63..82ba354 100644 --- a/src-tauri/tauri.conf.json +++ b/src-tauri/tauri.conf.json @@ -70,7 +70,6 @@ }, "app": { "security": { - "__csp_notes": "Tightened from the fully-open policy (audit 2026-07). script-src: 'unsafe-eval' MUST stay — the native→web bridge (forward_deeplink/emit_to_web) uses window.eval, which page CSP governs (also covers the crypto wasm). The sha256 hash allows the single inline `window.global ||= window;` shim in cinny's index.html (line ~96) — if that snippet or its indentation changes, recompute the hash or the shim is silently blocked. connect-src stays broad: users connect to arbitrary homeservers (img/media keep http: for plain-http homeservers, matching connect-src). Review-added allowances: Google Fonts (VT323 stylesheet+font in index.html) and the OpenStreetMap embed iframe (m.location messages). style-src keeps 'unsafe-inline' for React style attributes.", "csp": "default-src 'self'; script-src 'self' 'unsafe-eval' 'sha256-dT6noyex1I8o5CS9Sx/y8UOqwpZYIridpGz92gcObIM='; style-src 'self' 'unsafe-inline' https://fonts.googleapis.com; font-src 'self' data: https://fonts.gstatic.com; img-src 'self' data: blob: http: https:; media-src 'self' blob: data: mediastream: http: https:; worker-src 'self' blob:; frame-src 'self' blob: https://www.openstreetmap.org; connect-src 'self' blob: data: ipc: ws: wss: http: https: http://ipc.localhost; object-src 'none'; base-uri 'self'" } }