309 points · by pabs3 · 3y ago · 150 comments
This is similar to the lame delegation problem; i.e. where some old forgotten subdomain has a CNAME record pointing to some big hosting provider; although the site does not work anymore, the CNAME record is still there, and an attacker could get an account at that same big hosting provider and sign up with the same subdomain name, since the CNAME record is still valid. This way, they would get access to providing connectivity (web content, incoming e-mail) for a domain name they should not have.
This is not completely true.
For HTTP challenge, yes its true. But for DNS Challenge its not.
DNS Challenge requires the provisioning of a special DNS Text record. Assuming you are using an API with your DNS provider this can happen over HTTPS. (Indeed I can confidently say it would Have to be over HTTPS, or similar.)
A DNS challenge is equally vulnerable to MITM unless DNSSEC is used.
The whole point here is that an entity which wants to MitM connections between a browser and website can obtain a certificate if they can MitM connections between a CA's validator and that website. If that validation isn't cryptographically secured, it's moot whether it uses HTTP or DNS from a security perspective.
The query from LetsEncrypt to your authoritative DNS server is unencrypted. The method you use to make an update is irrelevant, since the response can be spoofed by a third party with backbone surveillance capabilities.
It doesn't hurt to have this feature, but I suspect it would primarily protect against misconfigured DNS (where there's a CNAME someone forgot to remove that points to a hosting provider an attacker can get an account on). And of course, for making the HTTP challenge more secure.
I don't think so, that's what the other change Let's Encrypt announced does:
The change mentioned actually lands two CAA attributes. All the below assumes DNS integrity, either via DNSSEC or because the attacker hasn't been able to spoof your DNS records for whatever reason.
The accounturi attribute lets you bind to a specific ACME account, which means an attacker has to use your Let's Encrypt account to get certificates or it won't work. That means e.g. if you have a locked down ACME issuing server that has the account credentials and is supposed to handle all your issuing, but a bug means one of your test server got rooted by bad guys -- they don't get to issue certificates because they don't have the credentials from the locked down server.
The validationmethods attribute lets you specify that only some ACME methods ("challenge types") are permissible for this CA. So you can rule out methods you don't use, and thus forbid them to an adversary who might have found a way to use them.
If you have DNS integrity, set CAA to letsencrypt and validationmethods to require DNS ACME verification, you only need to protect DNS records, all your application protocol stuff is unable to cause issuance. So even though your new guy's "really cool" Python web service was immediately turned into a reverse shell by a Russian teenager and is now trying to send fake Viagra spam via your company email server, it can't get itself any certificates it wasn't supposed to have, which is a small blessing.
I know very little about ACME, but surely this (not having a cert yet) is only true the very first time you get a cert, or if you let the existing cert expire?
However the protocol consists of a number of steps. Around 8 to 10 steps. For all but 1 of the steps you are the client connection, so these happen over https. So its not like the whole conversation is in the clear.
The only step where the content is retrieved from the server is LE fetching a file, which is itself encrypted. So not over TLS, but the content itself is encrypted.
So I'm not really sure how an MITM attack works here.
IMO its much harder to carry out this MITM against a CA compared to typical MITM attacks against end users. CAs generally speaking aren’t connecting to random wifi hotspots or using random ISPs etc. So you’d need to be in a pretty privileged network position to carry this out. And the multi-endpoint resolution approach seems like it would make it very hard indeed to pull off.
That said, it seems a bit of a shame not to use the existing cert where one exists (which is presumably the case for most requests, which I’d expect are renewals).
Setting up the challenge, and fetching the certificate is done over https (the server acting as a client to LE.)
I suppose the MITM machine could recognizes the challenge, and attempt to then fetch the valid certificate (first?). I don't recall offhand if the client has a nonce for that request, I'd have to go and review the spec.
Before that a lot of extensions were introduced to somehow (poorly) cover other security risks (CRL, OSCP, CT Log, ...). Now we admit that secure certificate issuance requires DNSSEC to be in place in order to make CAA work securely.
Then why we have ditched DANE[1] in the first place? Why not infer public key trust directly from domain keys of DNSSEC? With dependence on DNSSEC, certificate authorities becoming fifth wheel.
[1]: https://en.wikipedia.org/wiki/DNS-based_Authentication_of_Na...
Crappy DNS servers basically only know how to "make the web work" in the sense it worked in about 1995. They expect questions like A? some.web.server.example and they reply with an IP address, it might be the right IP address, but not always. These servers of course have no idea DNSSEC exists.
When we send them anything else except 1995 style web browser queries they freak out, and either try to reply to it as though it was an A? query or they ignore the query. So you ask FANCY_MODERN_RECORD? web.site.example and it replies with an IP address even though that record's answer is a 64 byte compressed blob, or it silently ignores you...
Here in 2022 things have changed... but only slightly. We mostly got DNS servers to answer AAAA? by doing something at least vaguely sane, in some cases even actual IPv6 answers like the specification says. We think some other records work, although not always. And clients learned "Happy eyeballs" a strategy to just try everything and use whatever worked. But many of the servers out there are still crap.
The biggest change in 2022 is that lots of clients (especially web browsers) talk DoH. If you speak DoH (or DoT or any of these protocols but in practice it's DoH) you can actually get good answers from somebody whose DNS server works, a tremendous improvement. The browsers have by various means forced outfits who run such servers to actually do a competent job. Which means they implement DNSSEC, and, since the transport is TLS encrypted, you can choose to trust their validation answer.
Which means today arguably DANE is somewhat deployable. But more practically, meanwhile we built a bunch of stuff which means instead of clients needing to do DANE, we can get away with DNSSEC to specialists. Many real world web users have crappy DNS, but Let's Encrypt can get traction or change to a different provider or build their own servers or whatever they want because it's part of their core mission.
That's not a good reason not to deploy DNSSEC.
If DNSSEC/DANE is deployed, and some clients cannot make use of it because they are shitty, why hold back the non-shitty clients that can deal with DNSSEC/DANE? Just because 100% coverage for all clients isn't possible doesn't mean we shouldn't try to move the ball forward.
The perfect is the enemy of the good (/improvement).
By way of example: until a year or two ago, the last great hope of DANE was on stapled DANE records as a TLS handshake extension. No DNS lookups would even be required. But then, years into the project, somebody realized that attackers would just be able to strip those extensions off of handshakes. The only thing that prevented the attack was the Web PKI roots of trust --- which is what DANE was trying to augment in the first place.
Because that's only the first step. After that you have to solve all the problems WebPKI has already solved for itself.
Two primary things - the ability to remove trust anchors and visibility into issuance. Neither of which are in any means doable or solved with DNSSEC at this point in time.
That's the sense I get. Back in early 2011, there was still an issue where crappy DNS servers would sometimes respond to AAAA record requests with a "Server fail" error. Because of this, I had to tweak my recursive DNS server to treat a server fail to an AAAA request as if the AAAA record did not exist. This made IPv6 resolution more fragile, but it had to be done because of the state of the internet in early 2011.
I finally removed that "feature" here in 2022, when someone asked why I handled server fail responses to AAAA requests in this unusual manner.
I create private key.
I publish corresponding public key at some standard DNS record.
Then I can curl http://letsencrypt.org/cert/mywebsite.com and letsencrypt responds with certificate (probably cached unless it decides to issue new one).
So I can spend some time preparing this DNS configuration and then writing simple cronjob to fetch certificate every day and restart apache.
That would be vastly superior to current certbot horror and as secure.
> That would be vastly superior to current certbot horror and as secure.
Have you looked at Apache's mod_md, which allows you to integrate with ACME providers without certbot?
Here's the documentation, it's available since Apache 2.4.30: https://httpd.apache.org/docs/2.4/mod/mod_md.html
Configuration example from the docs:
MDomain example.org
<VirtualHost *:443>
ServerName example.org
DocumentRoot htdocs/a
SSLEngine on
# no certificates specification
</VirtualHost>
(you do need restarts/reloads to actually apply the provisioned certificates though, that part is up to you; I do it approx. daily since the startup is fast enough to not cause lots of downtime)I actually wrote a blog post about using Apache for that and other things, and moved my personal workloads over to it (still using Nginx and other servers at work): https://blog.kronis.dev/tutorials/how-and-why-to-use-apache-...
In short, in addition to having lots of useful modules, Apache has recently gotten the aforementioned ACME functionality, which makes it a bit more easy to use, like how web servers like Caddy also have "automatic HTTPS" functionality: https://caddyserver.com/
I'm yet to find a good self-hosted WAF solution, since mod_security doesn't seem popular or documented enough, even though it is better than nothing.
I tried certbot a few times, but never liked it.
Usually I use acme.sh on VMs and cert-manager on Kubernetes.
I'm replacing acme.sh with Lego currently. https://go-acme.github.io/lego/
Once you have Cloudflare (or one of many other options) set up it works as easily as you describe. And no port 80 open or special snowflake reverse proxy rules.
That said, I'm going to add this for my domains (all of which use Letsencrypt anyway).
(Well, append-only plus regular garbage collection.)
I have a domain with configured DNSSEC. Would publishing this make me as secure as publishing an accounturi? Would LetsEncrypt strictly disregard any non-DNSSEC queries to a DNSSEC domain?
Or do you mean Public Key Infrastructure in general?
For PKI in general, you don't have any actual choice. This is actually why the Web PKI exists. SSL was originally conceived with no PKI, but upon analysis there's a trust problem. Why is this the right key? If I have no reason to believe it's the right key, Mallory can MITM me, the protocol achieved very little of value. So that's why there's the web PKI.
If you don't like how the Web PKI works, it seems to me that improvements (of which there have been a great many in the 20+ years I've cared about it) are exactly "patching holes in the design" and so, yeah, duh, of course that's what we are going to do.
Before, an attacker only needed to 'global MITM' http requests. Your ISP could trivially do that. But your ISP couldn't just global MitM DNS queries for your domain unless you happen to use them as your registrar.
That is much harder than having an attacker use HTTP verification and global MITM the end user.
You are welcome to use CAA accounturi without DNSSEC and it will be effective.
Your zone may be vulnerable to an active man-in-the-middle DNS attack (which is hard to pull off), but it will still be protected against somebody figuring out how to upload an /.well-known/acme-challenge/ file on your domain and issue an unauthorized certificate from a foreign ACME account. This attack is much easier - I did it against a popular mail provider a few years ago.
Lots of servers out there support DoH
Unfortunately, it offers no privacy. DNS is usually the precursor to a tls connection, and the domain name is sent in cleartext during the tls handshake. So the same people who would hijack your DNS queries are still privy to them if you use DoH (routers, ISPs, governments, etc).
DNS seems eminently easy to secure against eavesdropping, given it is just distributed database, and a slowly consistent one at that. Someone just needs to step up to the plate and make a p2p resolver that communicates with a secure protocol, rather than the naive one spelled out in rfc1035. And with DNSSEC you wouldn't even have to worry about trusting/verifying other peers.
[0] The formal definition of someone who can break you, not the common usage that implies "trustworthy".
If you implement it correctly you are slightly more secure but there are better ways to spend your time.
If you are instead running your own DNS server, you're probably big enough that you can afford spending some time on configuring DNSSEC.
What a dishonest take. Microsoft didn't wasn't granted this court order because there was one bad no-ip user, Microsoft was granted the court order because there was a bad no-ip user that no-ip wouldn't take action against.
Oh, and it wasn't one bad user. It was 22000 different hostnames.
If the sought action of the court case, and the outcome were, "the domain were taken down" that would be one thing. Domains get suspended by court cases all the time, that's not the issue.
What makes the no-ip.org case extraordinary is that Microsoft a) persuaded the court that the domain was being used for malware, and then b) persuaded the court that because of this, rather than doing something normal like compelling its operator to take down the afflicted subdomains, or failing that compelling a third party to suspend the domain, that they should be allowed to take over DNS service for the domain.
Microsoft is not the law and they have no special legal status. If a domain is being used for cybercrime it's one thing, it doesn't mean any random party should get to walk into court, complain about it, and then offer to "solve" the issue by randomly appointing itself DNS provider. Microsoft essentially hijacked and MitM'd the domain via court order, again demonstrating that the registries/registrars will always be a risk here.
The result I might add was a massive outage for a massive number of innocent no-ip.org users.
Seeing that Microsoft are an unrelated third-party, what was the judge's reasoning for granting them specifically ownership of the defendant's property? Wouldn't it have made more sense to assign ownership to a government organization instead?
Did Microsoft reimburse the domain owner the value of the domain or did they just steal it without payment?
I do feel like the only way this request was granted was due to total ignorance on the part of the court of anything about how the internet works.
This is a completely normal measure, simply taking down a domain is not nearly as effective anti-malware measure than sinkholing it. A sinkhole could in some cases uninstall the malware from affected computers, or at least identify their IP-addresses for notification purposes.
>Microsoft is not the law and they have no special legal status.
Exactly.
>If a domain is being used for cybercrime it's one thing, it doesn't mean any random party should get to walk into court, complain about it, and then offer to "solve" the issue by randomly appointing itself DNS provider
Microsoft is not a random party, it's a party whose business is directly affected by these illegal malware campaigns and has been repeatedly held to have standing in these cases.
>The result I might add was a massive outage for a massive number of innocent no-ip.org users.
Turns out that possibly most no-ip users were malicious https://umbrella.cisco.com/blog/on-the-trail-of-malicious-dy...
Perhaps le should look into encorperating tor into its domain verification process.
I suspect Microsoft would also have trouble taking control of a domain registered under a gTLD run by a company based outside the US, but it would be interesting to see how the agreements between the gTLDs and ICANN would work out in practice.
Zones not under their control, however, are not vulnerable to this. So compared to the current system it would be an improvement.
Perhaps the water leak was caused by someone else, but it's still in your apartment.
2. The water leak isn't actually in the apartment if we're keeping this accurate to domains. Maybe the only phone the plumber will listen to is in the apartment.
3. As someone else already said, the judge is handing over the keys to the entire building.
I remember when this happened and I was trying to debug why I couldn't reach my home server.