CWE Reference
CWE-298: Improper Validation of Certificate Expiration
Official CWE-298 CWE context with Glexia analysis, remediation guidance, related CVEs, and ATT&CK context.
Release 4.20weaknessDraft
Glexia's Take
CWE-298: Improper Validation of Certificate Expiration
Improper Validation of Certificate Expiration represents a recurring weakness pattern that can create exploitable paths when design, validation, or implementation controls are missing.
Executive Impact
- Integrity,Other: Other: The data read from the system vouched for by the expired certificate may be flawed due to malicious spoofing.
- Authentication,Other: Other: Trust may be assigned to certificates that have been abandoned due to age.
Developer Pattern
CWE-298 is the kind of defect developers can usually prevent with explicit validation, safer framework defaults, and tests that exercise hostile input or unsafe state transitions.
Confidence
high confidence from CWE-298, 4.20.
Official CWE Definition
CWE-298: Improper Validation of Certificate Expiration
A certificate expiration is not validated or is incorrectly validated.
Developer And Remediation Guidance
How teams prevent and detect this weakness
Causes
- The following OpenSSL code ensures that there is a certificate and allows the use of expired certificates. If the call to SSL_get_verify_result() returns X509_V_ERR_CERT_HAS_EXPIRED, this means that the certificate has expired. As time goes on, there is an increasing chance for attackers to compromise the certificate.
Remediation
- Architecture and Design: Check for expired certificates and provide the user with adequate information about the nature of the problem and how to proceed.
- 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 expiration.
Detection
- Code review
- SAST
- DAST
- Focused regression tests
Mappings
Related CVEs, CWEs, and ATT&CK context
Related CWEs
ATT&CK Relevance
ATT&CK relevance is shown only when reviewed or responsibly inferred.