[OWASP-Bangalore] XMLHttpRequest - Browser vulnerability how can it

cyber research 001.appsec.007 at gmail.com
Tue Aug 7 13:02:53 UTC 2018


Hello Guys,

I have following code which i'm testing gives me following error in browser
console "Refused to set unsafe header "connection" & in most of online
references it says "Not to use this headers" simply to remove this.

*Online Reference :*

XMLHttpRequest isn't allowed to set these headers, they are being set
automatically by the browser. The reason is that by manipulating these
headers you might be able to trick the server into accepting a second
request through the same connection, one that wouldn't go through the usual
security checks - that would be a security vulnerability in the browser.

*Query : *is this not advised or do you forsee any security issues in doing
the same

<html>
<body>
<script type="text/javascript">
function testXMLHttpReq() {
    var method = "GET";
    var url = "http://example.com/example ";
    var xhr = new XMLHttpRequest();
    xhr.open(method, url);
    xhr.setRequestHeader("connection", "close");
    var text = {"command":"PUSH"};
    xhr.send(text);
}
testXMLHttpReq();
</script>
</body>
</html>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.owasp.org/pipermail/owasp-bangalore/attachments/20180807/4a3662ed/attachment.html>


More information about the OWASP-Bangalore mailing list