Security & AccessibilityBaseline · Widely

Cross-Origin Isolation with COOP and COEP

Mental Model

Serving both Cross-Origin-Opener-Policy: same-origin (COOP) and Cross-Origin-Embedder-Policy: require-corp (COEP) places a document into an isolated OS process (self.crossOriginIsolated === true). That boundary prevents Spectre memory-reading attacks, unlocking SharedArrayBuffer, Atomics, and high-resolution performance.now() timers.

Interactive Simulator

COOP + COEP Cross-Origin Isolation Matrix

Toggle COOP, COEP, and subresource CORP/CORS headers to inspect crossOriginIsolated status and blocked embeds.

Parameter Profile
coopHeadersame-origin
coepHeaderrequire-corp
subresourceCorpOn
coopHeader
same-origin
coepHeader
require-corp
subresourceCorp
On
Parameters evaluated in real time.

Under the Hood

COOP and COEP work like a cleanroom airlock: COOP locks the side door so cross-origin popups cannot share your process, and COEP inspects every incoming crate so no uninvited cross-origin bytes enter your memory space.

  1. COOP (same-origin): Severs window.opener references to cross-origin windows, forcing separate browsing context groups and OS processes.
  2. COEP (require-corp): Blocks any cross-origin image, script, iframe, or CORS fetch that lacks Cross-Origin-Resource-Policy: cross-origin or valid CORS headers.
  3. Unlocked Primitives: Once crossOriginIsolated is true, the engine exposes SharedArrayBuffer and sub-millisecond performance.now() precision.
HTTP
Cross-Origin-Opener-Policy: same-origin
Cross-Origin-Embedder-Policy: require-corp

Problem Genealogy

  • 2018 (Spectre CPU Side-Channel): Any attacker <iframe> sharing a renderer process could read secrets from cross-origin images or scripts in memory using high-resolution timers.
  • 2020 (COOP + COEP Shipping): Browsers tied SharedArrayBuffer to explicit opt-in process isolation.
  • 2022+ (COEP: credentialless): Added a softer mode in Chromium and Firefox that strips cookies from cross-origin fetches instead of requiring CORP headers everywhere.

Production Pitfalls

Production Pitfall
  • Breaking third-party embeds: Payment widgets, YouTube iframes, and CDN avatars without CORP or CORS fail to load under require-corp; scope COOP/COEP to heavy Wasm/editor routes rather than the entire marketing site.
  • OAuth popup window.opener === null: COOP: same-origin breaks popup-based OAuth opener.postMessage(); handle OAuth on a same-origin redirect page and signal the main tab via BroadcastChannel.
When Not to Use
  • When not to use Cross-Origin Isolation: Standard CRUD apps that do not run multi-threaded Wasm (SharedArrayBuffer) gain little from COOP/COEP while paying steep third-party embed compatibility costs.

Connections & Logical Next Steps

Security & AccessibilityCross-Origin Isolation with COOP and COEP

Seen in Architecture Autopsies

Mechanical Comparisons