❤️
SecurityHeaders.nl

Cross-Origin-Embedder-Policy (COEP)

The Cross-Origin-Embedder-Policy (COEP) HTTP response header prevents a document from loading any cross-origin resources that do not explicitly grant the document permission (using CORP or CORS).

Why COEP is Crucial

Following the discovery of speculative execution side-channel vulnerabilities (such as Spectre and Meltdown), web browsers disabled high-resolution timers (performance.now()) and powerful APIs like SharedArrayBuffer to prevent malicious scripts from reading process memory across origins.

COEP is one half of the modern Cross-Origin Isolation standard (paired with COOP). When enabled, the browser puts your web page in an isolated operating system process, unlocking high-performance multithreading and precision audio/video processing while ensuring no rogue cross-origin data can be leaked.

Supported Directives

Cross-Origin-Embedder-Policy: credentialless

There are two primary values for COEP:

Recommended Configuration

Apache (.htaccess)

Header always set Cross-Origin-Embedder-Policy "credentialless"

Nginx

add_header Cross-Origin-Embedder-Policy 'credentialless' always;

Common Pitfall: The "require-corp" Trap

If you set COEP to require-corp, external images, analytics pixels, or fonts that lack a Cross-Origin-Resource-Policy: cross-origin header will be completely blocked in Chrome, Firefox, and Safari. Unless you control every single server hosting your subresources, always prefer credentialless.

Check Your Isolation

Use the SecurityHeaders.nl scanner to test whether your website has properly enabled COEP and achieved a maximum A++ score.