security: rc.4 CSP hardening for instrument egress - #83
Merged
Conversation
huximaxi
force-pushed
the
claude/blissful-dewdney-2f2410
branch
from
July 3, 2026 16:23
4e4d6f7 to
b4cf437
Compare
huximaxi
force-pushed
the
claude/blissful-dewdney-2f2410
branch
from
September 9, 2026 07:37
b4cf437 to
597e32a
Compare
…network-egress follow-up) srcdoc iframes inherit the embedder's CSP, so palace-authored instrument HTML in the cockpit's MapFrame had unrestricted network egress despite the sandbox already blocking IPC/app-origin access. Sets a restrictive CSP in tauri.conf.json (default-deny + IPC-only connect-src), keeps instrument inline scripts/styles runnable by exempting them from Tauri's asset-CSP hash injection, and adds csp_gate_tests as a config-regression tripwire.
huximaxi
force-pushed
the
claude/blissful-dewdney-2f2410
branch
from
September 9, 2026 11:12
597e32a to
537555d
Compare
huximaxi
marked this pull request as ready for review
September 9, 2026 11:12
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
desktop/src-tauri/tauri.conf.json(default-deny + IPC-onlyconnect-src), closing the network-egress advisory raised in PR feat: v0.6.0-beta: desktop cockpit (maps rail + tools gate-ledger) + 1.6 scope + beta cut #79's review: srcdoc iframes inherit the embedder's CSP, so palace-authored cockpit instruments had unrestricted fetch/XHR/beacon/img egress despite the iframe sandbox already blocking IPC and app-origin access.script-src/style-srcfrom Tauri's asset-CSP hash injection (dangerousDisableAssetCspModification) so instrument inline scripts/styles keep running under'unsafe-inline'in release builds: otherwise CSP3 would silently void it once Tauri injects hashes.csp_gate_testsindesktop/src-tauri/src/main.rsas a config-regression tripwire (default-deny shape, IPC-only connect-src, no remote origins in any directive, inline-script viability, MapFrame sandbox has noallow-same-origin).MapFramecomments indashboard.rsand the README's security-gates list to describe enforcement rather than convention.Threat model: an actor who can write instrument HTML already runs code as a cron: this is defense-in-depth, not a hole.
Test plan
cargo testindesktop/src-tauri— 27/27 passing (includes newcsp_gate_tests)npm run tauri:build) succeeds; verified the exact CSP string is embedded in the shipped binarydist/output under the exact shipped CSP: app wasm fetches/compiles/runs; asandbox="allow-scripts"srcdoc probe shows inline scripts still run whilefetch/image-beacon egress is blocked withconnect-src/img-srcCSP violations and zero network requests reach the remote host