---
title: "CWE-765: Multiple Unlocks of a Critical Resource"
url: https://radicalnotion.ai/cwe/cwe-765
type: cwe
description: "The product unlocks a critical resource more times than intended, leading to an unexpected state in the system."
updated: 2026-11-10
source: RadicalNotion.AI
license: CC BY-NC 4.0 (https://creativecommons.org/licenses/by-nc/4.0/)
---

# CWE-765: Multiple Unlocks of a Critical Resource

- **Abstraction:** Base
- **Structure:** Simple
- **Status:** Incomplete
- **CVEs with this as primary weakness:** 3
- **Of those, in CISA KEV:** 0
- **New in 2026:** 1
- **CWE catalog version:** 4.21

## Description

The product unlocks a critical resource more times than intended, leading to an unexpected state in the system.

## Modes of introduction

| Phase | Note |
| --- | --- |
| Implementation | - |

## Common consequences

| Scope | Impact | Note |
| --- | --- | --- |
| Availability, Integrity | DoS: Crash, Exit, or Restart, Modify Memory, Unexpected State | 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. |

## Potential mitigations

### Implementation

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.

## Detection methods

### 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.)

Effectiveness: High

## Observed examples

| CVE | Description |
| --- | --- |
| CVE-2009-0935 | Attacker provides invalid address to a memory-reading function, causing a mutex to be unlocked twice |

## Real CVEs with this weakness

| CVE | Title | Severity | CVSS | EPSS | CISA KEV | Published |
| --- | --- | --- | --- | --- | --- | --- |
| CVE-2024-47658 | crypto: stm32/cryp - call finalize with bh disabled | high | 7.5 | - | No | 2024-10-09 |
| CVE-2024-49602 | - | medium | 6.5 | - | No | 2024-12-09 |
| CVE-2026-68150 | fs/super: fix emergency thaw double-unlock of s\_umount | medium | 5.5 | - | No | 2026-08-10 |

## Related weaknesses

| Relationship | CWE | Name |
| --- | --- | --- |
| Parent | [CWE-667](https://radicalnotion.ai/cwe/cwe-667) | Improper Locking |
| Parent | [CWE-675](https://radicalnotion.ai/cwe/cwe-675) | Multiple Operations on Resource in Single-Operation Context |

## Taxonomy mappings

| Taxonomy | Entry | Id | Fit |
| --- | --- | --- | --- |
| Software Fault Patterns | Multiple locks/unlocks | SFP21 | - |

## Frequently asked questions

### 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?

3 recorded CVEs are attributed to CWE-765, including CVE-2024-47658, CVE-2024-49602 and CVE-2026-68150.

### 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?

3 recorded CVEs are caused by CWE-765; none are currently in CISA's KEV catalog of actively exploited flaws.

Primary source: [MITRE CWE](https://cwe.mitre.org/data/definitions/765.html)

---

Source: [RadicalNotion.AI](https://radicalnotion.ai/cwe/cwe-765). Licensed CC BY-NC 4.0; attribute RadicalNotion.AI and link the source page when you reuse this data.
