Letsencrypt’s Vulnerability Or Feature – Eternal Account Key

Category : enigmabridge , https , security

print

The growth of Let’s Encrypt is phenomenal – 7 million certificates in last four months. The remaining hurdle for automation is verification of domain ownership. Well, actually it is NOT true. We were doing syntax testing – hoping to get the right kind of verification error … only to discover we have been successfully verified without providing any information.

 

Wle-certs-issued-june-22-2016hatever you say about let’s encrypt project, you can’t deny its success. Issuance of certificates has been commoditized for a while and definitely ripe for disruption. Let’s Encrypt is the disruption and its adoption, despite shorter validity of certificates issued by Let’s Encrypt CA, is exponential and really fast.

We played with Let’s Encrypt for our Cloud PKI service (https://enigmabridge.com/amazonpki), which we hope to launch on Amazon AWS Marketplace as soon as we get through administrative hurdles.

Our goal was to use DNS-based challenge verification as that would allow us to create a new PKI instance with browser-trusted HTTPS as part of an instance initialization. Dusan was testing the command line syntax of certbot so that we could start integration with DNS records’ updates.

To his and subsequently everone’s confusion, he realized that he got issued a certificate without any challenge verification at all. All he had to do was to run the following command:

certbot certonly --agree-tos --text \
--email [email protected] \
--authenticator manual --preferred-challenges dns \
-d durham1.pki.enigmabridge.com

He quickly did a verification – copied his test account key to another server (a random Amazon EC2 instance) and got another valid certificate for the “durham1.pki.enigmabridge.com” domain.

It frightened me, it didn’t look right, it didn’t smell right. I decided to investigate. With help of Kenn White I reached out to security guys at LE as well as to Brad Warren working on the Certbot project. Brad provided us with some new information and links to documentation that showed this behaviour was

a feature of Let’s Encrypt.

Where is the problem? Expectations!

We tried to figure out why we had freaked out and thought it was a bug. The answer was relatively simple. We always expected that every single certification request would include fresh verification of the domain ownership. This is not true any more with re-usable AUTHZ tokens (see Upcoming change: valid authz reuse).

As we understand the process, we need two things to get a new Let’s Encrypt certificate:

  1. account key [stored on our server]- it’s and RSA key that we generate and which is stored on the server requesting a certificate (e.g., in /etc/letsencrypt/accounts/acme-v01.api.letsencrypt.org/directory/…)
  2. authorization token (Authz) [kept by Let’s Encrypt] – it’s created by Boulder (i.e., the registration authority of Let’s Encrypt) upon successful execution of a domain ownership verification.

The surprising aspect is that Authz has a validity of 300 days (which is likely to be increased). It means that within 299 days of issuance of an Authz token, all we need to get a new certificate is the account key.

Update: I was wrong here, it seems that the validity is now 90 days.

The matter of expectations is that we always assumed that the account key is important – it creates the JWS signature on certification requests – but it’s always coupled with on-the-fly verification that we control the domain name for which a new certificate was requested.

Let’s have a look at the diagram below. Disclaimer: this is as I understand the mechanism, I’d love to hear from anyone who can confirm this or show my fallacy.

on_the_importance_of_account_key

Attackers need to know only the account key to successfully request new rogue certificates.

You can see that attackers only need to compromise the “Super important server” once. As long as this “Super important server” uses Let’s Encrypt, it will keep updating the authz token. The “Bad guys to launch MITM” or some kind of masquerade attacks only have to be good enough not-to-lose the stolen account key. The Authz token updates will be done by the “Super important server”!

What Are Were My Expectations

I certainly didn’t expect the importance of the account key to be paramount. It now appears it is the single piece of secret needed to get a new Let’s Encrypt certificate.

I didn’t expect there would be a “master key” with infinite validity and that I should look after it as such.

I did expect that each request includes a fresh verification of the domain control. And I also expect that substantial majority of people out there believe in this process / data flow as that’s how certificates have always been verified – for each new certificate, you either have to send an email from a given domain or put a file to a web server’s folder.

I do expect this is an accident waiting to happen situation that needs to be rectified – the sooner the better. Whether it’s a technology change or re-adjustment of user expectations.

I also expect that our Enigma Bridge Cloud HSM service (check our PKI product with hardware key security) can securely control storage and use of the account key to prevent thefts of the keys and their subsequent misuse.


About Author

Dan Cvrcek

Co-founder of Radical Prime and Enigma Bridge. Indendent consultant on security and encryption systems (incl. large banking, payment, and enterprise systems) ... and a university professor.

14 Comments

Cyber Sec News for Oct 24+ – Our Security Blog (c) 2015-6

25th October 2016 at 8:36 am

[…] It frightened me, it didn’t look right, it didn’t smell right. I decided to investigate. With help of Kenn White I reached out to security guys at LE as well as to Brad Warren working on the Certbot project. Brad provided us with some new information and links to documentation that showed this behaviour wasa feature of Let’s Encrypt!!! here […]

Christoph Wegener

25th October 2016 at 1:24 pm

Great post! I certainly wasn’t aware of this feature and I’m sure I’m not alone. I agree that this feature should be prominently documented for everyone to understand.

CyberGuerrilla soApboX » Let’s Encrypt’s Vulnerability

25th October 2016 at 3:41 pm

[…] Let’s Encrypt’s Vulnerability As a Feature – AUTHZ Reuse and Eternal Account Key […]

Alex Hope

25th October 2016 at 3:45 pm

Thanks for the writeup!

Let’s Encrypt’s Vulnerability As a Feature – AUTHZ Reuse and Eternal Account Key – Magic Security | Georgia 2600 Hackers irc.2600.net #GA2600

25th October 2016 at 4:13 pm

[…] Source: Let’s Encrypt’s Vulnerability As a Feature – AUTHZ Reuse and Eternal Account Key – Magic Sec… […]

Anonymous

25th October 2016 at 6:31 pm

As of last Thursday the validity is now 60 days! Goal is to eventually reduce this towards 7 days. Using cached domain authorization for issuance isn’t specific to Let’s Encrypt. Other CAs do this as well but with less visibility/control into the mechanics.

You could issue a new certificate using an existing valid authz w/o solving a challenge before this feature existed. The reuse feature only addressed cases where the client asked for a new authz/challenge for a domain even though there already was a valid authz for that domain associated with the account. It was an optimization and did not change any security properties of the protocol or domain validation.

Stoyan Petkov

27th October 2016 at 1:36 pm

Can you recommend alternative solution for small enthusiasts who don’t own a huge business and just want to learn?

    Dan Cvrcek

    27th October 2016 at 10:19 pm

    I still believe that letsencrypt is fundamentally sound. The problem I see is that it’s built and run by geeks who not necessarily see user problems.

    I will soon post about a new extension of the client software (still mostly for geeks) but we are working on improvements in usability and putting users very much in the driving seat.

OMB Releases Draft Guidelines for Federal IT Modernization (October 27, 2016) (SANS Newsbites) – sec.uno

28th October 2016 at 8:42 pm

[…] https://dan.enigmabridge.com/lets-encrypts-vulnerability-as-a-feature-authz-reuse-and-eternal-accoun…
 […]

US Director of National Intelligence: It’s Time to Separate Cyber Command from NSA (October 25, 2016) (SANS Newsbites) – sec.uno

28th October 2016 at 8:43 pm

[…] https://dan.enigmabridge.com/lets-encrypts-vulnerability-as-a-feature-authz-reuse-and-eternal-accoun…
 […]

Microsoft Extends Office 2016 Macro Security Feature to Office 2013 (October 27, 2016) (SANS Newsbites) – sec.uno

28th October 2016 at 8:49 pm

[…] https://dan.enigmabridge.com/lets-encrypts-vulnerability-as-a-feature-authz-reuse-and-eternal-accoun…
 […]

Senator Seeks Answers to IoT Security Issues Following Botnet Attack (October 25, 2016) (SANS Newsbites) – sec.uno

28th October 2016 at 8:52 pm

[…] https://dan.enigmabridge.com/lets-encrypts-vulnerability-as-a-feature-authz-reuse-and-eternal-accoun…
 […]

Schneider Electric Fixes Unity PRO Vulnerability (October 27, 2016) (SANS Newsbites) – sec.uno

28th October 2016 at 9:07 pm

[…] https://dan.enigmabridge.com/lets-encrypts-vulnerability-as-a-feature-authz-reuse-and-eternal-accoun…
 […]

Powering Simplicity of Certbot and Letsencrypt – Domain Verification – Magic Security

3rd November 2016 at 11:21 am

[…] Letsencrypt’s Vulnerability Or Feature – Eternal Account Key […]

Leave a Reply