Base · Medium

CWE-299: Improper Check for Certificate Revocation

The product does not check or incorrectly checks the revocation status of a certificate, which may cause it to use a certificate that has been compromised.

CWE-299 · Base Level ·12 CVEs ·2 Mitigations

Description

The product does not check or incorrectly checks the revocation status of a certificate, which may cause it to use a certificate that has been compromised.

An improper check for certificate revocation is a far more serious flaw than related certificate failures. This is because the use of any revoked certificate is almost certainly malicious. The most common reason for certificate revocation is compromise of the system in question, with the result that no legitimate servers will be using a revoked certificate, unless they are sorely out of sync.

Potential Impact

Access Control

Gain Privileges or Assume Identity

Integrity, Other

Other

Confidentiality

Read Application Data

Demonstrative Examples

The following OpenSSL code ensures that there is a certificate before continuing execution.
Bad
if (cert = SSL_get_peer_certificate(ssl)) {
                        
                           
                           // got a certificate, do secret things
Because this code does not use SSL_get_verify_results() to check the certificate, it could accept certificates that have been revoked (X509_V_ERR_CERT_REVOKED). The product could be communicating with a malicious host.

Mitigations & Prevention

Architecture and Design

Ensure that certificates are checked for revoked status.

Implementation

If certificate pinning is being used, ensure that all relevant properties of the certificate are fully validated before the certificate is pinned, including the revoked status.

Detection Methods

  • Automated Static Analysis High — Automated static analysis, commonly referred to as Static Application Security Testing (SAST), can find some instances of this weakness by analyzing source code (or binary/compiled code) without having to execute it. Typically, this is done by building a model of data flow and control flow, then sea

Real-World CVE Examples

CVE IDDescription
CVE-2011-2014LDAP-over-SSL implementation does not check Certificate Revocation List (CRL), allowing spoofing using a revoked certificate.
CVE-2011-0199Operating system does not check Certificate Revocation List (CRL) in some cases, allowing spoofing using a revoked certificate.
CVE-2010-5185Antivirus product does not check whether certificates from signed executables have been revoked.
CVE-2009-3046Web browser does not check if any intermediate certificates are revoked.
CVE-2009-0161chain: Ruby module for OCSP misinterprets a response, preventing detection of a revoked certificate.
CVE-2011-2701chain: incorrect parsing of replies from OCSP responders allows bypass using a revoked certificate.
CVE-2011-0935Router can permanently cache certain public keys, which would allow bypass if the certificate is later revoked.
CVE-2009-1358chain: OS package manager does not properly check the return value, allowing bypass using a revoked certificate.
CVE-2009-0642chain: language interpreter does not properly check the return value from an OSCP function, allowing bypass using a revoked certificate.
CVE-2008-4679chain: web service component does not call the expected method, which prevents a check for revoked certificates.
CVE-2006-4410Certificate revocation list not searched for certain certificates.
CVE-2006-4409Product cannot access certificate revocation list when an HTTP proxy is being used.

Taxonomy Mappings

  • CLASP: — Failure to check for certificate revocation

Frequently Asked Questions

What is CWE-299?

CWE-299 (Improper Check for Certificate Revocation) is a software weakness identified by MITRE's Common Weakness Enumeration. It is classified as a Base-level weakness. The product does not check or incorrectly checks the revocation status of a certificate, which may cause it to use a certificate that has been compromised.

How can CWE-299 be exploited?

Attackers can exploit CWE-299 (Improper Check for Certificate Revocation) to gain privileges or assume identity. This weakness is typically introduced during the Implementation, Implementation phase of software development.

How do I prevent CWE-299?

Key mitigations include: Ensure that certificates are checked for revoked status.

What is the severity of CWE-299?

CWE-299 is classified as a Base-level weakness (Medium abstraction). It has been observed in 12 real-world CVEs.