CWE-298: Improper Validation of Certificate Expiration
Improper Validation of Certificate Expiration
Weakness ID: 298 (Weakness Base)
Status: Draft
Description
Description Summary
A certificate expiration is not validated or is incorrectly
validated, so trust may be assigned to certificates that have been abandoned due
to age.
Extended Description
When the expiration of a certificate is not taken into account no trust
has necessarily been conveyed through it. Therefore, the validity of the
certificate cannot be verified and all benefit of the certificate is
lost.
Time of Introduction
Architecture and Design
Applicable Platforms
Languages
All
Common Consequences
Scope
Effect
Integrity
The data read from the system vouched for by the expired certificate
may be flawed due to malicious spoofing.
Authentication
Trust afforded to the system in question -- based on the expired
certificate -- may allow for spoofing attacks.
Likelihood of Exploit
Low
Demonstrative Examples
Example 1
(Bad Code)
C and C++
if (!(cert = SSL_get_peer(certificate(ssl)) || !host)
foo=SSL_get_verify_result(ssl);
if ((X509_V_OK==foo) || (X509_V_ERRCERT_NOT_YET_VALID==foo)) //do
stuff
Potential Mitigations
Phase
Description
Architecture and Design
Check for expired certificates and provide the user with adequate
information about the nature of the problem and how to proceed.