Skip to content
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

Fail to do revocation checking on hosts, other than on google.TLD (and similar) (#1046) #1057

Closed
drwetter opened this issue May 17, 2018 · 2 comments
Labels
Milestone

Comments

@drwetter
Copy link
Collaborator

drwetter commented May 17, 2018

Those hosts also show a problem (hosts from Alexa Top-something):

prompt% grep 'Certificate Revocation List' * | grep -v "not revoked" | grep revoked                                                                                   
adidas.com: Certificate Revocation List  http://crl.entrust.net/level1k.crl, revoked
banggood.com: Certificate Revocation List  http://cdp1.digicert.com/ssca-sha2-g6.crl, revoked
biobiochile.cl: Certificate Revocation List  http://crl.comodoca.com/COMODORSADomainValidationSecureServerCA.crl, revoked
ca.gov: Certificate Revocation List  http://crl.comodoca.com/COMODORSAOrganizationValidationSecureServerCA.crl, revoked
csdn.net: Certificate Revocation List  http://cdp1.digicert.com/ssca-sha2-g6.crl, revoked
expedia.com: Certificate Revocation List  http://crl.entrust.net/level1k.crl, revoked
hitcpm.com: Certificate Revocation List  http://crl.comodoca.com/COMODORSADomainValidationSecureServerCA.crl, revoked
mozilla.org: Certificate Revocation List  http://crl3.digicert.com/sha2-ev-server-g2.crl, revoked
nba.com: Certificate Revocation List  http://crl.comodoca.com/COMODORSAOrganizationValidationSecureServerCA.crl, revoked
okta.com: Certificate Revocation List  http://crl3.digicert.com/sha2-ha-server-g5.crl, revoked
onlinesbi.com: Certificate Revocation List  http://sr.symcb.com/sr.crl, revoked
sourceforge.net: Certificate Revocation List  http://crl.comodoca.com/COMODORSADomainValidationSecureServerCA.crl, revoked
thefreedictionary.com: Certificate Revocation List  http://crl.comodoca.com/COMODORSADomainValidationSecureServerCA.crl, revoked
tianya.cn: Certificate Revocation List  http://crl.entrust.net/level1k.crl, revoked
tribunnews.com: Certificate Revocation List  http://gp.symcb.com/gp.crl, revoked
ups.com: Certificate Revocation List  http://crl.comodoca.com/COMODORSAExtendedValidationSecureServerCA.crl, revoked
zhanqi.tv:   Certificate Revocation List  http://ss.symcb.com/ss.crl, revoked
zhanqi.tv:   Certificate Revocation List  http://crl.entrust.net/level1k.crl, revoked
prompt% 

related tickets: #254, #1051

@drwetter drwetter added the bug label May 17, 2018
@drwetter drwetter added this to the 3.0 milestone May 17, 2018
@drwetter drwetter changed the title Fail to do revocation checking on hosts eother than google.TLD (and similar) (#1046) Fail to do revocation checking on hosts, other than on google.TLD (and similar) (#1046) May 17, 2018
@dcooper16
Copy link
Contributor

I tried banggood.com and csdn.net, and they are just broken. The cRLDistributionPoints extensions in the certificates contain http://cdp1.digicert.com/ssca-sha2-g6.crl. If you use wget or curl to retrieve the CRL from that location, the CRL that you receive contains an issuingDistributionPoint extension with a value of http://crl3.digicert.com/ssca-sha2-g6.crl. The two URLs are not the same, so this CRL cannot be used to determine the status of the servers' certificates. That is why OpenSSL reports an error of "Different CRL scope."

There is nothing we can do about it, except perhaps report the error.

dcooper16 added a commit to dcooper16/testssl.sh that referenced this issue May 29, 2018
This PR fixes problems with check_revocation_crl() sometimes reporting that a certificate is revoked even when it isn't, and with check_revocation_ocsp() sometimes reporting "error querying OCSP responder" even if the OCSP responder provided a good response. The most common reason for this to happen is that OpenSSL cannot validate the server's certificate (even without status checking). PR testssl#1051 attempted to get status checking to work even in cases in which the server's certificate could not be validated. This PR instead addresses the problem by not checking status if determine_trust() was unable to validate the server's certificate.

In some cases the server's certificate can be validated using some, but not all of the bundles of trusted certificates. For example, I have encountered some sites that can be validated using the Microsoft and Apple bundles, but not the Linux or Mozilla bundles.

This PR introduces GOOD_CA_BUNDLE to store a bundle that could be used to successfully validate the server's certificate. If there is no such bundle, then neither check_revocation_crl() nor check_revocation_ocsp() is run. When check_revocation_crl() and check_revocation_ocsp() are called, the status checks within them closely match the validation check in determine_trust(), which helps to ensure that if the check fails it is because of the status information.

As noted in testssl#1057, at least one CA provides incorrect information when the CRL is downloaded, so validation could fail for a reason other than the certificate being revoked. So, this PR adds a check of the reason that validation failed and only reports "revoked" if the validation failed for that reason.

As noted in testssl#1056, it is not possible to perform an OCSP query without access to the certificate issuer's public key. So, with this PR check_revocation_ocsp() is only called if the server's provided at least one intermediate certificate (i.e., the issuer's certificate, which contains the issuer's public key).
@drwetter
Copy link
Collaborator Author

Can close this now. According to my checks on the Alexa Top 1k we're fine now. There a a few (1%) which don't seem ok. A part of it is just a trust issue (certificate <--> hostname) other parts are more tricky and either broken OCSP/CRL endpoints or misconfiguration of supplied certificates on the server side.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants