Skip to main content

Cross-Origin-Resource-Policy

ResponseActive

Cross-Origin-Resource-Policy (CORP) controls which origins can load a resource via no-cors requests – <img>, <script>, <link>, CSS url(). 'same-site' restricts to same-site origins. 'same-origin' restricts to exact same origin. 'cross-origin' allows any origin. CORP is required for subresources to be loaded by pages with Cross-Origin-Embedder-Policy: require-corp.

Cross-Origin-Resource-Policy: same-site | same-origin | cross-origin

Description

CORP protects resources from Spectre-style cross-origin reads. A resource loaded via no-cors (most images, scripts, stylesheets) can be read into an ArrayBuffer by a compromised renderer process without CORP. CORP: same-origin prevents other origins from loading the resource at all. Required for COEP compliance: any resource loaded by a COEP: require-corp page must either have CORS headers or CORP: cross-origin.

Directives

DirectiveDescription
same-originOnly the same origin can load this resource.
same-siteOnly the same registrable domain can load this resource.
cross-originAny origin can load this resource. Required for COEP: require-corp subresources.

Examples

Restrict to same origin
http
Cross-Origin-Resource-Policy: same-origin
Allow for COEP compliance
http
Cross-Origin-Resource-Policy: cross-origin

Related

Specification

Fetch StandardCross-Origin-Resource-Policy specification →