Missing Validation of OpenSSL Certificate

The product uses OpenSSL and trusts or uses a certificate without using the SSL_get_verify_result() function to ensure that the certificate satisfies all necessary security requirements.


Description

This could allow an attacker to use an invalid certificate to claim to be a trusted host, use expired certificates, or conduct other attacks that could be detected if the certificate is properly validated.

Demonstrations

The following examples help to illustrate the nature of this weakness and describe methods or techniques which can be used to mitigate the risk.

Note that the examples here are by no means exhaustive and any given weakness may have many subtle varieties, each of which may require different detection methods or runtime controls.

Example One

The following OpenSSL code ensures that the host has a certificate.

if (cert = SSL_get_peer_certificate(ssl)) {


  // got certificate, host can be trusted

  //foo=SSL_get_verify_result(ssl);

  //if (X509_V_OK==foo) ...


}

Note that the code does not call SSL_get_verify_result(ssl), which effectively disables the validation step that checks the certificate.

See Also

Comprehensive Categorization: Access Control

Weaknesses in this category are related to access control.

Identify Actors

Weaknesses in this category are related to the design and architecture of a system's identification management components. Frequently these deal with verifying that ex...

SFP Secondary Cluster: Digital Certificate

This category identifies Software Fault Patterns (SFPs) within the Digital Certificate cluster.

Comprehensive CWE Dictionary

This view (slice) covers all the elements in CWE.

Weaknesses Introduced During Implementation

This view (slice) lists weaknesses that can be introduced during implementation.


Common Weakness Enumeration content on this website is copyright of The MITRE Corporation unless otherwise specified. Use of the Common Weakness Enumeration and the associated references on this website are subject to the Terms of Use as specified by The MITRE Corporation.