---
title: "CWE-298: Improper Validation of Certificate Expiration"
url: https://radicalnotion.ai/cwe/cwe-298
type: cwe
description: "A certificate expiration is not validated or is incorrectly validated."
updated: 2026-11-10
source: RadicalNotion.AI
license: CC BY-NC 4.0 (https://creativecommons.org/licenses/by-nc/4.0/)
---

# CWE-298: Improper Validation of Certificate Expiration

- **Abstraction:** Variant
- **Structure:** Simple
- **Status:** Draft
- **Likelihood of exploit:** Low
- **CVEs with this as primary weakness:** 7
- **Of those, in CISA KEV:** 0
- **New in 2026:** 1
- **CWE catalog version:** 4.21

## Description

A certificate expiration is not validated or is incorrectly validated.

## Modes of introduction

| Phase | Note |
| --- | --- |
| Implementation | When the software uses certificate pinning, the developer might not properly validate all relevant components of the certificate before pinning the certificate. This can make it difficult or expensive to test after the pinning is complete. |
| Implementation | REALIZATION: This weakness is caused during implementation of an architectural security tactic. |

## Common consequences

| Scope | Impact | Note |
| --- | --- | --- |
| 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. |

## Potential mitigations

### 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 methods

### Automated Static Analysis

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 searching for potentially-vulnerable patterns that connect "sources" (origins of input) with "sinks" (destinations where the data interacts with external components, a lower layer such as the OS, etc.)

## Demonstrative examples

### Example 1

The following OpenSSL code ensures that there is a certificate and allows the use of expired certificates.

Bad code:

```c
if (cert = SSL_get_peer(certificate(ssl)) {
    foo=SSL_get_verify_result(ssl);
    if ((X509_V_OK==foo) || (X509_V_ERR_CERT_HAS_EXPIRED==foo))

        //do stuff
```

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.

## Observed examples

| CVE | Description |
| --- | --- |
| CVE-2025-4384 | product does not verify that a certificate has expired |
| CVE-2007-3564 | web library product does not verify that a certificate has expired |
| CVE-2007-6746 | IRC product does not check the expiration date of the X.509 certificate |

## Real CVEs with this weakness

| CVE | Title | Severity | CVSS | EPSS | CISA KEV | Published |
| --- | --- | --- | --- | --- | --- | --- |
| CVE-2025-67109 | Improper verification of the time certificate in Eclipse Cyclone DDS before v0.10.5 allows attackers to bypass certificate checks and execute commands with System privileges. | critical | 10.0 | - | No | 2025-12-23 |
| CVE-2025-67108 | - | critical | 10.0 | - | No | 2025-12-23 |
| CVE-2025-61736 | iSTAR- Improper Validation of Certificate Expiration | high | 7.1 | - | No | 2025-12-17 |
| CVE-2023-42446 | Pow Mnesia cache doesn't invalidate all expired keys on startup | medium | 6.5 | - | No | 2023-09-18 |
| CVE-2025-4384 | Certificate validity not properly verified | medium | 6.0 | - | No | 2025-05-06 |
| CVE-2025-59036 | Infrahub allows authentication with deleted and expired API tokens | medium | 5.5 | - | No | 2025-09-09 |
| CVE-2024-1248 | Role Overwriting via Silent JIT Provisioning in Multiple WSO2 Products Enables Privilege Escalation | medium | 5.3 | - | No | 2026-07-04 |

## Related weaknesses

| Relationship | CWE | Name |
| --- | --- | --- |
| Parent | [CWE-295](https://radicalnotion.ai/cwe/cwe-295) | Improper Certificate Validation |
| Parent | [CWE-672](https://radicalnotion.ai/cwe/cwe-672) | Operation on a Resource after Expiration or Release |
| Peer | [CWE-324](https://radicalnotion.ai/cwe/cwe-324) | Use of a Key Past its Expiration Date |
| Peer | [CWE-370](https://radicalnotion.ai/cwe/cwe-370) | Missing Check for Certificate Revocation after Initial Check |

## Taxonomy mappings

| Taxonomy | Entry | Id | Fit |
| --- | --- | --- | --- |
| CLASP | Failure to validate certificate expiration | - | - |

## Frequently asked questions

### What is CWE-298?

A certificate expiration is not validated or is incorrectly validated.

### What CVEs are caused by CWE-298?

7 recorded CVEs are attributed to CWE-298, including CVE-2025-67109, CVE-2025-67108 and CVE-2025-61736.

### How do you prevent CWE-298?

Check for expired certificates and provide the user with adequate information about the nature of the problem and how to proceed.

### How is CWE-298 detected?

Automated Static Analysis: 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 searching for potentially-vulnerable patterns that connect "sources" (origins of input) with "sinks" (destinations where the data interacts with external components, a lower layer such as the OS, etc.)

### What are the consequences of CWE-298?

Exploiting CWE-298 can lead to: Other.

### Is CWE-298 actively exploited?

7 recorded CVEs are caused by CWE-298; none are currently in CISA's KEV catalog of actively exploited flaws.

Primary source: [MITRE CWE](https://cwe.mitre.org/data/definitions/298.html)

---

Source: [RadicalNotion.AI](https://radicalnotion.ai/cwe/cwe-298). Licensed CC BY-NC 4.0; attribute RadicalNotion.AI and link the source page when you reuse this data.
