What is the relationship between the revoking list and OCSP Stapling?

refs. Questions about Renewing before TLS-ALPN-01 Revocations

The revoking list has been released and I think about 2 million certificates have been revoked. Many of the URLs in this list of domain names have had their certificates invalidated by revocation. However, on the other hand, it seems that there are still URLs that we able to access by HTTPS connections.

For example, the following URL is applicable:

Current certificate information:

{
    "serial": "04CB226A7DBD61E67E0AA166EFACDD91FA68",
    "domainName": "status.mamisrv.ne.jp",
    "subjectAltName": "DNS:status.mamisrv.ne.jp",
    "CA": "Let's Encrypt",
    "notBefore": "2021/12/04 09:45:02",
    "notAfter": "2022/03/04 09:45:01"
}

So, and this domain name is on the revoking list. Pay attention to the serial. It is a match. (NOTE: ag is a command like grep.)

$ ag status.mamisrv.ne.jp tls-alpn-01-affected-certs-by-regID.csv 
1660723:111808547,"04cb226a7dbd61e67e0aa166efacdd91fa68","2022-03-04T00:45:01Z","status.mamisrv.ne.jp"

I think the reason why you can access this URL is because OCSP is running. When I check the OCSP Response Data, the certificate information of the same serial is returned.

$ openssl s_client -connect status.mamisrv.ne.jp:https -servername status.mamisrv.ne.jp -CApath /etc/ssl/certs -status < /dev/null 2> /dev/null | ag Serial
      Serial Number: 04CB226A7DBD61E67E0AA166EFACDD91FA68

Here's a question. Is this URL safe? Is it dangerous?

I would like to know your opinion on this situation.

2 Likes

When ISRG/LetsEncrypt revoked certificates, they did 2 things:

  1. Mark the certificates as revoked and publish it as revoked into the CRL/OCSP infrastructures
  2. Publish a CSV list/tool of those affected certificates

It's up to web browsers and client libraries to check if a certificate is revoked, and decide how to handle it.

Depending on the browser you use, those revoked certificates may or may not show up as revoked. In the past, some browsers (like Chrome) have still shown green padlocks on revoked certificates. That has been referred to as a "hard fail / soft fail" problem by some.

OCSP stapling also implements caching on the server and client level; IIRC, either can respect the cached value for up to 7 days from the timestamped signature.

TLDR; There are well known delays in how the global Certificate Revocation infrastructures handle and process revoked certificates. This is not unique to LetsEncrypt, but how the modern internet operates.

8 Likes

@jvanasco So that's how OCSP Stapling was supposed to be treated. Does this mean that 7 days after Jan 29, i.e. on Feb 5, the cache will expire and I won't be able to access it?

I understand now what the nature of the problem is. Thank you very much for your answer.

3 Likes

You can check the stapled OCSP response using the openssl s_client app using -status. It'll tell you this currently:

OCSP response:

OCSP Response Data:
OCSP Response Status: successful (0x0)
Response Type: Basic OCSP Response
Version: 1 (0x0)
Responder Id: C = US, O = Let's Encrypt, CN = R3
Produced At: Jan 25 14:00:00 2022 GMT
Responses:
Certificate ID:
Hash Algorithm: sha1
Issuer Name Hash: 48DAC9A0FB2BD32D4FF0DE68D2F567B735F9B3C4
Issuer Key Hash: 142EB317B75856CBAE500940E61FAF9D8B14C2C6
Serial Number: 04CB226A7DBD61E67E0AA166EFACDD91FA68
Cert Status: good
This Update: Jan 25 14:00:00 2022 GMT
Next Update: Feb 1 13:59:58 2022 GMT

Signature Algorithm: sha256WithRSAEncryption
     (...)

======================================

Notice how the "This Update" is from before the mass revocation on January 26th.

When we query the OCSP endpoint manually, we'll see:

osiris@erazer tmp $ openssl ocsp -issuer lets-encrypt-r3.pem -cert cert.pem -text -url http://r3.o.lencr.org
OCSP Request Data:
Version: 1 (0x0)
Requestor List:
Certificate ID:
Hash Algorithm: sha1
Issuer Name Hash: 48DAC9A0FB2BD32D4FF0DE68D2F567B735F9B3C4
Issuer Key Hash: 142EB317B75856CBAE500940E61FAF9D8B14C2C6
Serial Number: 04CB226A7DBD61E67E0AA166EFACDD91FA68
Request Extensions:
OCSP Nonce:
041049551457D7EE7BBBF02F5FF842412B13
OCSP Response Data:
OCSP Response Status: successful (0x0)
Response Type: Basic OCSP Response
Version: 1 (0x0)
Responder Id: C = US, O = Let's Encrypt, CN = R3
Produced At: Jan 31 12:09:00 2022 GMT
Responses:
Certificate ID:
Hash Algorithm: sha1
Issuer Name Hash: 48DAC9A0FB2BD32D4FF0DE68D2F567B735F9B3C4
Issuer Key Hash: 142EB317B75856CBAE500940E61FAF9D8B14C2C6
Serial Number: 04CB226A7DBD61E67E0AA166EFACDD91FA68
Cert Status: revoked
Revocation Time: Jan 29 00:09:04 2022 GMT
This Update: Jan 31 12:00:00 2022 GMT
Next Update: Feb 7 11:59:58 2022 GMT

Signature Algorithm: sha256WithRSAEncryption
     (...)

WARNING: no nonce in response
Response verify OK
cert.pem: revoked
This Update: Jan 31 12:00:00 2022 GMT
Next Update: Feb 7 11:59:58 2022 GMT
Revocation Time: Jan 29 00:09:04 2022 GMT
osiris@erazer tmp $

6 Likes

Essentially yes.

The two factors I am unsure about:

  1. When that OSCP response was cached
  2. How long a cached OSCP response is valid for

You'd have to inspect the server response to see (1) when the valid OCSP signature was generated, and then start the countdown of (2) from then.

While type, @Osiris answered #1 for you...

Assuming a 7 day cache time, the cached OSCP response should invalidated at 14:00 GMT on Feb 1 (today)

3 Likes

I thought OCSP responses should be updated earlier than just before the expiration? In my head I thought you´d usually update it half way the validated time frame?

4 Likes

Thanks to both of you for the additional information. It is very helpful.

3 Likes

I haven't looked at the RFC or Caddy's source code regarding OCSP Stapling (this domain seems to be on caddy), however every server implements stapling differently (if at all) and IMHO this feature has been somewhat experimental and "learn as we go" by every project that implements it.

As someone who develops on the server level, I would definitely try to enjoy as much time on a cache like this, and ignore the "should" timeline in favor of the "must" timeline.

3 Likes

FYI, I found this article from Cloudflare that goes into their implementation (at least at the time it was written). They eventually decided to pre-fetch and cache OCSP staples to avoid congestion and potential hard-fail issues. Emphasis added to this quote:

When a response started getting close to expiration, we’d fetch a new one. If the OCSP request fails, we put it into a queue to re-fetch at a later time. Since most OCSP staples are valid for around 7 days, there is a lot of flexibility in term of refreshing expiring responses.

4 Likes

Hm, RFC 6066 doesn't say anything about it.

"Close to expiration" is a, well, not very hard definition :stuck_out_tongue:

The Baseline Requirements do have some to say about the lifetime:

4.9.10 On‑line revocation checking requirements

(...)
4. For OCSP responses with validity intervals greater than or equal to sixteen hours,
then the CA SHALL update the information provided via an Online Certificate
Status Protocol at least eight hours prior to the nextUpdate, and no later than four
days after the thisUpdate.

So regular (≥16 hours) OCSP responses are renewed at least every 4 days, probably earlier. See also this incident: 2021.09.07 Delay updating OCSP responses

Therefore, webservers might choose to update the OCSP responses also at least every 4 days, so it'll always have a "fresh" one.

4 Likes

Yep, the Baseline Requirements place requirements on how often a CA must make a new OCSP response available (every 4 days, for OCSP responses that are valid for 7 days). But a webserver that downloads the OCSP response and then staples that response to all of their TLS handshakes can continue stapling the same OCSP response for 7 days, and that's perfectly acceptable. It's completely up to the webserver implementation how often they check for a new OCSP response to staple (with the caveat that if they wait too long, they'll be stapling a no-longer-valid response).

9 Likes

I appreciate your correspondence. It is very helpful.

4 Likes

Could I ask an additional question?

Notice the following domain names:

OCSP Response Data seems to be sent out from the server without being updated even after next_update.

$ TZ=GMT date
Wed Feb  2 01:45:42 GMT 2022
$ openssl s_client -connect sea-mew.jp:https -servername sea-mew.jp -CApath /etc/ssl/certs -status < /dev/null 2> /dev/null | head -n 19
CONNECTED(00000003)
OCSP response: 
======================================
OCSP Response Data:
    OCSP Response Status: successful (0x0)
    Response Type: Basic OCSP Response
    Version: 1 (0x0)
    Responder Id: C = US, O = Let's Encrypt, CN = R3
    Produced At: Jan 26 00:49:00 2022 GMT
    Responses:
    Certificate ID:
      Hash Algorithm: sha1
      Issuer Name Hash: 48DAC9A0FB2BD32D4FF0DE68D2F567B735F9B3C4
      Issuer Key Hash: 142EB317B75856CBAE500940E61FAF9D8B14C2C6
      Serial Number: 04697D768A1701CA427C87B78EE481BB1F02
    Cert Status: good
    This Update: Jan 26 00:00:00 2022 GMT
    Next Update: Feb  1 23:59:58 2022 GMT

What is this happening?

Sorry for continuing here without creating a separate thread.

1 Like

This is probably because:

  • The certificate has been revoked.
  • Most Web servers' OCSP stapling implementations will not serve an invalid (revoked) response. Instead, they'll serve what they already have, even if it's stale.
  • Most Web servers aren't able to trigger a renewal themselves. Even if they recognize the certificate is no longer valid, they don't have an ACME client (or an integration to one) built in.

It looks like that site is using Caddy, which can recognize an invalid response and renew. Maybe the site is running an older version without that ability, or something is wrong that's preventing validation.

7 Likes

I have a better understanding.

The certificate has been revoked.

But we can still access the URL in question. This makes it seem like it is possible to continue using revoked certificates. Am I misunderstanding something?

1 Like

Yes. Many Web browsers (and other TLS clients) do not check for revocation.

Many others do, though, so continuing to use a revoked certificate would be unwise.

5 Likes

@JamesLE Thanks for the reply. I understand the situation a little better now.

4 Likes

@JamesLE Once again, I don't know much about OCSP, but I have a simple question.

My understanding is as follows.

  • (a) All certificates in the revocation list have been revoked at the latest on Feb 2 (GMT).
  • (b) However, there were still URLs that we can HTTPS connections.
  • (c) For example, https://www.sea-mew.jp/ is applicable:
  • (d) The reason of why we can access is that the OCSP Response is being sent out from the server (OCSP Stapling)
  • (e) I thought that was only before the "Next Update" of OCSP Stapling, but apparently not.
  • (f) By continuing to send out OCSP Responses that are past due of Next Update, you can continue to allow access after the certification was revoked.
{
    "serial": "0327DE233A59025180811F2B05114C3E62A7",
    "domainName": "www.sea-mew.jp",
    "subjectAltName": "DNS:www.sea-mew.jp",
    "CA": "Let's Encrypt",
    "notBefore": "2021/12/16 10:22:11",
    "notAfter": "2022/03/16 10:22:10"
}
$ TZ=GMT date
Thu Feb  3 15:35:15 GMT 2022

$ openssl s_client -connect 'www.sea-mew.jp:https' -servername 'www.sea-mew.jp' -CApath /etc/ssl/certs -status < /dev/null 2> /dev/null | head -n 19
CONNECTED(00000003)
OCSP response: 
======================================
OCSP Response Data:
    OCSP Response Status: successful (0x0)
    Response Type: Basic OCSP Response
    Version: 1 (0x0)
    Responder Id: C = US, O = Let's Encrypt, CN = R3
    Produced At: Jan 27 14:22:00 2022 GMT
    Responses:
    Certificate ID:
      Hash Algorithm: sha1
      Issuer Name Hash: 48DAC9A0FB2BD32D4FF0DE68D2F567B735F9B3C4
      Issuer Key Hash: 142EB317B75856CBAE500940E61FAF9D8B14C2C6
      Serial Number: 0327DE233A59025180811F2B05114C3E62A7
    Cert Status: good
    This Update: Jan 27 14:00:00 2022 GMT
    Next Update: Feb  3 13:59:58 2022 GMT
$ ag www\.sea-mew\.jp tls-alpn-01-affected-certs-by-regID.csv 
275393:49720356,"0327de233a59025180811f2b05114c3e62a7","2022-03-16T01:22:10Z","www.sea-mew.jp"

My questions are as follows.

  • (Q1) Why can I access to https://www.sea-mew.jp/ as of 3pm on Feb 3 (GMT)? Is (f) the reason?
  • (Q2) If (Q1) is correct, then why can't I access to https://sea-mew.jp/ ...? What is the difference between sea-mew.jp and www.sea-mew.jp regarding OCSP or certification?
  • (Q3) Why are some URLs still we can access after revoking the certificate, and was there no way for Let's Encrypt to make them inaccessible? Is the OCSP Stapling mechanism vulnerable to the certificate revoke process?

I would appreciate it if you could answer my question.


In the process of researching these on my own, I found the following past thread.

I see that the same thing has already been discussed.

1 Like

On first glance, while the domains are related they are on two different certificates.

That inherently means:

  1. Even though they are part of the same revocation batch, they will have been revoked independently of each other, and at different timestamps.
  2. Their will each have a different cached OCSP response.

If you compare the date in that response to the one in your posts above, the OCSP responses were cached on different days.

It is NOT the role of LetsEncrypt, or any CA, to make a web server accessible or inaccessible. That is not how the internet works.

The role of a CA is to provide a trusted validation that a website operator is the valid owner of a SSL certificate at a given point in time. This is done by the initial challenge, a timely expiry, and methods for revocation (initiated by the website owner or the CA itself). The OCSP framework provides a mechanism for web servers, and clients, to perform a lightweight check to see if the Certificate has been invalidated before the actual expiry date.

While this check against the revocation list could be done in real time for every request, doing so would absolutely cripple the operations of both the CA and the web client. A consortium of operators from Certificate Authorities, Browsers, Operating Systems, SSL client libraries publicly developed the RFCs and CA/B Forum Guidelines that agreed on the OCSP framework as a functional compromise to the certificate revocation problem -- along with all the other implementation details. With regards to Certificate Revocation, the current system is not as secure as theoretically possible - but it is as secure as practically possible.

Browsers/Libraries and Servers deal with certificate revocation differently, as do Website operators. Both a webserver and browser have a variety of means to attempt a "hard fail" scenario if there is an issue with certificates, including having a "must-staple" flag in the certificate which requires a valid OCSP staple. Not every webserver is capable of handling this, and not every browser respects it. While many website operators want a "hard fail" scenario, for a variety of reasons a "soft fail" scenario is often necessary. One example of this is when there are issues with obtaining/renewing an OCSP staple for a valid certificate due to upstream availability or network congestion.

With all that being said, the answers to your questions above depend heavily on (1) decisions the website operator has made [certificate options, web server options, security policies] and (2) decisions the website consumer has made [browser, operating system, client/library options, etc]. The role of the CA is simply to be a trusted third party that can say "this certificate was valid at this timestamp" via the original certificate or shorter-lifespan OCSP response. The domain owner is free to publish a security policy, via "must staple" flags, CAA records, server flags, etc. Ultimately, the browser/client-library is responsible for deciding what to do with all that information and how it should respect a revoked or potentially-revoked certificate.

7 Likes

about (Q1) and (Q2)

Yes, I know that the certificate and the OCSP Response are different. However, they are the same in that they both use certificates from the revoking list and are OCSP Responses that are past the Next Update. Nevertheless, I wanted to know the reason for the different access results.

about (Q3)

I have not focused on Let's Encrypt's liability. I am not convinced that it is possible to make a site work permanently by exploiting OCSP Stapling, even though it is a revoked certificate. I simply want to know the answer to (Q1) and (Q2), and I wondered if OCSP Stapling is a beneficial mechanism for us.

1 Like