Cross-Origin Resource Sharing
Last updated
Was this helpful?
Last updated
Was this helpful?
Initially Ajax requests have traditionally been restricted by the Same Origin Policy which only allowed them to make request to resources within the same domain. HTML5 breaks this restriction and allows for Ajax requests to be made across domains.Cross-origin resource sharing (CORS) is a mechanism that allows restricted resources on a web page to be requested from another domain.
The implemented Cross Origin Resource Sharing (CORS) allows wildcard ( * ) as a response in header "Access-Control-Allow-Origin" which may lead to leaking of sensitive data to unauthorized locations as the origin header is not configured with exact domains. It Leads to an Misconfigured CORS
Go to the respective site (eg: )
Open Burp suite Community Edition. Here, is the to configuration on your browser.
In burp suite, go to proxy tab and go to HTTP history. Then sent any request to the repeater by right click on the packet.
In Request Whatever domain for eg:www.example.com should not reflect in the Access-Control-Allow-Origin response header.
We can exploit the CORS when the domain for eg: www.example.com in Access-Control-Allow-Origin response header which is given in the Origin Header and when Access-Control-Allow-Credentials: true is present.
To use a whitelist of trusted domains for eg: www.example.com rather than using a wildcard or programmatically verifying supplied origins.i.e Origin header Should be validated with the specified domain like if the origin header matches ''. If yes, it returns Access-Control-Allow-Origin: .