Skip to main content
LowInfo disclosureOWASP A05:2021CWE-200

How to fix: CORS exposes internal CDN hostname

The Access-Control-Allow-Origin header references an internal-only host pattern (e.g., .internal, .local, .corp). This reveals internal infrastructure details that should not be visible in public responses.

Why it matters

A CORS header referencing internal hostnames (.internal, .local, .corp) reveals the internal network topology and backend service naming convention. Attackers can use this to identify backend services and pivot toward internal targets if they achieve access to another system in the same network.

CORS headers are sent to browsers to authorize cross-origin requests. When the Access-Control-Allow-Origin value is an internal hostname, it exposes the infrastructure layout. A wildcard (*) is dangerous for credentialed requests, while internal-origin values are a fingerprinting issue.

How to fix it

  1. 1Set Access-Control-Allow-Origin to the specific public customer-facing origin(s) only.
  2. 2Maintain an allowlist of valid origins and reflect only the exact matching origin, not internal hostnames.
  3. 3Never reflect internal CDN domains, .local, .corp, or cloud-provider hostnames in CORS headers.
  4. 4Use a centralized CORS configuration module rather than setting the header ad hoc in each endpoint.

Code examples

Express.js (safe CORS allowlist)

JavaScript
const ALLOWED_ORIGINS = new Set([
  'https://example.com',
  'https://app.example.com',
]);

app.use((req, res, next) => {
  const origin = req.headers.origin;
  if (origin && ALLOWED_ORIGINS.has(origin)) {
    res.setHeader('Access-Control-Allow-Origin', origin);
  }
  // Do NOT reflect internal CDN or cloud hostnames here
  next();
});

Nginx (CORS origin allowlist)

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

server {
  add_header Access-Control-Allow-Origin $cors_origin always;
}

References

Detected automatically by VulnRadar. The check id is cdn-cors-exposes-internal, stable across every scan so you can filter or diff on it.

See every info disclosure check

Questions

How severe is CORS exposes internal CDN hostname?
VulnRadar rates this low severity in the info disclosure category. The severity is fixed per check, not scored per site, so the same finding is the same severity on every scan.
Does VulnRadar check for this automatically?
Yes. It runs as part of every scan under the check id cdn-cors-exposes-internal, which stays the same between runs so you can filter, diff, or gate CI on it.
Which standards does CORS exposes internal CDN hostname map to?
It maps to CWE-200. In the OWASP Top 10 it falls under A05:2021.

Missing a check?

The detection set is open. If you know a misconfiguration this does not catch, propose it: the issue template asks for the threat model, how to detect it, the false-positive risk, and a test fixture, which is the same thing a maintainer would have to work out anyway.

Propose a checkHow a check is built

Scan your own site for cors exposes internal cdn hostname

VulnRadar runs this check and hundreds more against a URL in seconds. No agent to install, just paste a URL.

Or scan this site as a demoRead the docs

How to fix: CORS exposes internal CDN hostname | VulnRadar