Explore our new Cybersecurity Terms Glossary, explained by our experts.
Cybersecurity Terms Glossary
A CORS misconfiguration is an overly permissive cross-origin policy that lets an attacker’s website read authenticated responses from your API using the victim’s own session.

What Is CORS Misconfiguration?
Cross-Origin Resource Sharing is the mechanism that allows a page on one origin to read a response from another. It exists because the same-origin policy would otherwise block legitimate API calls from single-page applications. A CORS misconfiguration is a policy that relaxes that boundary too far, so a site controlled by an attacker can issue requests carrying the victim’s cookies and then read what comes back.
The browser adds an Origin header to the cross-origin request. The server answers with Access-Control-Allow-Origin, and optionally Access-Control-Allow-Credentials: true when cookies or client certificates should be included. For anything beyond a simple GET or form POST, the browser first sends an OPTIONS preflight and checks Access-Control-Allow-Methods and Access-Control-Allow-Headers before sending the real request.
Two points are easy to miss. The decision is enforced by the browser, not the server: a request that fails the check has usually already been processed. And the specification forbids combining a wildcard with credentials, which is precisely why developers reach for the dangerous alternative described below.
Origin header into Access-Control-Allow-Origin and sets the credentials flag. Any website can then read authenticated responses. James Kettle’s 2016 research, presented as “Exploiting CORS Misconfigurations for Bitcoins and Bounties”, showed this pattern on exchanges and enterprise applications alike.Access-Control-Allow-Origin: null looks harmless, but a sandboxed iframe or a document loaded from a data: URL sends exactly that value, so an attacker can produce it at will.example.com also accepts notexample.com; one that accepts any subdomain trusts every forgotten marketing host, and a single stored cross-site scripting flaw on one of them becomes an API compromise.http:// origin lets anyone on the network path inject a page that then reads HTTPS responses.With a permissive policy and the victim’s session cookie, a hostile page can read account details, API keys, and anti-CSRF tokens. The last of these matters: once a token can be read cross-origin, every state-changing endpoint protected by it is open, so a CORS flaw often becomes a cross-site request forgery chain. On internal systems the same trick reaches services the attacker cannot address directly, in much the same way as server-side request forgery, but driven from the browser.
Access-Control-Max-Age short enough that policy changes take effect.Remember that CORS is not an authorisation mechanism. It decides which origins may read a response; it says nothing about whether the caller should have been allowed to make the call. Server-side checks on identity and ownership still have to be present, and a public API that serves no credentials loses nothing by using a wildcard.
Testing is straightforward: replay each authenticated request with an arbitrary Origin header and inspect the response headers. Our web application security testing covers this across every endpoint rather than the handful a scanner samples.
Not always. Browsers refuse to send cookies or other credentials to a wildcard origin, so a genuinely public endpoint that returns the same data to everyone loses nothing by using one. It becomes dangerous on internal services reachable only from a corporate network, because an employee’s browser can bridge that gap on behalf of an external page.
No, and this is the most common misunderstanding. CORS relaxes a browser restriction; it never adds one. Any client that is not a browser, such as curl, a mobile app, or a server-side script, ignores the headers completely. Authentication, authorisation, and input validation must all be enforced server side regardless of what the CORS policy says.
Simple requests skip it. A GET, HEAD, or POST that uses only standard headers and a basic content type is sent straight away, because a form could already have made it. Anything else, such as a JSON content type, a custom header, or a PUT or DELETE method, triggers an OPTIONS preflight first so the server can approve it.
Take an authenticated request, add an Origin header containing an unrelated domain, and look at the response. If the server echoes that origin back in Access-Control-Allow-Origin, or returns null, while also setting Access-Control-Allow-Credentials to true, the endpoint is exploitable. Repeat with a subdomain and with a domain that merely contains your hostname as a suffix.
You May Be Interested In These
We use a few cookies that are needed to make this website work, and they are always on. We would also like to set analytics cookies, to see which pages are useful; functional cookies, so that our live chat works; and advertising cookies, to measure our campaigns. We will not set any of those until you say yes, and you can change your mind at any time from the Cookie Settings link in the footer.
Choose the cookies you are happy for us to use. Strictly necessary cookies are always on; everything else is off until you turn it on.
These cookies keep the website working: they hold your security checks, your form submissions and the choice you make here. The site cannot run without them, so they are always on.
These let our live chat open and remember your conversation, and let the newsletter sign-up work. Switch them off and the chat window will not appear.
These tell us which pages are read and how people find us, so that we can improve the site. The reports are about groups of visitors, never about you personally.
These let us measure our advertising and show you our adverts on other websites, such as LinkedIn, Google and Meta. Switch them off and you will still see adverts, but they will be less relevant.