In-depth lesson · CORS
Typical fixes
Every point the CORS reports back under this heading, best-backed first, each with the reports it is seen in.
-
Check the origin against an exact allowlist rather than reflecting it, and do not allow credentials for unknown origins.
Seen in 12 reports
-
Fix case sensitivity, regex path matching and inconsistent matching in flask-cors.
Seen in 3 reports
-
Validate the embedding page's origin and use the postMessage target origin rather than relying on the Referer header.
-
Validate the sender's origin before forwarding messages from content scripts to the background page.
-
Honour the request's credentials mode when attaching cookies in background fetches.
Seen in 2 reports
-
Validate the Origin and Content-Type headers on local JSON-RPC interfaces.
Seen in 1 report
-
Do not add a wildcard cross-origin header to local file responses.
Seen in 1 report
-
Set cache-control headers on authenticated API responses and restrict the cross-origin policy.
Seen in 1 report
-
Apply the same private network and mixed content checks to service worker fetches as to normal page fetches.
Seen in 1 report
-
Add authentication and origin validation to local HTTP and WebSocket interfaces.
-
Isolate HTML embeds from the parent site's origin so their scripts cannot read authenticated responses.
Seen in 1 report
-
Sanitise user-controlled input reflected into response headers and restrict the cross-origin policy.
Seen in 1 report
-
Validate the origin and narrow the URL patterns covered by the cross-origin filter.
Seen in 1 report
-
Require HTTPS for trusted origins and verify a CSRF token on the profile endpoint.
Seen in 1 report