Skip to main content
HighHeadersOWASP A05:2021CWE-942

How to fix: Private Network Access Allowed With Wildcard CORS

Access-Control-Allow-Private-Network is set to true while Access-Control-Allow-Origin is a wildcard, letting any public website's script reach into the private network.

Why it matters

A public webpage can use this endpoint as a pivot: the browser's Private Network Access checks are satisfied, so the attacker's script can send requests to internal-only services from a visitor's browser.

Private Network Access is a browser mechanism that normally blocks public websites from making requests to private-IP or localhost targets. Access-Control-Allow-Private-Network: true opts back into allowing it, and combining that opt-in with a wildcard origin removes the one control (origin allowlisting) that would otherwise limit who can use it.

How to fix it

  1. 1Never combine Access-Control-Allow-Private-Network: true with a wildcard origin.
  2. 2Explicitly allowlist the specific origins that are permitted to reach this private-network endpoint.
  3. 3Reconsider whether the endpoint needs to be reachable from a browser context at all.

Code examples

Restrict private-network CORS

TypeScript
const ALLOWED = ['https://internal-tools.example.com'];
const origin = request.headers.get('origin');
if (ALLOWED.includes(origin)) {
  headers['Access-Control-Allow-Origin'] = origin;
  headers['Access-Control-Allow-Private-Network'] = 'true';
}

References

Detected automatically by VulnRadar. The check id is access-control-allow-private-network-wildcard, stable across every scan so you can filter or diff on it.

See every headers check

Questions

How severe is Private Network Access Allowed With Wildcard CORS?
VulnRadar rates this high severity in the headers 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 access-control-allow-private-network-wildcard, which stays the same between runs so you can filter, diff, or gate CI on it.
Which standards does Private Network Access Allowed With Wildcard CORS map to?
It maps to CWE-942. 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 private network access allowed with wildcard cors

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

Private Network Access Allowed With Wildcard CORS | VulnRadar