CWE-765: Multiple Unlocks of a Critical Resource
The product unlocks a critical resource more times than intended, leading to an unexpected state in the system.
Last updated
The product unlocks a critical resource more times than intended, leading to an unexpected state in the system.
Last updated
CWE-765 (Multiple Unlocks of a Critical Resource) is a base-level software weakness catalogued by MITRE in the Common Weakness Enumeration (CWE). It describes a recurring type of mistake that can lead to exploitable security vulnerabilities.
3 recorded CVEs are caused by CWE-765 (Multiple Unlocks of a Critical Resource). The highest-severity and most recent are shown first. 1 new CWE-765 CVE has been recorded so far in 2026.
What can happen when CWE-765 is exploited.
DoS: Crash, Exit, or Restart, Modify Memory, Unexpected State
Affects: Availability, Integrity
When the product is operating in a concurrent environment and repeatedly unlocks a critical resource, the consequences will vary based on the type of lock, the lock's implementation, and the resource being protected. In some situations such as with semaphores, the resources are pooled and extra calls to unlock will increase the count for the number of available resources, likely resulting in a crash or unpredictable behavior when the system nears capacity.
Typically introduced during these phases of the software lifecycle.
Practical mitigations for CWE-765, grouped by where in the lifecycle they apply.
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.
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.)
Effectiveness: High
Real CVEs that MITRE cites as examples of this weakness.
Common questions about CWE-765.
Weakness data is sourced from the MITRE CWE catalog (v4.21). CVE associations are aggregated and kept current by RadicalNotion.AI.
Get an alert when a new CWE-765 CVE affects your products, with AI-written analysis and remediation steps.