Unfulfilled Expectations: Revoked Certificates in JAR Signing
Oracle JarSigner does not check CRLs
In April 2020 we became aware of a conceptual security issue in the Java JarSigner. The JarSigner does not check certificate revocations, which breaks JAR signing to some extent.
In this blog post we are going to talk about this issue. The blog post is written in cooperation with Daniel Ostovary from SignPath. We have reported this issue to Oracle shortly after its discovery. To understand this issue, one has to understand Certificate Revocation Lists (CRLs) first.
Certificate Revocation Lists
If the owner of a certificate wishes to revoke their certificate (i.e. invalidate it, for example, because of compromise), they can request the issuing Certificate Authority (CA) to put the certificate on a CRL (e.g. see ). The CRL distribution point is indicated in the CA’s certificate . Often, a verifier of a signature checks the certificate’s CRL to see if it is revoked  (e.g. the Windows signature verification of an executable).
The Security Issue
We found evidence that there was some CRL check for JAR signatures in the past (e.g. for Java Applets in JDK 7; see [1-3]). However, a source code analysis of the JarSigner of the JDK 12 and a review of its official documentation  show that CRLs are not automatically checked, neither by the JarSigner nor anywhere else in the JDK. Instead, as Oracle told us, developers are expected to call the PKIXRevocationChecker explicitly to check for revocations.
Since the JarSigner does not check CRLs, any stolen and revoked code-signing certificate can be used to sign JARs without the JarSigner warning users of a revoked certificate. That is unless users explicitely check revocation with the PKIXRevocationChecker. As verifiers of a signature often check the CRL of the certificate, users of the JarSigner almost certainly expect the JarSigner to do so too. These users rely on CRLs for security, but the JarSigner does not actually provide this level of security.
Addressing the Security Issue
Shortly after discussing the issue with Oracle, they created a ticket to address this issue . This ticket is expected to be resolved with JDK 15, which is planned to be released on September 15, 2020 . Users of the JarSigner should note that this issue will not be addressed in older versions of the JDK (i.e. JDKs before JDK 15).
-  https://docs.oracle.com/javase/7/docs/technotes/tools/windows/jarsigner.html
-  https://blogs.oracle.com/java-platform-group/signing-code-for-the-long-haul
-  https://java.com/en/download/help/revocation_options.xml
-  https://docs.oracle.com/en/java/javase/12/
-  https://www.csoonline.com/article/2607448/revoke-certificates-when-you-need-to—-the-right-way.html
-  https://openjdk.java.net/projects/jdk/15/
-  https://bugs.openjdk.java.net/browse/JDK-8242060