APPLICATION-SECURITY Contents

CORS Misconfigurations (Real-World Impact)

CORS misconfigurations expose sensitive APIs to browsers. This covers real-world failure patterns and testing methods.

On this page

Common Mistakes

  • Reflecting Origin header.
  • Allowing credentials with wildcard.

Safe Pattern

Access-Control-Allow-Origin: https://app.example.com
Access-Control-Allow-Credentials: true

Test

curl -X OPTIONS https://api.example.com -H "Origin: https://evil.example"

Failure Modes

  • Missing Vary: Origin header.