27 posts left…
This was one of the more complex issues Josh Sokol and I talked about during our presentation at Blackhat. Let’s say there’s an SSL/TLS protected website (addons.mozilla.org) that an attacker knows that the victim is using. The attacker is a MitM but let’s say that addons.mozilla.org has no security flaws in it whatsoever. Let’s also say that there’s another subdomain called mxr.mozilla.org that has the following attributes: It has no important information on it (otherwise the attacker would be content with attacking it instead), it’s vulnerable to XSS, it doesn’t care about host headers and uses a wildcard cert for *.mozilla.org. How can an attacker use that to their advantage?
The victim requests the IP for addons.mozilla.org for which the attacker modifies the responding DNS TTL to 1 sec (and all subsequent DNS traffic to that domain). The victim logs into addons.mozilla.org (gets cookie). Doing login detection can help determine that the user is authenticated but it’s important that the attack doesn’t start before this, otherwise the attack will fail.
The attacker firewalls off the IP to addons.mozilla.org and forces user to the XSS URL at:
https://addons.mozilla.org/mozilla-central/ident?i=a%20onmouseover%3Dalert(’XSS’)%20a (notice that the hostname is wrong as it should be mxr.mozilla.org because that is where the XSS lives). Note that this WAS a real XSS in mxr, but has been fixed, and to make it work it would require the user to mouse over it, so you’d have to do some clickjacking or something, but let’s just pretend that all wasn’t a problem, and/or that there was an easier XSS.
The victim requests the IP for addons.mozilla.org again but this time the attacker responds to the DNS request (with 1 second TTL) with the IP address of mxr.mozilla.org (not addons). The user connects to the mxr.mozilla.org IP address sending the wrong host header - the reason this works is because the wildcard SSL/TLS cert allows for any domain and the mxr.mozilla.org website doesn’t care about host headers. The victim runs the XSS in context of addons.mozilla.org even though they’re on the mxr.mozilla.org IP. That sounds bad (maybe useful for phishing) but there’s worse the attacker can do.
We talked with a few people in various places about how likely this is, and although it worked on one of the two sites we checked we think the likelihood that it will work on SSL/TLS enabled sites is pretty low. It has to be wild card, has to have HTTP Response splitting/XSS, etc… and has to ignore the host header. We guesstimate that it’s probably between 2-4% of SSL/TLS protected sites that would be affected by this, although, in reality there’s not a lot of risk here because this has a lot of moving parts - there are certainly easier exploits out there. But the interesting part is this is yet another reason that all sub domains should be considered in scope when you’re talking about something sensitive sitting behind authentication beyond just breaking in and stealing the cert outright.
Incidentally when I told the Mozilla guys about this, they said, “Why would we have checked for XSS in mxr? There’s nothing important on there… It’s all public information.” followed by, “Well, it’ll be fun checking for XSS on all our sub domains now.” That’s a good idea anyway for phishing, but checking for host headers is an easier short-cut in the short term. I wouldn’t worry about this attack, because it’s unlikely, but it was interesting coming up with the use case.