News for hackers. Stuff that matters.
Re:Guile security vulnerability with listening on localhost ... by imagist on Thursday October 13, 2016 @11:42PM (#12705996)
Is this an issue with Guile, or is this an issue with browsers? It seems like allowing sites to query localhost is a vulnerability that could affect a wide variety of development tools. Maybe I'm not thinking of some use case, but it seems to me that we would only ever want requests to localhost to come from local sources, no?
Re:Guile security vulnerability with listening on localhost ... by pilif on Friday October 14, 2016 @01:03AM (#12706229)
Dropbox and Github both use it to talk to their installed desktop clients from the website. It's very useful as it by just installing an app, a website can get more access to the local machine's hardware without having to resort to browser-specific plugins.

In our case, we're using it to read data from a barcode scanner to use it on a web application. All a user needs to do is to install the application an once that's done it works in all browsers.

Re:Guile security vulnerability with listening on localhost ... by flukus on Friday October 14, 2016 @01:32AM (#12706300)
Can any websites talk to these apps? I've built a similar one (a decade ago now), but we at least had the benefit of only running on a closed network.
Re:Guile security vulnerability with listening on localhost ... by pilif on Friday October 14, 2016 @04:40AM (#12706811)
Potentially, yes. In our case we're doing a bit of additional work to prevent this from happening though. Other sites would get access to the built-in web server, but they wouldn't get anything apart from a 403 error.
Re:Guile security vulnerability with listening on localhost ... by imagist on Tuesday October 18, 2016 @09:45AM (#12734218)
> Dropbox and Github both use it to talk to their installed desktop clients from the website. It's very useful as it by just installing an app, a website can get more access to the local machine's hardware without having to resort to browser-specific plugins.

Okay, but from a user's perspective this is exactly what I would NOT want--it's unintuitive to me that going onto GitHub would give them access to my machine's hardware just because I have the app installed.

The program should serve the user, not GitHub or DropBox.

Re:Guile security vulnerability with listening on localhost ... by rixed on Friday October 14, 2016 @01:17AM (#12706254)
The site is not querying localhost, the browser is. I find it strange that we consider the error to lie in guile or redis or memcached or elastic search when clearly the browser is the security hole. Why is it so?
Re:Guile security vulnerability with listening on localhost ... by antocv on Friday October 14, 2016 @07:06AM (#12707297)
Well the browser must be able to visit http://127.0.0.1 whats so different about that than https://192.168.1.1 or any other address?

Its only in combination with DNS that a browser can be tricked into sending requests where it didnt intend - but thats a problem of DNS.

So libnss or whatever library the browser uses sees lists.gnu.org and resolves that to 208.118.235.17 so browser initiates connection to that IP, but on subsequent requests, the name lists.gnu.org is changed to 127.0.0.1, how would a web-browser notice this, shouldnt the dns-library warn about this or just use a cache?

In any case, you can prevent it like this

iptables -A OUTPUT -d 127.0.0.0/8 -p tcp -m owner --uid-owner $YOUR_USER_ID_OF_BROWSER -m tcp -j REJECT --reject-with-tcp-reset

that is, if you run the browser under its own uid.

Re:Guile security vulnerability with listening on localhost ... by Matt3o12_ on Friday October 14, 2016 @10:58AM (#12708479)
Quite simple. I don't think it is a good idea to allow querying sites from the locale network if the visited site is hosted on the public internet.

Let's say I visit google.com and it resolves to google's public Webserver. Your browser should be able to see whether the IP is in the public range (if I'm not mistaken you just checking that the IP is not an A, B, or C class IP, but don't quote me on that). If it is not a local IP (e.g. localhost, LAN, WAN), the browser should disallow all request to local IP addresses (Ajax queries, HTML frames, form requests) initiated by the initial page (google or whatever). It should work the other way around of course and I have never seen a use case where a public webpage relies on being able to query or send a request to my local network if this page is from the internet.

A normal HTTP redirect could be allowed because I think some routers rely on that to give the user a way to configure it (they tell the user to start configuring their router by going to config.manufacture.tld which displays some information and then issues a normal redirect to the default router IP).

Post request directly sent to the local network should be strictly forbidden, though. Why would I ever want to do that?

Re:Guile security vulnerability with listening on localhost ... by l_zzie on Friday October 14, 2016 @11:44AM (#12708834)
That could be nice. So, now the browser needs to understand routing tables?
Re:Guile security vulnerability with listening on localhost ... by Matt3o12_ on Friday October 14, 2016 @12:25PM (#12709143)
I'm not sure I follow. How are routing tabels related to knowing if the IP address is within one of the following ranges: 10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16, 127.0.0.0/8 and if it is the case, just not let the request get though (Adblock does that already).
Re:Guile security vulnerability with listening on localhost ... by rixed on Sunday October 16, 2016 @06:23AM (#12717920)
My original though as well. But eventually I prefer the DNS resolver to just forward whatever the DNS server says. Therefore, the issue can be said to lie in the DNS protocol.

But still, whatever the protocol, the browser is the program that does something privacy sensitive by basically being used as a remote code execution tool, and it should not trust whatever information from whatever source, including name resolution regardless of the protocol. Therefore the browser trusting DNS when something obviously shady is going on (such as a resource ip changing to 127.0.0.1) is a bug in the browser, I think. I would feel safer, for instance, if the same origin policy would apply to the same TCP connection for instance, so that no amount of name or IP spoofing could work. Of course internet giants would not like it, but that would be their problem not mine, and really not so hard to solve.

Re:Guile security vulnerability with listening on localhost ... by imagist on Tuesday October 18, 2016 @09:49AM (#12734259)
> Well the browser must be able to visit http://127.0.0.1 whats so different about that than https://192.168.1.1 or any other address?

127.0.0.1 accesses local servers that might be running code which is typically in development and insecure. There's nothing confusing about this.

Re:Guile security vulnerability with listening on localhost ... by JoshTriplett on Friday October 14, 2016 @03:10AM (#12706541)
Both. Browsers shouldn't allow requests to localhost or 127.0.0.0/8 from anything other than localhost, but guile also shouldn't listen on a port on localhost by default.
Re:Guile security vulnerability with listening on localhost ... by rekado on Friday October 14, 2016 @05:17AM (#12706929)
Guile does not listen on any port by default. To make it listen the `--listen` option has to be provided.
Re:Guile security vulnerability with listening on localhost ... by X-Istence on Thursday October 13, 2016 @11:48PM (#12706016)
This is a DNS re-bind attack.
Re:Guile security vulnerability with listening on localhost ... by brazzledazzle on Friday October 14, 2016 @12:37AM (#12706160)
I wonder if browsers will need to start including a dev mode toggle to allow access to anything hosted on the local loopback.
Re:Guile security vulnerability with listening on localhost ... by aikah on Friday October 14, 2016 @04:49AM (#12706844)
browsers absolutely SHOULD do that. A page on the internet shouldn't have access to localhost by default ever.
Re:Guile security vulnerability with listening on localhost ... by antocv on Friday October 14, 2016 @07:07AM (#12707302)
But this is not a case of a webpage on the internet having access to your localhost, its your local process which access local host!
Re:Guile security vulnerability with listening on localhost ... by languagewars on Friday October 14, 2016 @08:09AM (#12707540)
This is a webpage with an origin outside your host, it is only supposed to have implicit access to the same origin in a sandbox imposed by the local browser. Unfortunately the nature of that policy is broken by not going bellow resolved names, most especially for non-http where the service isn't sent the hostname the client used to resolve it.

So, it is most certainly appropriate for a browser to block local networks (including localhost) from being in foreign domains AFA sanboxing. I also don't want a website attacking my (id)iot router via this broken sandbox.

Re:Guile security vulnerability with listening on localhost ... by brazzledazzle on Friday October 14, 2016 @01:44PM (#12709806)
But don't they update DNS so that the origin for the (presumably sub) domain is now pointing at your localhost? Perhaps the solution is to track the DNS state. Any external to localhost changes should be blocked. And any communication between parent/sub domains should never cross the localhost boundary no matter what DNS might say.

Of course this would interfere with development so it would need to be something you could toggle. But I'm 100% sure there's something I haven't thought of that depends on this behavior.

Re:Guile security vulnerability with listening on localhost ... by l_zzie on Friday October 14, 2016 @11:45AM (#12708853)
It's not only a DNS rebind attack. I'm pretty sure in this case even a GET could get rce , so you don't even need to check the cors headers. You can just XHR.