|
| 1 | +# Browser Security Profiles |
| 2 | + |
| 3 | +Status: reviewed design remediation for the v0.1.0 pentest. Product browser |
| 4 | +profiles and header enforcement are not implemented in this foundation. |
| 5 | + |
| 6 | +## Trust boundary |
| 7 | + |
| 8 | +A Dedicated Worker is an execution/responsiveness boundary, not protection from |
| 9 | +a malicious owning page. Compromise of the website origin, CDN, deployment |
| 10 | +account or served JavaScript can read input before the worker receives it, |
| 11 | +change the worker and alter policies. Same-origin asset hashes checked by that |
| 12 | +page do not make the page independently trustworthy. CSP and cross-origin |
| 13 | +isolation provide defense in depth; they cannot repair a compromised origin. |
| 14 | +This follows the browser's page/worker trust model in the |
| 15 | +[HTML worker specification](https://html.spec.whatwg.org/multipage/workers.html). |
| 16 | + |
| 17 | +Browser extensions and a compromised browser/OS are outside application defense. |
| 18 | +No hosted website is represented as a safe place for classified data merely |
| 19 | +because transforms run locally. The high-assurance profile below needs an |
| 20 | +independently verified artifact and a separately enforced network-disabled host. |
| 21 | +It cannot promise classification accreditation or protect a compromised host. |
| 22 | + |
| 23 | +## Separate profiles |
| 24 | + |
| 25 | +| Profile | Code custody and capabilities | Confidentiality limits | |
| 26 | +| --- | --- | --- | |
| 27 | +| Hosted local-only | Dedicated origin/application; local transforms only; no remote execution, network-capable transformations, accounts, sharing or payload telemetry | The origin and delivered code remain trusted. Static asset requests are permitted; payloads never enter them. This is not protection from origin compromise. | |
| 28 | +| Verified offline/local-only | Signed, immutable bundle with reviewed UI/worker/Wasm/packs/models/fonts and manifest; independently verified before launch; local launcher/origin plus host network disabled | Verify signature and expected signer using an independently obtained trust anchor/tool, outside downloaded JavaScript. No online updates/service worker/CDN or fallback while processing. The trusted browser/OS/verifier and custody remain assumptions. | |
| 29 | +| Explicit remote | Separate origin/application with its own UI, session and remote API capabilities | The user deliberately imports/discloses input there. Consent is specific to destination/effect; server processing has the server trust/retention boundary. | |
| 30 | + |
| 31 | +Origins differ by host/scheme/port, not path prefixes. Local-only and remote |
| 32 | +profiles share no cookies, storage, service worker, opener, ambient grants or |
| 33 | +automatic payload postMessage bridge. Links to the remote application carry no |
| 34 | +payload in URLs/referrers and open with no opener. Explicit file export/import |
| 35 | +can cross the boundary only with deliberate user action. Missing local providers |
| 36 | +or unsupported network operations report an error; they cannot switch profiles. |
| 37 | + |
| 38 | +High-assurance use selects the independently verified offline distribution; |
| 39 | +switching to remote processing ends that profile's confidentiality boundary. |
| 40 | +Signature/manifest verification happens before any code executes. Update, import, |
| 41 | +artifact substitution, stale service worker and untrusted signing key tests must |
| 42 | +fail closed. Signing credentials follow the OpenBao release-secret policy. |
| 43 | + |
| 44 | +## Local-only HTTP policy |
| 45 | + |
| 46 | +The following is an enforced baseline contract, not a report-only policy. |
| 47 | +Send the document CSP and appropriate isolation/resource headers on worker and |
| 48 | +module responses too; the owning page's CSP alone does not qualify worker |
| 49 | +execution. Frame restrictions must be HTTP headers, not only HTML meta tags. |
| 50 | +Do not add reporting endpoints that could disclose URLs or user material. |
| 51 | +Browser behavior is qualified against [CSP3](https://www.w3.org/TR/CSP3/). |
| 52 | + |
| 53 | +Document CSP, as a single header value: |
| 54 | + |
| 55 | +```text |
| 56 | +default-src 'none'; script-src 'self' 'wasm-unsafe-eval'; worker-src 'self'; style-src 'self'; img-src 'self' blob:; connect-src 'none'; object-src 'none'; base-uri 'none'; form-action 'none'; frame-ancestors 'none'; require-trusted-types-for 'script'; trusted-types runasmidja-static |
| 57 | +``` |
| 58 | + |
| 59 | +Worker CSP uses the same script/connect/default restrictions. Nested workers |
| 60 | +are forbidden with `worker-src 'none'` unless a later bounded pass qualifies |
| 61 | +an explicit same-origin worker topology; no blob/data worker or script URL is |
| 62 | +admitted. Blob images are only inert bounded raster previews; active HTML/SVG |
| 63 | +previews need the separately isolated preview contract. No inline script, |
| 64 | +JavaScript eval, wildcard/third-party assets, remote fonts or external images. |
| 65 | + |
| 66 | +| Header | Exact baseline value | |
| 67 | +| --- | --- | |
| 68 | +| Cross-Origin-Opener-Policy | `same-origin` | |
| 69 | +| Cross-Origin-Embedder-Policy | `require-corp` | |
| 70 | +| Cross-Origin-Resource-Policy | `same-origin` | |
| 71 | +| X-Frame-Options | `DENY` | |
| 72 | +| X-Content-Type-Options | `nosniff` | |
| 73 | +| Referrer-Policy | `no-referrer` | |
| 74 | +| Permissions-Policy | `camera=(), microphone=(), geolocation=(), display-capture=(), usb=(), serial=(), hid=(), bluetooth=(), payment=(), clipboard-read=(), clipboard-write=(self), web-share=()` | |
| 75 | + |
| 76 | +Self-only clipboard writing still requires the explicit reviewed disclosure |
| 77 | +grant/user action from 0.27.0; default processing never writes to the clipboard. |
| 78 | +The network-disabled host may additionally forbid clipboard export. This header |
| 79 | +permission is not application consent and does not authorize automatic copying. |
| 80 | + |
| 81 | +Serve exactly one valid COOP/COEP value, including errors/redirects as applicable; |
| 82 | +duplicated or malformed values can weaken the policy. See the |
| 83 | +[HTML isolation policy](https://html.spec.whatwg.org/multipage/browsers.html#cross-origin-embedder-policy), |
| 84 | +[Fetch CORP definition](https://fetch.spec.whatwg.org/#cross-origin-resource-policy-header) |
| 85 | +and [Permissions Policy specification](https://www.w3.org/TR/permissions-policy/). |
| 86 | +Platform support varies; record actual effective restrictions per browser. |
| 87 | + |
| 88 | +The single named Trusted Types policy may create only static reviewed |
| 89 | +same-origin script/worker URLs from the immutable asset manifest. No default |
| 90 | +policy, user-controlled URLs, identity HTML conversion or arbitrary script |
| 91 | +conversion. UI rendering uses inert DOM/text operations; framework admission |
| 92 | +must prove compatibility. See [Trusted Types](https://www.w3.org/TR/trusted-types/). |
| 93 | +Unsupported enforcement is a documented profile limitation; a browser lacking |
| 94 | +required controls does not qualify for the high-assurance profile. |
| 95 | + |
| 96 | +`connect-src 'none'` blocks Fetch/XHR/WebSocket/EventSource/beacon paths, including |
| 97 | +ordinary Wasm/pack fetches. Load required verified Wasm bytes through reviewed |
| 98 | +static modules/embedded bytes and offline bundled assets; measure their cost. |
| 99 | +Do not weaken connect-src to accommodate a loader. No payload-bearing URLs, |
| 100 | +navigation, forms, resource names or CSP reports are permitted. CSP alone does |
| 101 | +not block every possible navigation or malicious same-origin script effect; |
| 102 | +host network disablement is essential to the offline high-assurance boundary. |
| 103 | + |
| 104 | +## Versioned implementation and verification owners |
| 105 | + |
| 106 | +| Owner | Required implementation and runtime evidence | |
| 107 | +| --- | --- | |
| 108 | +| 0.14.0 executable seed | Local-only test origin; document/worker CSP and headers before entering seed input; real browser checks for worker startup/Wasm compatibility and absent payload network effects. No public/high-assurance claim. | |
| 109 | +| 0.27.0 privacy | Separate capability/origin profiles, no automatic remote bridge/fallback, sensitivity and explicit export/import disclosure. Sentinel payloads never enter URLs/storage/telemetry or ambient cross-origin transfers. | |
| 110 | +| 0.28.0 first browser workbench | Enforce document/worker CSP, named Trusted Types policy, COOP/COEP/CORP, framing and Permissions Policy. Actual Chromium/Firefox/WebKit negatives for Fetch/XHR/beacon/socket/EventSource, external workers/resources, injected HTML/script/URLs, frames/opener, permissions and remote bridging; test effective policy, not just response text. | |
| 111 | +| 0.31.0 pack loader | Demonstrate worker/Wasm/lazy loading under connect-src none without widening policy or using payload resource paths; tampered/absent/offline packs fail safely. | |
| 112 | +| 0.101.0 offline packaging | Implement signed immutable bundle and independent pre-launch verifier/launcher with correct HTTP policies; test clean network-disabled host, no update/service-worker/CDN requests, bad signature/key/manifest and substituted assets. No high-assurance support before this profile qualifies. | |
| 113 | +| 0.133.0 server security | Qualify the separate remote origin/session/CORS/CSRF/opener/storage boundary with explicit disclosure and no local-origin authority bridge before exposing remote jobs. | |
| 114 | +| 0.366.0–0.367.0 packaging/provenance | Bind exact offline/local/remote artifact identities and reviewed signer/verifier trust to assessment/SBOM/target evidence; recheck signature/substitution/rollback and network-disabled launch on release artifacts. | |
| 115 | + |
| 116 | +Every owner retains original acceptance. Later plugin, pack, preview, cache and |
| 117 | +UI changes rerun affected profile negatives. No mock or roadmap test can attest |
| 118 | +browser enforcement, signature trust or offline network disablement. |
0 commit comments