Skip to content
Calcrivo

CORS Policy Calculator

Test a CORS configuration for the combinations that leak data cross-origin, and score the residual risk against your data sensitivity.

Inputs

Sandboxed iframes and file:// pages send an opaque Origin header value

seconds

Overall Risk Severity

Critical

Configuration Risk

6.60/ 9

Impact Score

7.00/ 9

Credentialed Cross-Origin Read

Possible — any allowed origin can read authenticated responses

Preflight Cache

Reasonable — preflights are cached, so latency stays low

Highest-Value Fix

Replace Origin reflection with an exact server-side allow-list

Step by step

  1. Values used

    Access-Control-Allow-Origin = Reflects the request Origin — 8; Access-Control-Allow-Credentials = true with a reflected origin — 9; Allowed methods = All state-changing methods — 7; Allowed request headers = Explicit list including Authorization — 5; Exposed response headers = An explicit non-sensitive list — 4; Opaque origin (sandboxed iframe / local file) is accepted = No; Sensitivity of the data behind the API = Customer PII — 7; Access-Control-Max-Age = 600 seconds

  2. CORS Policy

    Configuration risk = mean(origin policy, credentials, methods, headers, exposed headers) on the OWASP 0–9 scale, plus 2 when an opaque origin is accepted; impact = data sensitivity.

  3. Overall Risk Severity

    = Critical

  4. Configuration Risk

    = 6.60 / 9

  5. Impact Score

    = 7.00 / 9

  6. Credentialed Cross-Origin Read

    = Possible — any allowed origin can read authenticated responses

  7. Preflight Cache

    = Reasonable — preflights are cached, so latency stays low

  8. Highest-Value Fix

    = Replace Origin reflection with an exact server-side allow-list

How it works

The dangerous combination is a reflected or loosely matched origin together with Allow-Credentials: true, because that lets any page the victim visits read authenticated responses from your API. A wildcard origin scores lower than reflection since browsers refuse to combine * with credentials at all. A permissive CORS policy is a same-origin bypass you deployed yourself — it turns every authenticated GET endpoint into a cross-origin data feed with no exploit required.

Formula

CORS Policy

Configuration risk = mean(origin policy, credentials, methods, headers, exposed headers) on the OWASP 0–9 scale, plus 2 when an opaque origin is accepted; impact = data sensitivity.

originPolicy
1 fixed origin … 9 regex or suffix match
credentials
1 not sent … 9 true with a reflected origin

Frequently Asked Questions

How is CORS Policy calculated?

Configuration risk = mean(origin policy, credentials, methods, headers, exposed headers) on the OWASP 0–9 scale, plus 2 when an opaque origin is accepted; impact = data sensitivity. The dangerous combination is a reflected or loosely matched origin together with Allow-Credentials: true, because that lets any page the victim visits read authenticated responses from your API. A wildcard origin scores lower than reflection since browsers refuse to combine * with credentials at all.

Why does CORS Policy matter?

A permissive CORS policy is a same-origin bypass you deployed yourself — it turns every authenticated GET endpoint into a cross-origin data feed with no exploit required.

What values do I need to enter?

This calculator takes 8 inputs: Access-Control-Allow-Origin, Access-Control-Allow-Credentials, Allowed methods, Allowed request headers, Exposed response headers, Opaque origin (sandboxed iframe / local file) is accepted, Sensitivity of the data behind the API, Access-Control-Max-Age. The pre-filled defaults are a realistic starting point — replace them with figures from your own environment for a result you can act on.

Why is Origin reflection worse than a wildcard?

Because reflection works with credentials and a wildcard does not. Browsers reject Access-Control-Allow-Origin: * whenever Allow-Credentials is true, so a wildcard leaks only unauthenticated data. Reflecting whatever Origin arrives satisfies the browser check for every attacker origin at once.

You might also need