-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Technically constrain root CA #75
Comments
On macOS it looks like you can manually mark the root CA as not trusted and still have it work for the VPN connection (deleting the CA stops the connection from proceeding as expected) In |
Looks like macOS and iOS (general release, haven't verified betas) don't implement nameConstraints 😠 OpenSSL 1.0+ and Firefox seem to. Don't have anything else to test with |
$500 bounty! Submit a pull request and email dan@trailofbits.com to claim it. Partial solutions may be rewarded. |
Wouldn't it be a simple, bare minimum mitigation to password-protect the CA private key? Or even better offer a mode in which it never touches the disk and then is destroyed? The former doesn't help if the attacker waits for a users update, and neither help if a third party sets up a server for you, but this is a pretty big exposure increase. For instance, me myself I'd rather use a public wifi w/o VPN than allow a server to MitM my TLS connections. |
The more I think about it the more I believe this warrants a pretty visible disclaimer. The threat model of who routes my traffic is directly informed by my trust in TLS verification. |
There's some deprecated EKU's around IPSec.
I admit to being a bit confused though, I wasn't under the impression a VPN server needed to also be a trusted root. Or, even if it does (for various deployability purposes), does the private key need to persist? It's not a problem for the client to trust a root cert that only exists to validate one specific leaf. |
Splitting roots between user->server and server->user, where the former lacks ServerAuth and the latter is ephemeral, might work. Even if two roots is banned, one root that's ephemeral, with two intermediates that otherwise meet this design, almost has to work (unless, you know, leaf nodes don't inherit EKU constraints of parent nodes, which I'm sure somebody screwed up). |
Constraining the CA key in a cross-platform way is likely a dead end (https://twitter.com/sleevi_/status/808374227074105344). There are 2 "easy" solutions available:
I think #1 is the right long term solution, and I think #2 is the right hot-patch we can do today. |
@gunph1ld I think the simplest immediate "fix" for this issue is to generate a random password for the CA privkey during the install process and print it to standard out. The update script will have to be changed to accept a password too. I'll file a new ticket for generating the keys on the client, rather than the server. |
Hey all, just a note to catch everyone up on our efforts to resolve this issue. #75 merged in a randomly generated password for the CA private key. For a user that never runs #169 moves the CA generation process to the client, but it has not been merged yet because we're looking for more reviewers. We plan to make ephemeral generation the default and only store the CA private key when specifically requested (if a deployer intends to update the user list later). |
The local certificate generation branch was merged into master (#169). All new users of Algo have their certificates generated on the client and, by default, the private key for the root CA is discarded after the server is deployed. So, you still have to install a root CA with all privileges, however, the private key for it is only available on your client during the installation process. In order to steal it, an attacker would have needed code execution on your client during the installation process. If that were true, then you're situation is unchanged by the installation of an Algo CA -- you are completely hosed. There are some minor improvements that we can make, like generating the keys in a tmpfs, but an attacker with code exec on your client is likely to find a way around that anyway. We will continue to look for opportunities to take advantage of BasicConstraints as the support for those restrictions gains support on more client platforms (in particular, iOS/macOS). |
Note: Apple may have added a new feature on iOS that allows you to distrust the root CA. See #294. |
Ooh! Nice. I heard but didn't have time to verify that name constraint support was added to the latest iOS and macOS as well |
I may have dialed up the heads of a few departments at Apple to complain immediately after you filed this ticket :-P |
It sounds like this issue is resolved with #169, no? Or am I missing something? |
It is mitigated, but the root cause has not been addressed on non-Apple devices. |
In the current form (from what I understand anyway) is that the root CA could be used to MITM HTTPS and other TLS connections that use the system certificate store (e.g. Google Chrome, iOS Safari) transparently if the box were to get popped (or your friend isn't one).
If the root were technically constrained there'd be less of a possibility to do damage to stacks that support the constraints if the private key were obtained.
Here's a selection of the constraints that could possibly be used but I'm sure I've missed or used some incorrectly:
IP:<server>
) This would probably affect client certificate issuance too but a randomly generated reserved "DNS name" might work for the permit side such asDNS:<uuid4>
allowing<client name>.<uuid4>
to be validThe text was updated successfully, but these errors were encountered: