← Reference

A wildcard CORS policy with credentials

Why this specific combination is a real hole.

01

The combination that matters

Access-Control-Allow-Origin: * on its own is common and often fine for a public API. Combined with Access-Control-Allow-Credentials: true it means "any website may make requests to me using the visitor’s session, and read the response".

Browsers refuse that pairing, but any layer that honours it — a proxy, a gateway, a non-browser client — turns it into account takeover through a header.

02

The fix

Replace the wildcard with an explicit allowlist of the origins your own frontend runs on, and reject everything else. If your API genuinely needs to be callable by anyone, then it must not accept credentials — pick one.

Not sure whether this applies to you?

Give us the address and we will tell you. No code, no access, no install — and every finding we have is shown in full, including on the free trial.

Check a site