CWE-826

Premature Release of Resource During Expected Lifetime
AI Translation Available

The product releases a resource that is still intended to be used by itself or another actor.

Status
incomplete
Abstraction
base

This weakness focuses on errors in which the product should not release a resource, but performs the release anyway. This is different than a weakness in which the product releases a resource at the appropriate time, but it maintains a reference to the resource, which it later accesses. For this weakness, the resource should still be valid upon the subsequent access.

When a product releases a resource that is still being used, it is possible that operations will still be taken on this resource, which may have been repurposed in the meantime, leading to issues similar to CWE-825. Consequences may include denial of service, information exposure, or code execution.

Common Consequences

confidentiality availability integrity
Impacts
read application data read memory dos: crash, exit, or restart execute unauthorized code or commands modify application data modify memory

Detection Methods

automated static analysis

Potential Mitigations