CWEweakness
CWE-667 Improper Locking
- Abstraction
- Class
- Structure
- Simple
- Status
- Draft
- Languages
- Not Language-Specific
- CWE version
- 5.0
Description
The product does not properly acquire or release a lock on a resource, leading to unexpected resource state changes and behaviors.
Common consequences
• Availability: DoS: Resource Consumption (CPU) — Inconsistent locking discipline can lead to deadlock.
• Integrity: Modify Memory, Modify Application Data — This can lead to data or memory corruption.
• Other: Varies by Context, Unexpected State — This can lead to unexpected resource state changes and behaviors.
Potential mitigations
• [Implementation] Use industry standard APIs to implement locking mechanism.
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.)
Observed examples
• CVE-2021-1782: Chain: improper locking (CWE-667) leads to race condition (CWE-362), as exploited in the wild per CISA KEV.
• CVE-2009-0935: Attacker provides invalid address to a memory-reading function, causing a mutex to be unlocked twice
• CVE-2010-4210: function in OS kernel unlocks a mutex that was not previously locked, causing a panic or overwrite of arbitrary memory.
• CVE-2008-4302: Chain: OS kernel does not properly handle a failure of a function call (CWE-755), leading to an unlock of a resource that was not locked (CWE-832), with resultant crash.
• CVE-2009-1243: OS kernel performs an unlock in some incorrect circumstances, leading to panic.
• CVE-2009-2857: OS deadlock
• CVE-2009-1961: OS deadlock involving 3 separate functions
• CVE-2009-2699: deadlock in library
• CVE-2009-4272: deadlock triggered by packets that force collisions in a routing table
• CVE-2002-1850: read/write deadlock between web server and script
• CVE-2004-0174: web server deadlock involving multiple listening connections
• CVE-2009-1388: multiple simultaneous calls to the same function trigger deadlock.
• CVE-2006-5158: Chain: other weakness leads to NULL pointer dereference (CWE-476) or deadlock (CWE-833).
• CVE-2006-4342: deadlock when an operation is performed on a resource while it is being removed.
• CVE-2006-2374: Deadlock in device driver triggered by using file handle of a related device.
• CVE-2006-2275: Deadlock when large number of small messages cannot be processed quickly enough.
• CVE-2005-3847: OS kernel has deadlock triggered by a signal during a core dump.
• CVE-2005-3106: Race condition leads to deadlock.
• CVE-2005-2456: Chain: array index error (CWE-129) leads to deadlock (CWE-833)
• CVE-2001-0682: Program can not execute when attacker obtains a mutex.
• CVE-2002-1914: Program can not execute when attacker obtains a lock on a critical output file.
• CVE-2002-1915: Program can not execute when attacker obtains a lock on a critical output file.
• CVE-2002-0051: Critical file can be opened with exclusive read access by user, preventing application of security policy. Possibly related to improper permissions, large-window race condition.
• CVE-2000-0338: Chain: predictable file names used for locking, allowing attacker to create the lock beforehand. Resultant from permissions and randomness.
• CVE-2000-1198: Chain: Lock files with predictable names. Resultant from randomness.
• CVE-2002-1869: Product does not check if it can write to a log file, allowing attackers to avoid logging by accessing the file using an exclusive lock. Overlaps unchecked error condition. This is not quite CWE-412, but close.
Related
Attack pattern · CAPEC (3)
Observed example · CVE (26)
- CVE-2021-1782 A race condition was addressed with improved locking. vulnerability
- CVE-2010-4210 The pfs_getextattr function in FreeBSD 7.x before 7.3-RELEASE and 8.x before 8.0-RC1 unlocks a mutex that was not previously locked, which… vulnerability
- CVE-2009-4272 A certain Red Hat patch for net/ipv4/route.c in the Linux kernel 2.6.18 on Red Hat Enterprise Linux (RHEL) 5 allows remote attackers to… vulnerability
- CVE-2009-2699 The Solaris pollset feature in the Event Port backend in poll/unix/port.c in the Apache Portable Runtime (APR) library before 1.3.9, as… vulnerability
- CVE-2009-2857 The kernel in Sun Solaris 8, 9, and 10, and OpenSolaris before snv_103, does not properly handle interaction between the filesystem and… vulnerability
- CVE-2009-1388 The ptrace_start function in kernel/ptrace.c in the Linux kernel 2.6.18 does not properly handle simultaneous execution of the do_coredump… vulnerability
- CVE-2009-1961 The inode double locking code in fs/ocfs2/file.c in the Linux kernel 2.6.30 before 2.6.30-rc3, 2.6.27 before 2.6.27.24, 2.6.29 before… vulnerability
- CVE-2009-1243 net/ipv4/udp.c in the Linux kernel before 2.6.29.1 performs an unlocking step in certain incorrect circumstances, which allows local users… vulnerability
- CVE-2009-0935 The inotify_read function in the Linux kernel 2.6.27 to 2.6.27.13, 2.6.28 to 2.6.28.2, and 2.6.29-rc3 allows local users to cause a denial… vulnerability
- CVE-2008-4302 fs/splice.c in the splice subsystem in the Linux kernel before 2.6.22.2 does not properly handle a failure of the add_to_page_cache_lru… vulnerability
- CVE-2006-4342 The kernel in Red Hat Enterprise Linux 3, when running on SMP systems, allows local users to cause a denial of service (deadlock) by… vulnerability
- CVE-2006-5158 The nlmclnt_mark_reclaim in clntlock.c in NFS lockd in Linux kernel before 2.6.16 allows remote attackers to cause a denial of service… vulnerability
- CVE-2006-2374 The Server Message Block (SMB) driver (MRXSMB.SYS) in Microsoft Windows 2000 SP4, XP SP1 and SP2, and Server 2003 SP1 and earlier allows… vulnerability
- CVE-2006-2275 Linux SCTP (lksctp) before 2.6.17 allows remote attackers to cause a denial of service (deadlock) via a large number of small messages to a… vulnerability
- CVE-2005-3847 The handle_stop_signal function in signal.c in Linux kernel 2.6.11 up to other versions before 2.6.13 and 2.6.12.6 allows local users to… vulnerability
- CVE-2005-3106 Race condition in Linux 2.6, when threads are sharing memory mapping via CLONE_VM (such as linuxthreads and vfork), might allow local users… vulnerability
- CVE-2005-2456 Array index overflow in the xfrm_sk_policy_insert function in xfrm_user.c in Linux kernel 2.6 allows local users to cause a denial of… vulnerability
- CVE-2004-0174 Apache 1.4.x before 1.3.30, and 2.0.x before 2.0.49, when using multiple listening sockets on certain platforms, allows remote attackers to… vulnerability
- CVE-2002-1850 mod_cgi in Apache 2.0.39 and 2.0.40 allows local users and possibly remote attackers to cause a denial of service (hang and memory… vulnerability
- CVE-2002-1869 Heysoft EventSave 5.1 and 5.2 and Heysoft EventSave+ 5.1 and 5.2 does not check whether the log file can be written to, which allows… vulnerability
- CVE-2002-1914 dump 0.4 b10 through b29 allows local users to cause a denial of service (execution prevention) by using flock() to lock the /etc/dumpdates… vulnerability
- CVE-2002-1915 tip on multiple BSD-based operating systems allows local users to cause a denial of service (execution prevention) by using flock() to lock… vulnerability
- CVE-2002-0051 Windows 2000 allows local users to prevent the application of new group policy settings by opening Group Policy files with exclusive-read… vulnerability
- CVE-2000-1198 qpopper POP server creates lock files with predictable names, which allows local users to cause a denial of service for other users (lack… vulnerability
- CVE-2001-0682 ZoneAlarm and ZoneAlarm Pro allows a local attacker to cause a denial of service by running a trojan to initialize a ZoneAlarm mutex object… vulnerability
- CVE-2000-0338 Concurrent Versions Software (CVS) uses predictable temporary file names for locking, which allows local users to cause a denial of service… vulnerability
Child of · CWE (1)
- CWE-662 Improper Synchronization weakness
Referenced by CAPEC · weakness (3)
Referenced by CVE · weakness (768)
- CVE-2026-106174 A improper locking vulnerability in Fortinet FortiOS 8.0.0, FortiOS 7.6.4 through 7.6.6 may allow an unauthenticated attacker with network… vulnerability
- CVE-2026-110803 VaadinService.requestEnd() in Vaadin Framework 8 locks the session and then reads the v-uiId request parameter outside the block that… vulnerability
- CVE-2026-111879 DBI versions before 1.656 for Perl hang on a later open of a DBD::DBM table because a failed open_data does not release the table's lock. vulnerability
- CVE-2026-107674 IBM i 7.3, 7.4, 7.5, and 7.6 is vulnerable to a denial of service to Digital Certificate Manager (DCM) for System TLS using applications… vulnerability
- CVE-2026-103670 When a Gitea Actions run was inserted, older runs in the same workflow-level concurrency group were cancelled without checking whether the… vulnerability
- CVE-2026-105113 Nezha Dashboard from 1.8.0 before 2.3.13 contains an improper locking vulnerability where a non-deferred mutex unlock leaks on a nil-map… vulnerability
- CVE-2026-47581 NVIDIA GPU Display Driver for Windows contains a vulnerability in the kernel module where a user could cause improper locking. vulnerability
- CVE-2026-98094 In the Linux kernel, the following vulnerability has been resolved: staging: fbtft: make dirty_lock IRQ-safe fbtft_mkdirty() can be reached… vulnerability
- CVE-2026-98123 In the Linux kernel, the following vulnerability has been resolved: sctp: fix soft lockup from unpadded ASCONF-ACK parameter iteration… vulnerability
- CVE-2026-96273 Ghidra before 12.1.4 fails to validate the TYPE_COL byte in OptionsDB.createUnregisteredOption(), causing an ArrayIndexOutOfBoundsException… vulnerability
- CVE-2026-56914 In multiple locations, there is a possible use-after-free due to improper locking. vulnerability
- CVE-2026-80126 Dell SCG 5.0 Appliance versions prior to 5.36.00.16 and Dell SCG 5.0 Application versions prior to 5.36.00.00, contains an Improper Locking… vulnerability
- CVE-2026-45404 OpenTelemetry-Go is the Go implementation of OpenTelemetry. vulnerability
- CVE-2026-72012 In the Linux kernel, the following vulnerability has been resolved: tracing/osnoise: Call synchronize_rcu() when unregistering This ensures… vulnerability
- CVE-2026-72100 In the Linux kernel, the following vulnerability has been resolved: dm-integrity: fix a bug if the bio is out of limits If… vulnerability
- CVE-2026-68085 In the Linux kernel, the following vulnerability has been resolved: Bluetooth: hci_uart: clear HCI_UART_SENDING when write_work is canceled… vulnerability
- CVE-2026-62426 [This CNA information record relates to multiple CVEs; the text explains which aspects/vulnerabilities correspond to which CVE.] To manage… vulnerability
- CVE-2026-64534 In the Linux kernel, the following vulnerability has been resolved: nvmet-tcp: check INIT_FAILED before nvmet_req_uninit in digest error… vulnerability
- CVE-2026-64334 In the Linux kernel, the following vulnerability has been resolved: USB: serial: digi_acceleport: fix hard lockup on disconnect If… vulnerability
- CVE-2026-64347 In the Linux kernel, the following vulnerability has been resolved: usb: gadget: composite: fix dead empty check in the USB_DT_OTG handler… vulnerability
- CVE-2026-64374 In the Linux kernel, the following vulnerability has been resolved: sched/rt: Have RT_PUSH_IPI be default off for non PREEMPT_RT RT… vulnerability
- CVE-2026-64415 In the Linux kernel, the following vulnerability has been resolved: mm/swap: add cond_resched() in swap_reclaim_full_clusters to prevent… vulnerability
- CVE-2026-64429 In the Linux kernel, the following vulnerability has been resolved: gpio: eic-sprd: use raw_spinlock_t in the irq startup path… vulnerability
- CVE-2026-64232 In the Linux kernel, the following vulnerability has been resolved: block: recompute nr_integrity_segments in blk_insert_cloned_request… vulnerability
- CVE-2026-64238 In the Linux kernel, the following vulnerability has been resolved: gpio: shared: fix deadlock on shared proxy's parent removal Commit… vulnerability
- CVE-2026-63832 In the Linux kernel, the following vulnerability has been resolved: wifi: mt76: add wcid publish check in mt76_sta_add Since… vulnerability
- CVE-2026-63863 In the Linux kernel, the following vulnerability has been resolved: drm/gpusvm: Fix unbalanced unlock in drm_gpusvm_scan_mm() There is a… vulnerability
- CVE-2026-63975 In the Linux kernel, the following vulnerability has been resolved: Bluetooth: L2CAP: Fix possible crash on l2cap_ecred_conn_rsp If dcid is… vulnerability
- CVE-2026-63988 In the Linux kernel, the following vulnerability has been resolved: bridge: Fix sleep in atomic context in sysfs path Since the start of… vulnerability
- CVE-2026-63989 In the Linux kernel, the following vulnerability has been resolved: bridge: Fix sleep in atomic context in netlink path Since the… vulnerability
Referenced by CWE · child of (11)
- CWE-1232 Improper Lock Behavior After Power State Transition weakness
- CWE-1233 Security-Sensitive Hardware Controls with Missing Lock Bit Protection weakness
- CWE-1234 Hardware Internal or Debug Modes Allow Override of Locks weakness
- CWE-412 Unrestricted Externally Accessible Lock weakness
- CWE-413 Improper Resource Locking weakness
- CWE-414 Missing Lock Check weakness
- CWE-609 Double-Checked Locking weakness
- CWE-764 Multiple Locks of a Critical Resource weakness
- CWE-765 Multiple Unlocks of a Critical Resource weakness
- CWE-832 Unlock of a Resource that is not Locked weakness
- CWE-833 Deadlock weakness
Referenced by CWE · has member (1)
- CWE-884 CWE Cross-section view