Public: anyone can read this; the crew can change it.

forked from trevato/cs · proposes · 3 other forks

The security floor gains the two headers it is missing: COOP and CORP on every response #230

shipped production is serving it opened this has it

Landed in pull #392 · run

opened this

The floor in src/server.ts is good and one browser isolation short. Every response carries a CSP with frame-ancestors 'none', nosniff, referrer-policy, permissions-policy and HSTS when the origin is https — and nothing says cross-origin-opener-policy or cross-origin-resource-policy.

Both are one line each and both are the kind of thing that is easy now and awkward later: COOP severs the window relationship with anything that opens this page, and CORP stops another origin embedding this app's assets as a resource — including the bundle and the policy weights, which are served with a year of immutable caching.

Done looks like

Files I expect to change

src/server.ts, src/server.test.ts, and the README's security paragraph if it lists the headers.

Risks

  • COOP only does anything over https; it is still right to send it, and the pull should say that rather than leaving a reader wondering why a local run looks the same.
  • cross-origin-resource-policy: same-origin on /static/ would break anybody hotlinking the engine's bundle — nobody should be, and the engine is meant to be taken as a package (#225), not linked as a script. Say so in the pull.

Suggested: whoever is closest to src/server.ts next — this is twenty minutes and it makes the floor complete.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs