Skip to main content

API CORS Check API

developer
GET/v1/domain/api-cors

Tests and analyzes CORS (Cross-Origin Resource Sharing) configuration. Catches the OWASP/PortSwigger-grade CORS bugs that simple wildcard checks miss: missing Vary: Origin (cross-origin cache poisoning), allow-list bypass via prefix/suffix domain matching, origin reflection, and null-origin acceptance.

What It Does

Sends three parallel OPTIONS preflights with different Origin headers (example.com, evil.attacker.com, null). If the preflights return no CORS headers, falls back to a GET probe — many backends spec-violate by only attaching CORS headers on real requests, not preflights. When origin reflection is detected, runs two additional probes (`<domain>.attacker.com` and `attacker.com.<domain>`) to catch prefix/suffix allow-list bypasses. Always checks for `Vary: Origin` when the server uses a non-wildcard origin — its absence is a CRITICAL finding per MDN and PortSwigger (browsers can cache responses meant for origin A and serve them to origin B).

Why It's Useful

Misconfigured CORS is a common security vulnerability (per OWASP Web Security Testing Guide) that can allow unauthorized cross-origin access. Testing CORS configuration helps identify potential data exposure risks.

Use Cases

Security Engineer

Security Audit

Audit API CORS configuration for overly permissive settings.

Find CORS misconfigurations before attackers exploit them.

Backend Developer

API Development

Verify CORS is properly configured for expected client origins.

Ensure CORS settings match application requirements.

Penetration Tester

Penetration Testing

Test for CORS vulnerabilities during web application assessments.

Identify exploitable CORS configurations.

Parameters

NameLocationTypeRequiredDescription
domainquerystringRequiredDomain or full URL — accepts `example.com` or `https://example.com/path`.Example: https://api.example.com

Response Fields

Result fields below are inside the JSON data object. Any row named meta describes the sibling response metadata object. See response and error handling for status codes and error responses. Optional observations may be absent or null; inspect warnings and partial-failure fields before treating a missing result as a negative finding.

FieldTypeDescription
domainstringThe queried domain (bare hostname).
urlstringFull URL that was fetched, echoing the protocol used in the request.
corsEnabledbooleanWhether CORS headers are present
detectionMethodstring"preflight" when OPTIONS returned CORS headers, "simple-request" when the GET-fallback probe found them, null when CORS is disabled
isWildcardbooleanWhether Access-Control-Allow-Origin is wildcard (*)
configurationobjectCORS config: allowOrigin, allowMethods, allowHeaders, allowCredentials, maxAge, exposeHeaders, AND varyOriginPresent (whether the response sets Vary: Origin)
securityobjectSecurity assessment: isPermissive, credentialsWithWildcard, reflectsOrigin, allowsNullOrigin, missingVaryOrigin (true when dynamic origin allow-list is used WITHOUT Vary: Origin — cache-poisoning risk), and allowListBypass: { prefix: boolean, suffix: boolean } (true when an attacker-controlled domain matching a prefix/suffix pattern was accepted)
recommendationsarrayCORS security improvement suggestions — CRITICAL severity flagged for missingVaryOrigin and allowListBypass findings

Code Examples

Replace YOUR_API_KEY with your API key. This endpoint requires the developer plan or higher; see plans and usage limits.

cURL
curl --request GET 'https://api.edgedns.dev/v1/domain/api-cors?domain=https%3A%2F%2Fapi.example.com' \
  --header "Authorization: Bearer YOUR_API_KEY"
JavaScript
const response = await fetch(
  "https://api.edgedns.dev/v1/domain/api-cors?domain=https%3A%2F%2Fapi.example.com",
  {
    "method": "GET",
    "headers": {
      "Authorization": "Bearer YOUR_API_KEY"
    }
  }
);

if (!response.ok) {
  throw new Error(`EdgeDNS returned HTTP ${response.status}`);
}
const data = await response.json();
console.log(data);
Python
import requests

response = requests.request(
    'GET',
    "https://api.edgedns.dev/v1/domain/api-cors?domain=https%3A%2F%2Fapi.example.com",
    headers={'Authorization': 'Bearer YOUR_API_KEY'},
    timeout=60,
)
response.raise_for_status()
data = response.json()
print(data)

Read the full API CORS Check guide

Learn the concepts, choose a practical workflow, and interpret the observations from API CORS Check before acting on them. Run supported checks via MCP or through REST.

Read the guide →

    Related Endpoints

    External References

    Learn more about the standards and protocols behind this endpoint.

    Try This Endpoint

    Test the API CORS Check endpoint live in the playground.

    API CORS Check API Reference | EdgeDNS