- What is CWE-765?
- The product unlocks a critical resource more times than intended, leading to an unexpected state in the system.
- What CVEs are caused by CWE-765?
- 1 recorded CVEs are attributed to CWE-765, including CVE-2024-49602.
- How do you prevent CWE-765?
- When locking and unlocking a resource, try to be sure that all control paths through the code in which the resource is locked one or more times correspond to exactly as many unlocks. If the product acquires a lock and then determines it is not able to perform its intended behavior, be sure to release the lock(s) before waiting for conditions to improve. Reacquire the lock(s) before trying again.
- How is CWE-765 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-765?
- Exploiting CWE-765 can lead to: DoS: Crash, Exit, or Restart, Modify Memory, Unexpected State.
- Is CWE-765 actively exploited?
- 1 recorded CVEs are caused by CWE-765; none are currently in CISA's KEV catalog of actively exploited flaws.