insecure CORS

 Hey guys how are you,

Today we are going to discuss about insecure cors (cross origin resource sharing).

What is CORS

An insecure CORS configuration allows any website to trigger requests with user credentials to the target application and read the responses, thus enabling attackers to perform privilegied actions or to retrieve potential sensitive information.

How to find this vulnerabilitie

By checking response headers

For this do watch this video:

https://drive.google.com/file/d/1C1AGdwEgteV3fk17aYXmRypTK1CDB6nj/view?usp=drivesdk

By checking request header:

For this do watch this video:

https://drive.google.com/file/d/1S_6pFmO4Stod1j3SO4IRwH68lwbZT-1p/view?usp=drivesdk

There are a number of HTTP headers related to CORS, but the following three response headers are the most important for security:  

Access-Control-Allow-Origin specifies which domains can access a domain’s resources. For instance, if requester.com want to access provider.com’s resources, then developers can use this header to securely grant requester.com access to provider.com’s resources

Access-Control-Allow-Credentials specifies whether or not the browser will send cookies with the request. Cookies will only be sent if the allow-credentials header is set to true.

Access-Control-Allow-Methods specifies which HTTP request methods (GET, PUT, DELETE, etc.) can be used to access resources. This header lets developers further enhance security by specifying what methods are valid when requester.com requests access to provider.com’s resources.

Exploitation of Insecure CORS

Following are the two best attack scenario for exploitation of insecure cors:

If you found following response headers:

POORLY IMPLEMENTED, BEST CASE FOR ATTACK:

Access-Control-Allow-Origin: https://attacker.com

Access-Control-Allow-Credentials: true


POORLY IMPLEMENTED, BEST CASE FOR ATTACK:

Access-Control-Allow-Origin:null 

Access-Control-Allow-Credentials: true

For this do watch this video:

https://youtu.be/0IMz8d9Cby4

That's all for today guys hope you will understand it.

And also don't forget to follow us on Instagram and GitHub and do like our content on Instagram:

https://instagram.com/__pytools__

https://GitHub.com/pytools786







Comments

Popular posts from this blog

what is log4j vulnerability

Secure your system from Pegasus spyware

Pegasus spyware