CORS
Impact: if a response contains any sensitive information such as an API key or CSRF token, you could retrieve these info.
Server ACAO Header from Client-Origin
Some app read the Origin header from requests and including a response header stating that the requesting origin is allowed.
Detection
Send request with Origin: https://example.com
and see if the origin is reflected in the Access-Control-Allow-Origin
header.
Exploit
Errors parsing Origin headers
Suppose normal-website.com
. Bypass withhackersnormal-website.com
or normal-website.com.evil-user.net
Note: you need to know the whitelisted origins.
Whitelisted null origin value
Detection
Send request with Origin: null
and see if the response has Access-Control-Allow-Origin: null
Exploit
Exploiting XSS via CORS trust relationships
Suppose that:
If you find an XSS on subdomain.vulnerable-website.com
inject JavaScript that uses CORS and retrieve information.
Cookie SameSite
Last updated