You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fix: production CSP allows connect-src to any localhost port #876
The CSP in src-tauri/tauri.conf.json:27 includes connect-src … http://localhost:* http://127.0.0.1:*. There is no devCsp, so this applies to release builds as well. Before this change, docs/SECURITY.md claimed the localhost sources were "removed in production builds"; #874 corrects the doc but not the policy.
The first command shows the localhost sources. The second finds no frontend request to a loopback address, so the app does not appear to need them.
Cause
The localhost sources are probably left over from the Vite dev server (port 1420) and its HMR socket. Tauri already handles that case separately with devCsp or dev-only configuration.
Fix
Drop http://localhost:* http://127.0.0.1:* from csp and, if dev needs them, put them in app.security.devCsp. Then run just dev (HMR still works) and a release build (the app loads and IPC works), and update the CSP table in docs/SECURITY.md.
Activity