CWEweakness
CWE-412 Unrestricted Externally Accessible Lock
- Abstraction
- Base
- Structure
- Simple
- Status
- Incomplete
- Languages
- Not Language-Specific
- CWE version
- 5.0
Description
The product properly checks for the existence of a lock, but the lock can be externally controlled or influenced by an actor that is outside of the intended sphere of control.
Extended description
This prevents the product from acting on associated resources or performing other behaviors that are controlled by the presence of the lock. Relevant locks might include an exclusive lock or mutex, or modifying a shared resource that is treated as a lock. If the lock can be held for an indefinite period of time, then the denial of service could be permanent.
Common consequences
• Availability: DoS: Resource Consumption (Other) — When an attacker can control a lock, the program may wait indefinitely until the attacker releases the lock, causing a denial of service to other users of the program. This is especially problematic if there is a blocking operation on the lock.
Potential mitigations
• [Architecture and Design, Implementation] Use any access control that is offered by the functionality that is offering the lock.
• [Architecture and Design, Implementation] Use unpredictable names or identifiers for the locks. This might not always be possible or feasible.
• [Architecture and Design] Consider modifying your code to use non-blocking synchronization methods.
Detection methods
• White Box: Automated code analysis techniques might not be able to reliably detect this weakness, since the application's behavior and general security model dictate which resource locks are critical. Interpretation of the weakness might require knowledge of the environment, e.g. if the existence of a file is used as a lock, but the file is created in a world-writable directory.
Observed examples
• 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 (1)
- CAPEC-25 Forced Deadlock attack pattern
Observed example · CVE (7)
- 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
Can also be · CWE (1)
- CWE-410 Insufficient Resource Pool weakness
Child of · CWE (1)
- CWE-667 Improper Locking weakness
Referenced by CAPEC · weakness (1)
- CAPEC-25 Forced Deadlock attack pattern
Referenced by CVE · weakness (7)
- CVE-2026-82312 OpenVPN 2.0.0 through 2.6.22 and 2.7_alpha1 through 2.7.6 on Windows allows local authenticated users to cause a denial of service via a… 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-25612 The internal locking mechanism of the MongoDB server uses an internal encoding of the resources in order to choose what lock to take. vulnerability
- CVE-2023-38505 DietPi-Dashboard is a web dashboard for the operating system DietPi. vulnerability
- CVE-2023-22318 Denial of service in Webconf in Tribe29 Checkmk Appliance before 1.6.5. vulnerability
- CVE-2019-11485 Sander Bos discovered Apport's lock file was in a world-writable directory which allowed all users to prevent crash handling. vulnerability
- CVE-2019-18269 Omron’s CS and CJ series PLCs have an unrestricted externally accessible lock vulnerability. vulnerability