Thursday, July 20. 2017How I tricked Symantec with a Fake Private KeyComments
Display comments as
(Linear | Threaded)
What a sad world we live in :( Noobs, noobs everywhere.
Great job, Hanno!
>> Comodo didn’t fall for it. They answered me that there is something wrong with this key.
Were they responding to you as the reporter "I found something suspicious in Pastebin" or as the site owner? Basically, did they at any point contact the domain owner (via their WHOIS email or whatever) to say "Someone appears to have uploaded a private key to Pastebin"? Asking for a friend.
Comodo didn't respond to me as a domain owner at all. However what I don't know is if they responded to the site owners of the legitimate revocations.
Great find!
Comodo seems to have updated their description already https://support.comodo.com/index.php?/Knowledgebase/Article/View/684/17/how-do-i-verify-that-a-private-key-matches-a-certificate-openssl Aside from that, I'm not sure what the intended use of their article is. My personal guess is that it's intended to be useful for people who have to match their private key files to their public key files. Usually they'd not have a "forged" key laying around. For the purpose of finding the right file it's completely reasonable to only check the modulus. I imagine a case where some guy that manages his own websites somehow confused the naming of his key files and needs to match them again. However it's always better to check for consistency, of couse. My point being: It might be unfair to imply that all of the descriptions that you found are *wrong* when their purpose is not to cryptographically verify that some private key belongs to some public key but to merely match one file to another. It's terrifying though that you actually were able to "abuse" that in a real scenario with a real CA involved. (Well, you could debate whether they are a "real CA" ;) )
> My point being: It might be unfair to imply that all of the descriptions that
> you found are *wrong* when their purpose is not to cryptographically > verify that some private key belongs to some public key but to merely > match one file to another. I understand your argument, but I disagree. Ultimately if you want to be a trustworthy security company whatever you put on your webpage may be considered reliable information by people seeking to educate themselves. Thus I expect that such information is both accurate and tries to err on the side of security by default. And it doesn't matter here for whom that information was meant to be. If it's out on the Internet you can expect people will find and read it.
Re: "Notably there are downstream consumers of this function that failed to copy that part of the documentation, see for example the corresponding PHP function (the limitation is however mentioned in a comment by a user)."
The PHP documentation [1] has been updated [2] to include a very similar note as that in the OpenSSL docs. Thank you for your feedback. [1] http://php.net/manual/en/function.openssl-x509-check-private-key.php [2] https://bugs.php.net/74959
That's good. However as I already said in the OpenSSL bug tracker I don't think this is an issue that should be fixed by documenting it better. Ultimately if the function is named "check private key" then it should check the private key.
But I understand that PHP is just forwarding the function call to OpenSSL. It should be fixed there.
Agreed. I just wanted to update the docs, whether the function implementation is fixed or not, it's important to know it's (current) limitations.
The question "does the private key match" IMO is the wrong question in this context, and it is rather silly to stupid that there is a separate process for this case.
What SHOULD be done is that the private key should be used to generate and sign a revocation request (something that any sane key infrastructure should already support, though a search indicates the TLS infrastructure might not qualify), thus just re-using an ordinary and fully automated method of revocation. Yes, there also needs to be a way to revoke certificates if the owner lost access to the private key, but there are good reasons for that to be a manual process with heavy checking (thus take some time), but there is no reason to use it for all other cases that could be handled 100% automated and ought to result in certificates being revoked within minutes.
Actually there is such a method for the TLS ecosystem, it's part of the ACME protocol. However I think currently only Let's Encrypt supports it [1].
[1] https://letsencrypt.org/docs/revoking/
Thanks for bringing awareness to this issue! I've updated the checks and information at https://www.sslshopper.com/certificate-key-matcher.html to do the full check instead of just a modulus check.
|
About meYou can find my web page with links to my work as a journalist at https://hboeck.de/.
You may also find my newsletter about climate change and decarbonization technologies interesting. Hanno Böck mail: hanno@hboeck.de Hanno on Mastodon Impressum Show tagged entries |
Wer als “Websurfer” metaphorisch auf den Wellen des Netzes reitet, findet dabei zwar keine paradiesischen Inseln, manchmal aber immerhin ganz interessante Lektüre. Im Juli 2017 kann ich u.a. folgende Fundstücke empfehlen und der werten Lesers
Tracked: Aug 01, 07:35