How to fix: CORS Origin Reflection with Credentials (unverified)
A single scanned response shows Access-Control-Allow-Origin set to the exact origin the scanner requested from, with credentials allowed. This is indistinguishable, from one response alone, between a server that blindly reflects any Origin and a server that correctly validated it against a strict allowlist.
Why it matters
If the server blindly reflects any Origin without validating it, any website can make authenticated cross-origin requests. This finding alone does not prove that: it only shows that the one origin the scanner sent was accepted, which is exactly what a correctly implemented allowlist would also do.
Some servers reflect the incoming Origin header without validating it against an allowlist, effectively acting as a wildcard with credentials. Others validate against a strict allowlist and then echo back that same, now-confirmed-safe origin, which looks identical in a single response. Confirm by sending a request with a clearly untrusted Origin and checking whether it is also reflected.
How to fix it
- 1Validate the Origin header against a strict allowlist.
- 2Never blindly reflect the Origin.
- 3Log and monitor rejected CORS requests.
Code examples
Validate origin
const ALLOWED = ['https://yourdomain.com'];
const origin = request.headers.get('origin');
if (!ALLOWED.includes(origin)) return new Response(null, { status: 403 });References
Detected automatically by VulnRadar. The check id is cors-origin-reflection, stable across every scan so you can filter or diff on it.
More headers checks
Questions
- How severe is CORS Origin Reflection with Credentials (unverified)?
- VulnRadar rates this low 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 cors-origin-reflection, which stays the same between runs so you can filter, diff, or gate CI on it.
- Which standards does CORS Origin Reflection with Credentials (unverified) 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.