Cross-origin resource sharing (CORS)
Last updated
Last updated
Methodology
Look for any CORS-related headers, such as:
Access-Control-Allow-Credentials
Access-Control-Allow-Origin
Inject a custom Origin
header and observe if it is reflected:
Origin: http://malicious-server.com
Attempt to inject a null
value as the Origin
header.
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.
Example of reflection:
Example of Trusted null origin:
Example of trusted insecre protocols