CWE-662 · Słabość
Improper Synchronization
- Abstrakcja
- Klasa
- Status
- Szkic
- Dodano
- 11 kwietnia 2008
- Ostatnia zmiana
- 30 kwietnia 2026
Opis
The product utilizes multiple threads, processes, components, or systems to allow temporary access to a shared resource that can only be exclusive to one process at a time, but it does not properly synchronize these actions, which might cause simultaneous accesses of this resource by multiple threads or processes.
Synchronization refers to a variety of behaviors and mechanisms that allow two or more independently-operating processes or threads to ensure that they operate on shared resources in predictable ways that do not interfere with each other. Some shared resource operations cannot be executed atomically; that is, multiple steps must be guaranteed to execute sequentially, without any interference by other processes. Synchronization mechanisms vary widely, but they may include locking, mutexes, and semaphores. When a multi-step operation on a shared resource cannot be guaranteed to execute independent of interference, then the resulting behavior can be unpredictable. Improper synchronization could lead to data or memory corruption, denial of service, etc.
Skutki
Integrity, Confidentiality, Other
Modify Application Data; Read Application Data; Alter Execution Logic
Zapobieganie
Implementation
Use industry standard APIs to synchronize your code.
Przykłady podatności
- 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
Słabość nadrzędna
Może prowadzić do
Słabości podrzędne
- CWE-362 Concurrent Execution using Shared Resource with Improper Synchronization ('Race Condition')
- CWE-366 Race Condition within a Thread
- CWE-543 Use of Singleton Pattern Without Synchronization in a Multithreaded Context
- CWE-567 Unsynchronized Access to Shared Data in a Multithreaded Context
- CWE-663 Use of a Non-reentrant Function in a Concurrent Context
- CWE-667 Improper Locking
- CWE-764 Multiple Locks of a Critical Resource
- CWE-820 Missing Synchronization
- CWE-821 Incorrect Synchronization
- CWE-833 Deadlock
- CWE-1058 Invokable Control Element in Multi-Thread Context with non-Final Static Storable or Member Element
- CWE-1096 Singleton Class Instance Creation without Proper Locking or Synchronization
- CWE-1265 Unintended Reentrant Invocation of Non-reentrant Code Via Nested Calls
Kiedy powstaje
- Architecture and Design
- Implementation
Dotyczy
Not Language-Specific
Uwagi
Deeper research is necessary for synchronization and related mechanisms, including locks, mutexes, semaphores, and other mechanisms. Multiple entries are dependent on this research, which includes relationships to concurrency, race conditions, reentrant functions, etc. CWE-662 and its children - including CWE-667, CWE-820, CWE-821, and others - may need to be modified significantly, along with their relationships.
Wpis z katalogu CWE 4.20.