Weakness · Medium

CWE-298: Improper Validation of Certificate Expiration

What it is

A certificate expiration is not validated or is incorrectly validated, so trust may be assigned to certificates that have been abandoned due to age.

Likelihood of exploit: LowMITRE CWE 4.19.1

Severity (our rating)
Medium
Likelihood of exploit
Low
Introduced during
Implementation
Exploited in the wild
No CVE in CISA's catalog

In more detail

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.

What an attacker can do

  • Other (Integrity, Other, Authentication)

How to prevent it

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.

CWE-298 on MITRE's CWE site

H2 Security

Found it in your code?

We review where it appears, fix it with your team, and check it was not already used against you.

Talk to our team

T Academy

Stop writing it in the first place

Learn to build software and systems without weaknesses like this one, with practice on real hosts in your browser, every objective checked on the machine.

Start free

Source: MITRE Common Weakness Enumeration, CWE version 4.19.1. CWE is a trademark of The MITRE Corporation.