Free CORS Policy Checker

Free CORS Policy Checker

Free tool

Validate Access-Control headers, credentials safety, and preflight behavior. Catches wildcard-with-credentials and missing Vary: Origin, with copy-paste fixes.

  • ACAO configuration
  • Preflight simulation
  • Credentials safety
No credit card requiredProduction-safe (100% passive)No setup or code required
Trusted by 4,000+ security & engineering teams
Oracle logoShopify logoGoDaddy logoChubb logoToshiba logoMAPFRE logoBelfius logoGBG logoWEKA logoShift Technology logo

What you get for free

18 core security checks via this tool, passive scans, step-by-step remediation, security score on every result.

What Essential adds at $39/mo

+17 advanced checks, continuous monitoring, daily security score history, email alerts, GitHub SAST, board-ready PDFs, SOC 2 / ISO 27001 / PCI reports.

What is CORS?

Cross‑Origin Resource Sharing (CORS) controls which origins can read your API responses in browsers. Correct configuration prevents data exfiltration while allowing legitimate cross‑site apps.

Why CORS matters

A lax policy can expose private data to attacker-controlled origins. Overly strict settings break legitimate clients. The goal is least‑privilege, origin‑scoped access.

What this checker validates

  • ACAO/ACAC/ACAH/ACEH values and consistency
  • Credentials with wildcard origin (disallowed)
  • Preflight handling (methods/headers) and Vary: Origin
  • Max‑Age and exposure of sensitive headers

Across 1,067 recent CORS checks, 16.7% have an overly-permissive Access-Control-Max-Age and 7.7% are missing Vary: Origin on credentialed responses.

How to fix common failures

  • When using credentials, set ACAO to the specific request origin, not "*"
  • Return Vary: Origin so caches keep responses per origin
  • Limit ACEH to required headers only
  • Whitelist only necessary methods in preflight

Implementation examples

Once you've identified the gap, applying the fix is straightforward. Here are the three configurations developers reach for most often.

Nginx

map $http_origin $cors_origin {
    default "";
    "https://app.example.com" $http_origin;
}

server {
    location /api/ {
        if ($cors_origin) {
            add_header Access-Control-Allow-Origin $cors_origin always;
            add_header Access-Control-Allow-Credentials "true" always;
            add_header Access-Control-Allow-Methods "GET, POST, OPTIONS" always;
            add_header Access-Control-Allow-Headers "Authorization, Content-Type" always;
            add_header Vary "Origin" always;
        }
        if ($request_method = OPTIONS) {
            add_header Access-Control-Max-Age 600;
            return 204;
        }
    }
}

Apache

<IfModule mod_headers.c>
    SetEnvIf Origin "^https://app\.example\.com$" CORS_ORIGIN=$0
    Header always set Access-Control-Allow-Origin "%{CORS_ORIGIN}e" env=CORS_ORIGIN
    Header always set Access-Control-Allow-Credentials "true" env=CORS_ORIGIN
    Header always set Access-Control-Allow-Methods "GET, POST, OPTIONS" env=CORS_ORIGIN
    Header always set Access-Control-Allow-Headers "Authorization, Content-Type" env=CORS_ORIGIN
    Header always set Vary "Origin"
</IfModule>

RewriteEngine On
RewriteCond %{REQUEST_METHOD} OPTIONS
RewriteRule ^(.*)$ $1 [R=204,L]

Node.js (Express + cors)

import express from "express"
import cors from "cors"

const allowedOrigins = ["https://app.example.com"]

const app = express()

app.use(
  cors({
    origin: (origin, cb) => {
      if (!origin || allowedOrigins.includes(origin)) return cb(null, true)
      return cb(new Error("Not allowed by CORS"))
    },
    credentials: true,
    methods: ["GET", "POST", "OPTIONS"],
    allowedHeaders: ["Authorization", "Content-Type"],
    maxAge: 600,
  }),
)

Tool-specific questions

Can I use * with credentials?

No. With ACAC: true, ACAO must echo a specific origin.

Do I need Vary: Origin?

Yes, to avoid serving one origin's response to another from cache.

Should I expose Authorization?

Only if your client must read it. Prefer not exposing sensitive headers.

How do I debug preflight failures?

Inspect OPTIONS requests, confirm Access-Control-Request-* headers, and ensure your server responds with allowed methods/headers and a 2xx status.
Why Barrion

Built for the engineers who already have enough to fix.

Speed

Real-time results

Instant analysis with a detailed report. You see findings as the scan runs, not after.
Coverage

Comprehensive checks

35+ checks per scan covering TLS, headers, CORS, cookies, DNS, email auth, and more, in a single pass.
Action

Step-by-step fixes

Every finding ships with the exact remediation step for your framework. Hand it to the engineer who owns the surface.
FAQ

Frequently asked.

What is Barrion and how does it enhance website security?
Barrion is a security testing and monitoring platform for engineering teams, and it works in three ways. Passive scanning keeps a continuous, read-only watch over your live web apps and APIs. Codebase scanning connects to GitHub and checks your code for hard-coded secrets, insecure patterns and vulnerable dependencies. AI pentesting goes on the offensive, running agent-driven attacks that prove which vulnerabilities are genuinely exploitable. Every finding comes with a step-by-step fix you can ship right away.
How safe is Barrion to use for security testing?
Passive scanning and codebase scanning are completely safe to run, including against production. Passive scans only read your live app, so we never submit forms, brute-force endpoints or touch anything that changes state, and codebase scanning just reads your repository. AI pentesting is more aggressive by design, since its job is to confirm real exploits, so it runs rate-limited and non-destructive, and you agree the scope with us before it starts.
What types of security issues does Barrion identify?
It depends on the surface. On your live apps, Barrion catches misconfigurations across TLS and HTTPS, security headers, cookie flags, CORS policy, DNS records, email authentication (SPF, DKIM, DMARC), network exposure and the usual web hygiene gaps. In your codebase it finds secrets committed to the repo, insecure code patterns and vulnerable dependencies. AI pentesting surfaces the exploitable stuff, like SQL injection, cross-site scripting and broken access control, each one backed by proof it can actually be exploited.
What specific security checks does Barrion perform?
For live apps it checks TLS and HTTPS configuration, HTTP security headers, cookie flags, CORS policy, DNS and email authentication records, network exposure and common web hygiene issues. In your codebase it looks for hard-coded secrets, insecure patterns and vulnerable dependencies. AI pentesting takes it further by actively chaining requests to confirm exploitable flaws. Whatever the source, findings are ranked by severity and come with clear, step-by-step remediation.
What is Barrion's smart crawling?
Smart crawling automatically discovers the pages and endpoints of your app so scans cover the surface that matters, without you manually listing every URL.
How often does Barrion perform security scans?
You can run a scan manually whenever you want. Continuous monitoring of your live apps runs on its own (weekly and up on Essential, daily on Business), codebase scans can fire on every commit or pull request, and we alert you the moment something new shows up.
Is Barrion suitable for security testing of all business sizes?
Yes. Live-app monitoring, codebase scanning through GitHub and AI pentesting all work just as well for a solo developer as for a startup, a scale-up or an enterprise security team, without adding headcount.
How does Barrion handle data security and privacy during security testing?
Live-app and codebase scans are read-only by default, and we never store or expose sensitive data from your application. AI pentests are rate-limited and non-destructive, built to confirm whether something is exploitable without altering your data or affecting availability.
What if I'm not satisfied with Barrion's security testing service?
Paid plans start with a free trial, and you can cancel anytime. If something isn't right, contact us and we'll make it work for your team.
How does Barrion help with SOC 2, ISO 27001, NIS2, and other compliance frameworks?
Barrion produces audit-ready PDF and CSV reports suitable for SOC 2, ISO 27001, PCI DSS and NIS2, ready to share with auditors, customers and your board.

Anything else? Email contact@barrion.io.

Run a full report on your site.

Free first scan covers every check, no signup needed. Sign up to save the report and turn on continuous monitoring.