White-spaces in host IP address, leading to same origin policy bypass
Originally disclosed on Mozilla
- Fixed in 42 days
- Paid in 46 days
- Disclosed after 42 days
It is possible to add white-space characters in host names being IP addresses, which can lead to some security issues, including same origin policy bypass.
Here's an example:
1. 176.58.110.151 is an IP address of host sekurak.securitum.com.
2. Enter the following line in JS console (you can replace \x0b with \x0c as well):
location = 'http://176.58.110.151\x0bRANDOM_STUFF_HERE<html>'
3. Host name is still resolved to 176.58.110.151, while the host header will contain the string "176.58.110.151\x0bRANDOM_STUFF_HERE<html>". The same applies to document.domain and location.origin.
Furthermore, using location.host or location.hostname, it is also possible to include new-line (0x0A) and tab (0x09) in host names. The former allows to request header injection attack.
location.host = '176.58.110.151\nApache_will_complain_about_bad_request'
Using unicode transliteration in DNS names, you can also put "@" character there. Interestingly, in the case below, a favicon will be set to the one of youtube.com:
location.host = '176.58.110.151\x0b\uff20www.youtube.com'
I can think of a few scenarios abusing this behaviour:
1. Phishing attempts: for less cautious users domains like: "176.58.110.151\x0b.accouts.google.com" might look genuine. The address bar even highlights "google.com"
2. Some postMessage implementations verify origin by checking its last characters. So any checks based on the scheme: `if (origin.endsWith(".example.com"))` will fail with host "176.58.110.151\x0bx.example.com".
3. Request header injection might be abused to perform some attacks, not usually possible with web browsers, like shellshock.
4. The most interesting one: bypass same origin policy - with help of Flash Plugin (which is a pretty common scenario). The notable exception here is, however, that it only works for http requests; it is not possible to do that in HTTPS because you can't have a valid certificate to any <ip_address><white_space><stuff> domain name.
I have created a PoC here: http://sekurak.securitum.com/fx_sop_bypass942958/
You just enter an URL and it is fetched into an <pre> element. The idea is as follows:
1. There's a flash file using URLLoader and URLRequest classes. Using these, you can download any URL given that it is in the same origin as the flash file.
2. The URL of the flash file is abusing the "@" trick shown earlier. For example: when you try to fetch a resource from http://translate.google.com, the flash file is fetched from domain "176.58.110.151\x0b\uff20translate.google.com" that gets transliterated to "176.58.110.151\[address removed]".
3. Firefox fetches the file from 176.58.110.151 but Flash assumes it is run in http://translate.google.com origin hence allowing to get any resource from http://translate.google.com.
Please let me know if you have any further questions.
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 Networking. Mozilla made it public on 8 October 2015 as CVE-2015-7188.
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.