Avoiding downtime: modern alternatives to outdated certificate pinning practices
blog.cloudflare.com
blog.cloudflare.com
None of the solutions offered address the risk that pinning tries to mitigate, namely that you have a client who trusts a misbehaving/rogue/malicious CA (perhaps you installed a VPN or AV or something that added a system-wide CA to your machine?) and their connection to your service gets mitm-d.
Shorter certificate lifetimes - does nothing to mitigate that risk.
CAA records - not checked by client, only ensures that if a malicious actor somehow gets a hold of your domain, they need to use a particular CA to issue their publicly-trusted malicious cert.
CT monitoring - yes, for WebPKI certs, but does not protect against the risk above, as the bad CA-s are likely not sending certs to CT log.
Distributed DCV checks - sure, this is something CA-s should be doing, not something you have control over.
ACME URI in CAA - operational issues quite likely, good if you can pull it off, but again, does not address the risk above.
What is an actual alternative to cert pinning? Your API should have an additional layer of encryption with keys that you have full control over.
Also, the "Understanding the trade-offs of different certificate pinning implementations" misses one important thing : you can pin the CA, and still requires the cert to be valid for your FQDN
I've seen this a couple of time, and this is wonderful : fully secure, and denies the managed mitm setup by the security team.
I think the fundamental issue is that all of the players in the PKI world want to essentially enforce that services must be able to deal with short-lived certificates and certificate revocations. As an example, see the recent HN article where Digicert tried to do mass certificate revocations due to a bug with their certificate issuance, and were then sued by a client (Alegeus) who did not have things set up to deal with revocations quickly, so Digicert postponed the revocation: https://news.ycombinator.com/item?id=41114794 . So basically, the powers that be are trying to say "certificate cycling is part of the process - 'set it and forget it' is a thing of the past."
Now, in your objections, you state "None of the solutions offered address the risk that pinning tries to mitigate, namely that you have a client who trusts a misbehaving/rogue/malicious CA", but CAA with CT monitoring should largely prevent that. With CAA monitoring you state "only ensures that if a malicious actor somehow gets a hold of your domain..." - well, if a malicious actor somehow gets ahold of your domain, you're generally fucked in any case - if they've got control of your domain it's probably not a huge step up to get control of your signing cert.
I think your comment brings up good points to someone like me who's not an expert, but it still feels like the overall point that needs to be addressed is that "certificates should be expected to expire or be revoked at any instant" and certificate pinning breaks that.
Edit: just to clarify, I agree with the article in principle, pinning public certs is just not a workable solution in the current TLS ecosystem and should be avoided, but the author of the article does not understand what attacks pinning is supposed to prevent in the first place, as the solutions offered do not offer the same security guarantees.
Is pinning to certs signed by CAs you don't control, but that are public and trusted, beneficial over using self signed ones? I guess you won't (easily) land in CT log. Anything else?
If you're pinning the leaf certificate this way, really the only benefit I see of using a WebPKI cert is if you want to reuse the same API endpoint for a web app. Otherwise you're mostly getting a bunch of restrictions and downsides (information leaks from CT, revocation drama, etc) that don't make sense if the cert is hard coded in the client.
But yes, for the specific narrow use case of web pages and web browsers, this means out of band installation into the browser trust store. And if we focus on this particular use case, what difference does it make if the cert is self signed or not?
IMO, pinning only solves the corner case scenario where a public CA is compromised or issuing fake certs under the table. Everything else is make-the-blue-team-feel-good measures like trying to keep users from intercepting their own traffic, or actively owner-hostile effects like devices no longer working when the cert is rotated. I'm happy to see CloudFlare calling for it to be retired.
[1] sometimes it's more DIY than that, where the code will require that the issuing cert have a particular string in its name, etc.
Any solution to this requires something that basically looks like certificate pinning. You've gotta rely on your server provider to use a dwindling set of "trusted by the original device firmware and also still trusted now" root certs forever (which gets fun when all of those certs are mandated to expire), or you've gotta create some other mechanism to establish trust on software updates (delivering them via unencrypted HTTP and then verifying an OpenPGP signature is a common choice).
I’ve heard multiple times that “certificate pinning is obsolete.” Who is pushing this narrative?
It's true that CT doesn't prevent this class of attack; instead what it does is require that valid certificates be public, thus -- at least in principle -- allowing for detection of misissuance.
1. Almost all mobile devices used by adults to access their work email have provisioning profiles that allow trusted certificates to be installed by one’s employer.
2. Plenty of authoritarian counties require trusting CAs operated by the government. If you have users in those countries, they are vulnerable to snooping.
Your blog post makes it seem like users vulnerable to MITM attacks are in the minority, when in fact they are likely in the vast majority.
* The client requests additional certificate chains
* The server returns multiple certificate chains (typically two), one chaining to a public CA, once chaining to a private CA
* The connection only succeeds if all expected chains are present and valid
* The public-key of the leaf certificates must be identical
This means:
* The public chain can follow standard practices around certificate transparency, renewal, revocation, expiration, etc.
* Clients which don't care about pinning but expect a standard public chain will work
* The chain to the private CA protects against a compromised public CA for clients which request/validate it
* Requiring identical public-keys means that this only impacts chain validation, not the key-exchange
I understand the "leaf" or "domain" update is done when the request is made, and that I as the end user don't need to do anything.
However if an intermediate certificate is updated, do I now need to update the app or client (OS/browser etc)?
Because I can sure see it in Google's interest to ensure clients only use the latest browsers, OS'. I suppose it becomes another "control" point.
If your client cannot resolve a domain (outdated hardware/software) you're out of luck.
If Google pushes changes to, for example, data collection within Chrome, they're going to want all users to update ASAP (e.g manifest V3, break older versions of chrome by rotating certificates).
This is what I want to know as well especially with respect to many applications running in Kubernetes.
We ended up doing slow brown-outs over a long time period to deal with it.
At a large company I have to imagine that monitoring them would just end up being noise.
All that lengthy blog post and no explanation of what configuration is causing this and in what kinds of software. And how to find certificate pins in your infrastructure.
Anyone know?
So I guess it's disappointing not only that they're wrong here in this article, but it's also disappointing they'd sell off some of their credibility earned by their expertise to trick people into an implementation with a much larger maintenance cost.
Anyone have any alternatives to cloudflare, is there anyone who still values correctness over making money?
And sometimes it isn't mistakes that require cert rotation, but cryptographic breakthroughs that render the algorithms in the cert insecure.
It's much better engineering to accept that certs will need to be rotated and make sure it happens regularly so it's not a huge emergency when it's required.
Do you have an example of this happening? I know I remember a few cases that sound similar, but weakening of a signature, or key is very different from it breaking.
I'll also point out, if you find the signature made by a CA is weakened such that it can be forged; certificate pinning would actually protect existing users from such an attack.
> It's much better engineering to accept that certs will need to be rotated
that's a very debatable assertion, but I don't disagree outright
> and make sure it happens regularly so it's not a huge emergency when it's required.
No, that's not good engineering. Do something needlessly, so that it's easy to do it when it becomes required is operations not engineering. Engineering would be designing a system that requires the minimal amount of operational support. Certs do need to be updated, and maintanted, they don't need to be rotated.
Flame (back in 2012) was a pretty famous example of certificate forgery due to weak hash choice (MD5) and other operational weaknesses in the PKI (predictable serial numbers, if I remember correctly).
> Do something needlessly, so that it's easy to do it when it becomes required is operations not engineering.
I don't think that's a good interpretation of what 'agwa meant. I'm pretty sure he meant that it's considered good engineering practice to build systems that don't encourage the normalization of deviance, which long-lived certificates combined with manual rotation procedures historically have.
Or put another way: automatic rotation procedures ensure the isostability of a PKI, rather than its brittle stability.