The product does not maintain or incorrectly maintains control over a resource throughout its lifetime of creation, use, and release.
View on MITREResources 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."
Use Static analysis tools to check for unreleased resources.
No detection method information available for this CWE.
Cryptography API uses unsafe reflection when deserializing a private key
View DetailsChain: Python library does not limit the resources used to process images that specify a very large number of bands (CWE-1284), leading to excessive memory consumption (CWE-789) or an integer overflow (CWE-190).
View DetailsNo relationship information available for this CWE.
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."
If exploited, CWE-664 (Improper Control of a Resource Through its Lifetime) it can compromise Other, leading to outcomes such as Other.
Recommended mitigations for CWE-664 include: Use Static analysis tools to check for unreleased resources.
CWE-664 commonly affects Not Language-Specific. Note that weaknesses are often language-agnostic patterns, so secure coding practices apply broadly.
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.
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.