CORS Misconfiguration

Detects insecure Cross-Origin Resource Sharing configurations that allow unauthorized cross-origin access.

zakirkun 4345689 2 files · 4.0 KB Updated

File contents

CORS Misconfiguration

Overview

CORS misconfigurations allow attackers to make cross-origin requests that read sensitive API responses from a victim's browser. Common issues:

  1. Wildcard with credentials: Access-Control-Allow-Origin: * combined with credentials is rejected by browsers but misconfiguring the origin reflection is not
  2. Reflected origin: Origin header value reflected directly without validation
  3. Null origin: Allowing null origin (sandbox iframes)
  4. Subdomain wildcard: Allowing *.example.com which includes attacker-controlled subdomains

Remediation

  • Maintain an explicit allowlist of trusted origins
  • Never reflect the Origin header directly without validation
  • Never allow null origin in production
  • Do not combine Access-Control-Allow-Credentials: true with broad origin policies

zakirkun/ice-tea/tree/main/skills/web/cors-misconfiguration commit 43456891df

Frequently asked questions

npx skillmds@latest add zakirkun/cors-misconfiguration