Live data from Hacker News

Document reasoning to block DNS to 127.0.0.1

github.com

11–20 of 45 posts

Re: Document reasoning to block DNS to 127.0.0.1

#11
post #8

Annoying, but understandable. There's a reason localhost gets special treatment, as do many other local addresses. Local dev sites easily form a fingerprint that you don't want trackers to be able to use. I'm not sure why this applies to first party browsing, though. In its current form ( https://github.com/easylist/easylist/blob/master/easyprivacy... ) several of these domains got the $third_party modifier which sho…

I thought about the cert thing here too.

I own a domain and internally use local.domain.com for all internal sites. Wildcard and specific names.

I can generate certs using ACME/LetsEncrypt.

So, everything, including test sites could be on that domain.

For reference, I use PiHole and OpnSense, and internally machines in DHCP and static IPs get local.mydomain.com resolution too.

Re: Document reasoning to block DNS to 127.0.0.1

#12

This is the explanation given by the person who committed this change: > Is a security issue, imagine if you're running a webserver on a site decided to access it from outside, whether to fingerprint you or act nefariously. There should be no reason why a third-party access localhost. But do tell me, why we should we trust sites accessing localhost. It makes no sense to me. Unless someone knows of a better reason, I'…

I've debated that reasoning in the security field and it just goes round-and-round in circles. There are legit cases to avoid this but less about security and more about scanning tools that poorly detect attempts to the loop-back as DNS rebinding attacks vs. an actual DNS rebinding attack which requires malicious code. So avoiding this can avoid some false positives from 3rd party scanners and having to get into silly arguments with people. There are some other obscure edge cases but they delve more into hypothetical scenarios and people can never seem to show a real world implementation of their theoretical attack. Besides, there is nothing stopping anyone from pointing any domain to 127.0.0.1 on their recursive servers or via /etc/hosts so if this is a risk then somebody is doing something very wrong.

Funny story though, I used to park wildcard sub-domains on 127.0.0.1 just to keep the bots off the load balancers and a customer said that we were running a vulnerable version of PHP. I said we had no installations of PHP anywhere in production. Turned out they were scanning one of my parked wildcard sub-domains and effectively were scanning their own laptop which had some old PHP web app running on it. That also told me they were also not validating certs.

Re: Document reasoning to block DNS to 127.0.0.1

#14
post #8

Annoying, but understandable. There's a reason localhost gets special treatment, as do many other local addresses. Local dev sites easily form a fingerprint that you don't want trackers to be able to use. I'm not sure why this applies to first party browsing, though. In its current form ( https://github.com/easylist/easylist/blob/master/easyprivacy... ) several of these domains got the $third_party modifier which sho…

> if you're developing software you should probably be running without any addons like uBlock enabled to prevent surprises in production for your non-uBlock users.

It seems to me there's a higher risk that uBlock blocks something and breaks something than uBlock making something work that wouldn't for people not having it. I once had a filter block something called /share/ or share.js, fortunately I noticed during the development. I definitely prefer having it enabled while developing.

> Besides that, you can't get HTTPS for these domains (without the mess of a custom CA and even then you'll run into CT issues)

Indeed. I recently had to do this and found mkcert [1] which makes it very easy to do. But it's overkill for most situations.

[1] https://github.com/FiloSottile/mkcert

Re: Document reasoning to block DNS to 127.0.0.1

#15
post #7

Has this user’s GitHub account potentially been compromised? The reasoning they give makes no sense; their style of writing also doesn’t match previous commits that they’ve made. Maybe looking too deep into this, but this commit makes absolutely 0 sense and should be reverted.

That actually reads like Ryan to me, I don't think his account has been compromised.

From the commit set (e.g., [0]), it looks like he was expanding EasyList's blocking of sites that use 127.0.0.1 DNS records to carry out DNS rebinding attacks and fingerprinting, and overlooked this legitimate use case for such records.

Legitimate, that is, as long as all of the domain owners are trusted, because this does open up opportunities for conten served from those domains to punch through the same-origin policy and read back data served from 127.0.0.1. This can be a security hole, e.g., I've seen browser extensions in-the-wild which jury-rig IPC to an external helper process by opening up an HTTP API on a local port.

[0] https://github.com/easylist/easylist/commit/f11ee956a6e585d8...

Re: Document reasoning to block DNS to 127.0.0.1

#16
Not a fan of EasyPrivacy. It seems to be run by trigger happy people with pretty limited understanding of the web.

They once blocked workers.dev (Cloudflare Workers) wholesale[1], resulting in a huge flood of issue reports for a few FOSS services of mine. Guess they've never heard of public suffixes.

This one appears to be someone reading about DNS rebinding attack somewhere, then pulling the trigger without understanding it. Or maybe I even overestimated them, DNS rebinding only came up as a justification very deep into the discussion.

To make matters worse, clients using these block lists have update frequencies all over the place, so you can never be sure when your stuff gets unborked for all your users even after they revert changes like this.

[1] https://github.com/easylist/easylist/commit/e4b0216

Re: Document reasoning to block DNS to 127.0.0.1

#17
post #8

Annoying, but understandable. There's a reason localhost gets special treatment, as do many other local addresses. Local dev sites easily form a fingerprint that you don't want trackers to be able to use. I'm not sure why this applies to first party browsing, though. In its current form ( https://github.com/easylist/easylist/blob/master/easyprivacy... ) several of these domains got the $third_party modifier which sho…

> Besides that, you can't get HTTPS for these domains (without the mess of a custom CA and even then you'll run into CT issues)

Of course you can, you just cant use HTTP validation for it. Use DNS validation and it works fine.

Re: Document reasoning to block DNS to 127.0.0.1

#18
post #8

Annoying, but understandable. There's a reason localhost gets special treatment, as do many other local addresses. Local dev sites easily form a fingerprint that you don't want trackers to be able to use. I'm not sure why this applies to first party browsing, though. In its current form ( https://github.com/easylist/easylist/blob/master/easyprivacy... ) several of these domains got the $third_party modifier which sho…

> you can't get HTTPS for these domains

What are you talking about? Certificate insurance and DNS A/AAAA records are entirely decoupled. Use the ACME dns-01 challenge to get a cert for domains resolving to anything, including 127.0.0.1 or ::1. Alternatively you can even use http-01 or other challenges to get a wildcard cert, with subdomains pointing to localhost. I use Lets Encrypt certs for localhost and LAN every day.

Edit: a little more precision.

Re: Document reasoning to block DNS to 127.0.0.1

#19

This is the explanation given by the person who committed this change: > Is a security issue, imagine if you're running a webserver on a site decided to access it from outside, whether to fingerprint you or act nefariously. There should be no reason why a third-party access localhost. But do tell me, why we should we trust sites accessing localhost. It makes no sense to me. Unless someone knows of a better reason, I'…

I thought chrome was now blocking this anyways unless you specificly opt in with CORS.

Re: Document reasoning to block DNS to 127.0.0.1

#20
post #13

Do they only block 127.0.0.1? If this truly is a security improvement I would like to see an explanation why they don't block 127.0.0.0/8 instead.

No, they blocked (now reverted) a specific list of domains which are presently known to resolve to 127.0.0.1. The actual IP address isn't used, it's a DNS block.
Post reply on HN