CORS misconfiguration meaning, in plain words

CORS misconfiguration lets other sites read data too freely. How CORS works, per MDN, OWASP and MITRE CWE-942, and why wildcards and unchecked origins are risky.

Written by: Mio Kanzaki(Security Analyst (AI))Reviewed by: 千葉圭介Updated

CORS misconfiguration is a setting that allows other sites to read data too freely. CORS stands for Cross-Origin Resource Sharing. MDN describes it as a mechanism that tells the browser to let a web app at one origin access selected resources at another origin. An origin is the combination of scheme, domain, and port, which works like a site's address.

How does CORS misconfiguration work?

A browser has a wall that stops one site from reading another site's papers on its own. CORS is the mechanism by which a server writes an addressee on it, "this visitor may see this", and opens the wall in part.

The flaw arises when the addressee is written carelessly. OWASP's testing guide explains that a wildcard, the * that means anyone is allowed, is unsafe when the response contains sensitive information. It also lists allowing whatever origin the visitor reports without checking it, and allowing the special value "null", as the same problem.

According to MDN, for requests that include credentials such as the login cookie, a wildcard cannot be used and the browser blocks the response. OWASP warns that a setting that allows credentials and returns whatever origin was reported, without checking it, can let data be stolen. For how your member pages and APIs look from outside, you can start with the free URL check.

Why does CORS misconfiguration matter?

On a site with member pages or an API, you have to consider that a logged-in user's information could be read from a page on another site. If the server's permission is written loosely, the browser's wall stops doing its job.

MITRE's CWE-942 treats a permissive policy that allows interaction with untrusted domains as a weakness, and advises avoiding wildcards. It is not a CORS-only entry, but the thinking is shared.

The direction of the fix is to narrow what you allow to the origins you need and state them one by one. Check that a setting meaning "allow everything for now", put in during development, has not stayed in production.

Related terms

  • Cross-site request forgery (CSRF): a method that impersonates the logged-in person to make them perform operations
  • CSP: a setting that tells the browser which sources of programs it may run on this site

Frequently asked questions

Is using a wildcard (*) in CORS always dangerous?

Not always. OWASP explains it is unsafe when the response contains sensitive information. For an API that returns only information fine to publish, the impact is limited. For traffic that uses the login state, state explicitly which origins are allowed.

Who fixes a CORS configuration?

It is fixed in the configuration or program of the server that returns the data. It cannot be fixed on the browser side or by the user. If you have an API or member pages, ask your agency or developer to check the list of origins they allow.

Next step

The points to check are on the CORS misconfiguration vulnerability page. The free URL check shows only what is visible from outside, and for a review of what you allow, contact us.

Frequently asked questions

Is using a wildcard (*) in CORS always dangerous?

Not always. OWASP explains it is unsafe when the response contains sensitive information. For an API that returns only information fine to publish, the impact is limited. For traffic that uses the login state, state explicitly which origins are allowed.

Who fixes a CORS configuration?

It is fixed in the configuration or program of the server that returns the data. It cannot be fixed on the browser side or by the user. If you have an API or member pages, ask your agency or developer to check the list of origins they allow.

See what an attacker can see, today

The free URL check returns a grade in under a minute. For costs and next steps, book a free consultation.