feat(html-render): a content security policy for rendered pages (W47) #335
All Vouch review confidence checks passed
Residual risk 0.46 = Change Risk (0.63) × (1 − Review Confidence (0.28)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.63 · 293 lines diff across 3 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.02 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 41% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Shallow Review Depth
shallow_review_depth
0.344
Diff Size
diff_size
0.340
Sensitive Paths
sensitive_paths
0.063
Real PR Conversation Timeline
1 comments
"Review active on #335"
general
weight: 0.35
claude[bot]
What
From
preview.md#deferred: a content security policy for rendered pages in the reader's client. Decision D1689 indocs/plans/preview.md("A rendered page's policy (W47)").A page an agent rendered with
html.renderruns in a sandboxedsrcdocframe (never same-origin), but, as in T3, its scripts could load from anywhere and so also reach the reader's own loopback (the node athttp://127.0.0.1:7777) and plain-HTTP devices of the reader's network. The web client now puts a<meta http-equiv="Content-Security-Policy">first in the frame's document (after any doctype, so the page keeps standards mode):A CDN chart library over HTTPS still loads; plain HTTP and WebSockets are refused. The stored page in the thread's stream is unchanged, and node-side measuring keeps its public-only proxy. What a scheme-based policy cannot do (shutting out private addresses over HTTPS) stays in Deferred.
Evidence
The new e2e renders a page whose inline script
fetches, and whose<img>loads, a server on the reader's loopback that answers with CORS allowed: the script runs and reports "blocked", and the server got no request. Without the policy the same test fails (run withsrcDoc={props.html}):🤖 Generated with Claude Code