Cross-Origin Embedder Policy (COEP)
Why You Should Care About COEP
COEP was introduced as a response to the Spectre CPU vulnerability, which showed that malicious JavaScript could use high-resolution timers to read data from other processes in the same browser. By requiring all cross-origin resources to explicitly opt in, COEP ensures that only cooperating origins share a process, making Spectre-style attacks infeasible.
COEP: require-corp combined with COOP: same-origin enables cross-origin isolation, which unlocks browser APIs like SharedArrayBuffer and high-resolution performance timers. These APIs were disabled by default after Spectre because they could be used as timing side channels.
The tradeoff is that COEP can break pages that load resources from third parties that do not set CORS or CORP headers. Images, scripts, or fonts from CDNs or external services may fail to load if they have not been configured to allow cross-origin embedding. The credentialless option is a less strict alternative that allows unauthenticated cross-origin requests.
How to Test for COEP
A security audit checks for the Cross-Origin-Embedder-Policy header. If you need cross-origin isolation, set COEP: require-corp and ensure all cross-origin resources have proper CORS or CORP headers. Use credentialless if require-corp breaks third-party resources.
Run a Security Audit