CWE-666: Operation on Resource in Wrong Phase of Lifetime
5 CVEs have CWE-666 as their primary weakness. 0 of them are in the CISA KEV catalog. The highest EPSS score among them is 0.435%.
The product performs an operation on a resource at the wrong phase of the resource's lifecycle, which can lead to unexpected behaviors.
Child of CWE-664: Improper Control of a Resource Through its Lifetime
Mitigations
- Architecture and Design: Follow the resource's lifecycle from creation to release.
- Implementation: For each phase, it is important to follow the specifications outlined for how to operate on the resource and to ensure that the resource is in the expected phase. Otherwise, if a resource is in one phase but the operation is not valid for that phase (i.e., an incorrect phase of the resource's lifetime), then this can produce resultant weaknesses.
Observed examples
- CVE-2006-5051: Chain: Signal handler contains too much functionality (CWE-828), introducing a race condition (CWE-362) that leads to a double free (CWE-415).
Get more CVE data from the API.
curl 'https://api.contrastcyber.com/cwe_lookup/CWE-666'curl 'https://api.contrastcyber.com/cve_search?cwe_id=CWE-666'
Sources
- Vulnerability data from the National Vulnerability Database (NIST) and the CVE Program. CVE records: Copyright © 1999-2026, The MITRE Corporation, used under the CVE Program Terms of Use. CVE® is a registered trademark of The MITRE Corporation.
- CWE definitions: Copyright © 2006-2026, The MITRE Corporation, used under the CWE Terms of Use. CWE is a trademark of The MITRE Corporation.
- EPSS scores by FIRST.org EPSS, used with attribution.
- KEV catalog and SSVC decisions by CISA.
- Advisory data from the GitHub Advisory Database through OSV.dev (CC BY 4.0).
- Exploit metadata from the Exploit Database (GPL-2.0-only, metadata only).
- Nuclei template names from nuclei-templates (MIT).