---
title: "CWE-672: Operation on a Resource after Expiration or Release"
url: https://radicalnotion.ai/cwe/cwe-672
type: cwe
description: "The product uses, accesses, or otherwise operates on a resource after that resource has been expired, released, or revoked."
updated: 2026-11-10
source: RadicalNotion.AI
license: CC BY-NC 4.0 (https://creativecommons.org/licenses/by-nc/4.0/)
---

# CWE-672: Operation on a Resource after Expiration or Release

- **Abstraction:** Class
- **Structure:** Simple
- **Status:** Draft
- **CVEs with this as primary weakness:** 118
- **Of those, in CISA KEV:** 0
- **New in 2026:** 53
- **CWE catalog version:** 4.21

## Description

The product uses, accesses, or otherwise operates on a resource after that resource has been expired, released, or revoked.

## Modes of introduction

| Phase | Note |
| --- | --- |
| Implementation | - |
| Operation | - |

## Applicable platforms

**Technologies:** Mobile (Undetermined)

## Common consequences

| Scope | Impact | Note |
| --- | --- | --- |
| Integrity, Confidentiality | Modify Application Data, Read Application Data | If a released resource is subsequently reused or reallocated, then an attempt to use the original resource might allow access to sensitive data that is associated with a different user or entity. |
| Other, Availability | Other, DoS: Crash, Exit, or Restart | When a resource is released it might not be in an expected state, later attempts to access the resource may lead to resultant errors that may lead to a crash. |

## 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.)

Effectiveness: High

## Demonstrative examples

### Example 1

The following code shows a simple example of a use after free error:

Bad code:

```c
char* ptr = (char*)malloc (SIZE);
if (err) {
    abrt = 1;
    free(ptr);
}
...
if (abrt) {
    logError("operation aborted before commit", ptr);
}
```

When an error occurs, the pointer is immediately freed. However, this pointer is later incorrectly used in the logError function.

### Example 2

The following code shows a simple example of a double free error:

Bad code:

```c
char* ptr = (char*)malloc (SIZE);
...
if (abrt) {
    free(ptr);
}
...
free(ptr);
```

### Example 3

In the following C/C++ example the method processMessage is used to process a message received in the input array of char arrays. The input message array contains two char arrays: the first is the length of the message and the second is the body of the message. The length of the message is retrieved and used to allocate enough memory for a local char array, messageBody, to be created for the message body. The messageBody is processed in the method processMessageBody that will return an error if an error occurs while processing. If an error occurs then the return result variable is set to indicate an error and the messageBody char array memory is released using the method free and an error message is sent to the logError method.

Bad code:

```c
#define FAIL 0
#define SUCCESS 1
#define ERROR -1
#define MAX_MESSAGE_SIZE 32

int processMessage(char **message)
{
    int result = SUCCESS;

    int length = getMessageLength(message[0]);
    char *messageBody;

    if ((length > 0) && (length < MAX_MESSAGE_SIZE)) {
        messageBody = (char*)malloc(length*sizeof(char));
        messageBody = &message[1][0];

        int success = processMessageBody(messageBody);

        if (success == ERROR) {
            result = ERROR;
            free(messageBody);
        }
    }
    else {
        printf("Unable to process message; invalid message length");
        result = FAIL;
    }

    if (result == ERROR) {
        logError("Error processing message", messageBody);
    }

    return result;
}
```

Good code:

```c
...
messageBody = (char*)malloc(length*sizeof(char));
messageBody = &message[1][0];

int success = processMessageBody(messageBody);

if (success == ERROR) {
    result = ERROR;
    logError("Error processing message", messageBody);
    free(messageBody);
}
...
```

However, the call to the method logError includes the messageBody after the memory for messageBody has been released using the free method. This can cause unexpected results and may lead to system crashes. A variable should never be used after its memory resources have been released.

## Observed examples

| CVE | Description |
| --- | --- |
| CVE-2009-3547 | Chain: race condition (CWE-362) might allow resource to be released before operating on it, leading to NULL dereference (CWE-476) |

## Real CVEs with this weakness (sample of 12 of 118)

| CVE | Title | Severity | CVSS | EPSS | CISA KEV | Published |
| --- | --- | --- | --- | --- | --- | --- |
| CVE-2026-74398 | ipv6: addrconf: bail out of dad\_failure when state is no longer POSTDAD | critical | 9.8 | - | No | 2026-08-15 |
| CVE-2025-38264 | nvme-tcp: sanitize request list handling | critical | 9.8 | - | No | 2025-07-09 |
| CVE-2024-47571 | - | critical | 9.8 | - | No | 2025-01-14 |
| CVE-2020-24030 | - | critical | 9.8 | - | No | 2020-09-02 |
| CVE-2020-12043 | Operation on a Resource after Expiration or Release in Baxter Sigma Spectrum Infusion Pumps | critical | 9.8 | - | No | 2020-06-29 |
| CVE-2019-17638 | Operation on a Resource after Expiration or Release in Jetty Server | critical | 9.4 | - | No | 2020-07-09 |
| CVE-2026-43585 | OpenClaw \< 2026.4.15 - Bearer Token Validation Bypass via Stale SecretRef Resolution | critical | 9.2 | - | No | 2026-05-06 |
| CVE-2026-123282 | - | critical | 9.1 | - | No | 2026-11-06 |
| CVE-2013-10075 | Apache::Session versions through 1.94 for Perl re-creates deleted sessions | critical | 9.1 | - | No | 2026-05-08 |
| CVE-2026-116326 | PostgreSQL plperl tied-object exceptions follow stale sigjmp\_buf | high | 8.8 | - | No | 2026-11-12 |
| CVE-2026-113121 | Use of released resource in ContextMenu | high | 8.8 | - | No | 2026-10-20 |
| CVE-2026-113216 | Use of released resource in Navigation | high | 8.8 | - | No | 2026-10-20 |

## Related weaknesses

| Relationship | CWE | Name |
| --- | --- | --- |
| Parent | [CWE-666](https://radicalnotion.ai/cwe/cwe-666) | Operation on Resource in Wrong Phase of Lifetime |
| Child | [CWE-298](https://radicalnotion.ai/cwe/cwe-298) | Improper Validation of Certificate Expiration |
| Child | [CWE-324](https://radicalnotion.ai/cwe/cwe-324) | Use of a Key Past its Expiration Date |
| Child | [CWE-415](https://radicalnotion.ai/cwe/cwe-415) | Double Free |
| Child | [CWE-416](https://radicalnotion.ai/cwe/cwe-416) | Use After Free |
| Child | [CWE-613](https://radicalnotion.ai/cwe/cwe-613) | DEPRECATED: Insufficient Session Expiration |
| Child | [CWE-825](https://radicalnotion.ai/cwe/cwe-825) | Expired Pointer Dereference |
| Child | [CWE-910](https://radicalnotion.ai/cwe/cwe-910) | Use of Expired File Descriptor |
| Related | [CWE-562](https://radicalnotion.ai/cwe/cwe-562) | Return of Stack Variable Address |
| Related | [CWE-826](https://radicalnotion.ai/cwe/cwe-826) | Premature Release of Resource During Expected Lifetime |
| Related | [CWE-911](https://radicalnotion.ai/cwe/cwe-911) | Improper Update of Reference Count |
| Related | [CWE-1341](https://radicalnotion.ai/cwe/cwe-1341) | Multiple Releases of Same Resource or Handle |
| Related | [CWE-1469](https://radicalnotion.ai/cwe/cwe-1469) | Improper Check for Credential Expiration |

## Taxonomy mappings

| Taxonomy | Entry | Id | Fit |
| --- | --- | --- | --- |
| Software Fault Patterns | Faulty Resource Use | SFP15 | - |
| CERT C Secure Coding | Do not access a closed file | FIO46-C | CWE More Abstract |
| CERT C Secure Coding | Do not access freed memory | MEM30-C | CWE More Abstract |
| OMG ASCSM | - | ASCSM-CWE-672 | - |

## Frequently asked questions

### What is CWE-672?

The product uses, accesses, or otherwise operates on a resource after that resource has been expired, released, or revoked.

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

118 recorded CVEs are attributed to CWE-672, including CVE-2026-74398, CVE-2025-38264 and CVE-2024-47571.

### How is CWE-672 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-672?

Exploiting CWE-672 can lead to: Modify Application Data, Read Application Data, Other, DoS: Crash, Exit, or Restart.

### Is CWE-672 actively exploited?

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

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

---

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