CWE-664: Improper Control of a Resource Through its Lifetime

PillarDraft

The product does not maintain or incorrectly maintains control over a resource throughout its lifetime of creation, use, and release.

View on MITRE
Back to CWE Lookup

Extended Description

Resources often have explicit instructions on how to be created, used and destroyed. When code does not follow these instructions, it can lead to unexpected behaviors and potentially exploitable states. Even without explicit instructions, various principles are expected to be adhered to, such as "Do not use an object until after its creation is complete," or "do not use an object after it has been slated for destruction."

Technical Details

Structure
Simple

Applicable To

Languages
Not Language-Specific
Platforms

Frequently Asked Questions

What is CWE-664: Improper Control of a Resource Through its Lifetime?+

CWE-664: Improper Control of a Resource Through its Lifetime is a Common Weakness Enumeration (CWE) entry maintained by MITRE. The product does not maintain or incorrectly maintains control over a resource throughout its lifetime of creation, use, and release. Resources often have explicit instructions on how to be created, used and destroyed. When code does not follow these instructions, it can lead to unexpected behaviors and potentially exploitable states. Even without explicit instructions, various principles are expected to be adhered to, such as "Do not use an object until after its creation is complete," or "do not use an object after it has been slated for destruction."

What are the security consequences of Improper Control of a Resource Through its Lifetime?+

If exploited, CWE-664 (Improper Control of a Resource Through its Lifetime) it can compromise Other, leading to outcomes such as Other.

How do you prevent or mitigate Improper Control of a Resource Through its Lifetime?+

Recommended mitigations for CWE-664 include: Use Static analysis tools to check for unreleased resources.

Which programming languages are affected by Improper Control of a Resource Through its Lifetime?+

CWE-664 commonly affects Not Language-Specific. Note that weaknesses are often language-agnostic patterns, so secure coding practices apply broadly.

What are real-world examples of Improper Control of a Resource Through its Lifetime?+

MITRE documents real CVEs mapped to CWE-664, including CVE-2018-1000613 and CVE-2019-19911. You can look up the full details of each CVE, including CVSS scores and remediation guidance, on our CVE Lookup tool.

What is the difference between a CWE and a CVE?+

A CWE (Common Weakness Enumeration) like CWE-664 describes a category of software weakness — the underlying flaw type. A CVE (Common Vulnerabilities and Exposures) identifies a specific, real-world vulnerability in a particular product. In short, a CWE is the kind of mistake, and a CVE is an instance of that mistake being found in software.

Learn More