CORS MISCONFIGURATION CHECKER
Paste a URL. The scanner replays your endpoints with hostile Origin headers and reads what comes back. If your API reflects any origin and allows credentials, any website on the internet can read your users' data.
TEST YOUR CORS POLICY NOW
Enter your URL — we send preflight and simple requests from attacker-controlled origins and grade every Access-Control-* header your server returns.
What is a CORS misconfiguration?
Browsers block one website from reading another website’s responses. CORS is the opt-out: a set of Access-Control-* response headers by which your server tells the browser “this other origin is allowed to read me.” A misconfiguration is any policy that hands that permission to origins you do not control.
The dangerous shape is specific. If your server both (a) allows an attacker-chosen origin and (b) sends Access-Control-Allow-Credentials: true, then any page your logged-in user visits can call your API with their session attached and read the JSON back. No XSS, no phishing page, no stolen password — just a fetch call in a script tag on an unrelated site.
This scanner replays your endpoints with hostile origins so you see the response headers an attacker would see.
Why this happens in AI-generated apps
AI coding tools — Lovable, Bolt, v0, Cursor, Replit — hit the CORS wall early. The first cross-origin fetch fails in the browser console, the model is asked to fix it, and the fastest fix that makes the error disappear is the broadest one: Access-Control-Allow-Origin: *, or origin: true in the Express cors middleware, or an edge function that copies req.headers.origin straight into the response.
Then credentials get added later. * stops working the moment cookies are involved, because browsers refuse that pair — so the next “fix” is to reflect the incoming origin instead. That change silences the error and quietly turns the policy into “every website is trusted.”
Local development hides all of it. On localhost everything is same-origin or already allowlisted, so nothing looks wrong until the app is deployed with real sessions. See CORS and credentials misconfiguration for the full pattern and OWASP Top 10 for AI-generated code for how it sits alongside the other failure modes.
What the scanner checks
WILDCARD ORIGIN
Access-Control-Allow-Origin: * on endpoints that return user-specific or authenticated data.
REFLECTED ORIGIN
Server echoes back whatever Origin was sent — functionally a wildcard, but credential-compatible.
CREDENTIALS + PERMISSIVE
Allow-Credentials: true paired with a reflected, null, or unvalidated origin. The critical combination.
NULL ORIGIN ACCEPTED
Origin: null allowed — reachable from sandboxed iframes and data: URLs an attacker controls.
WEAK DOMAIN MATCH
Prefix or suffix matching that accepts yoursite.com.attacker.tld or notyoursite.com.
BROAD METHODS / HEADERS
Allow-Methods including DELETE and PUT, or Allow-Headers: *, where the app only ever sends GET and POST.
MISSING VARY: ORIGIN
Per-origin policies without Vary: Origin — a CDN can cache one origin's allow header and serve it to everyone.
PREFLIGHT DRIFT
The OPTIONS response allows more than the actual GET/POST response does, usually because a proxy answers preflights separately.
How it works
- Discover — we load your URL in a headless browser and collect the API endpoints the frontend actually calls.
- Replay — each endpoint is re-requested with hostile
Originvalues: unrelated domain, null, subdomain, and lookalike. - Preflight — an OPTIONS request is sent for each to capture
Allow-Methods,Allow-Headers, andMax-Age. - Grade — every response is scored Pass / Warn / Fail, with the exact header values returned and a paste-ready fix.
Which CORS responses are safe?
| Response | Safe? | Why |
|---|---|---|
Allow-Origin: *, no credentials, public data |
Yes | Browsers refuse to attach cookies; nothing private is readable. |
Allow-Origin: * with Allow-Credentials: true |
No | Browsers reject the pair, so the app usually gets “fixed” into reflection next. |
Reflected Origin, no credentials |
Warn | No session data leaks, but it defeats any IP or origin-based trust and often precedes a credentials change. |
Reflected Origin with Allow-Credentials: true |
No | Any website can read authenticated responses as the logged-in user. |
Allow-Origin: null |
No | Sandboxed iframes and data: documents send Origin: null. An attacker can produce one. |
| Exact-match allowlist with credentials | Yes | The intended pattern — compare with equality against a fixed list. |
Suffix match (endsWith('yoursite.com')) |
No | notyoursite.com passes. Anchor the comparison. |
Allow-Headers: * |
Warn | Widens what a cross-origin request may set, including headers your auth layer may trust. |
Per-origin policy without Vary: Origin |
No | A shared cache can serve one origin’s allow header to a different origin. |
Common fixes
- Replace reflection with a static array of exact origin strings and compare with
===. If the origin is not in the list, send noAccess-Control-Allow-Originheader at all rather than a fallback. - Set
Access-Control-Allow-Credentials: trueonly on the endpoints that genuinely need cookies, and never with a wildcard or a reflected origin. - Reject
Origin: nullexplicitly. There is almost never a legitimate reason to allow it. - Trim
Access-Control-Allow-MethodsandAccess-Control-Allow-Headersto exactly what the frontend sends.GET, POSTand a namedContent-Type, Authorizationlist beats*. - Always send
Vary: Originwhen the policy differs per origin, so CDNs and proxies key their cache correctly. - Remember CORS is not authorization. It controls who may read a response; it never stops the request from arriving. Keep server-side authorization checks on every endpoint regardless.
- Re-scan after each deploy — CORS config drifts every time someone debugs a cross-origin error.
Related tools and guides
- Security Headers Checker — grades CORS alongside HSTS, CSP, and cookie flags.
- Token Leak Checker — a permissive CORS policy matters more when the bundle also ships keys.
- JWT Security Checker — if the API authenticates by bearer token, CORS is what lets another site use it.
- Source Map Exposure Checker — exposed source shows attackers exactly which endpoints to replay.
- .env Exposure Checker — check whether the config behind those endpoints is reachable too.
- Vibe Code Scanner — full security scan of a deployed AI-generated app.
- CORS credentials misconfiguration pattern — how the flaw is found and exploited in practice.
- OWASP Top 10 for AI Code — the canonical failure modes.
COMMON QUESTIONS
SCAN THE WHOLE APP, NOT JUST CORS
CORS is one header family. The VibeEval agent probes auth, RLS, tokens, and API behavior on the same URL.