❤️
SecurityHeaders.nl

Cross-Origin-Opener-Policy (COOP)

The Cross-Origin-Opener-Policy (COOP) HTTP response header allows you to ensure a top-level document does not share a browsing context group with cross-origin documents.

Why COOP is Important

When a website opens another website (for example, via window.open() or a link with target="_blank"), both documents traditionally share the same browsing context group. This allows a malicious cross-origin site to retain a direct JavaScript reference to your window (window.opener), enabling attacks such as:

Supported Directives

Cross-Origin-Opener-Policy: same-origin

COOP supports three directives:

Recommended Configuration

Apache (.htaccess)

Header always set Cross-Origin-Opener-Policy "same-origin"

Nginx

add_header Cross-Origin-Opener-Policy 'same-origin' always;

Cross-Origin Isolation for A++

When combined with Cross-Origin-Embedder-Policy: credentialless, COOP completes the requirements for full Cross-Origin Isolation. This awards significant bonus points on SecurityHeaders.nl and is required for the coveted A++ grade.