Cross-origin resource sharing (CORS)
Methodology
Look for any CORS-related headers, such as:
Access-Control-Allow-CredentialsAccess-Control-Allow-Origin
Inject a custom
Originheader and observe if it is reflected:Origin: http://malicious-server.com
Attempt to inject a
nullvalue as theOriginheader.Attempt to inject a trusted-looking origin to bypass basic checks:
Origin: http://malicious-website.trusted-subdomain.com
Attempt to inject a malicious domain that includes a trusted subdomain as a subpath:
Origin: http://trusted-subdomain.malicious-website.com
If step 4 or 5 works, try to find an XSS vulnerability to exploit the misconfigured CORS and achieve full exploitation.
POC - CORS vulnerability with basic origin reflection
Example of reflection:

POC - CORS vulnerability with trusted null origin
Example of Trusted null origin:

POC - CORS vulnerability with trusted insecure protocols
Example of trusted insecre protocols

Last updated