Tips

CORS misconfiguration tips

A CORS misconfiguration lets another website read the target’s responses with the victim’s cookies. It matters when an endpoint returns private data and trusts origins it should not, with credentials allowed.

Published tips, newest first. Payloads and commands are shown as plain text.

  • Test Origin header validation

    When testing a web application, try modifying the Origin header using a tool like Burp Suite to see if the server reflects the supplied value. If it does, investigate further to determine if the application is using a weak validation check, such as startsWith(), which could allow

    CORS misconfigurationDiscovery

CORS misconfiguration: how to hunt it

Where to look

  • Access-Control-Allow-Origin reflecting any Origin with Allow-Credentials: true, and session cookies sent cross-site (SameSite=None).
  • Origin checks fooled by a suffix, a prefix or the null origin (sandboxed iframes, local files).
  • Trusted subdomains where an XSS would make the policy exploitable.
  • Endpoints that return tokens, API keys or personal data to a signed-in user.

What proves it

Give a page that, opened by a signed-in test user, reads their private data from the target and shows it, and name the data exposed.

Read further

Writeups on CORS misconfiguration, by hunters and researchers, most with a short summary.

Related classes