14 vulnerabilities classified as CWE-366 (单线程内的竞争条件). AI Chinese analysis included.
CWE-366 represents a concurrency weakness where multiple threads access a shared resource simultaneously, leading to undefined execution states. This vulnerability typically arises when developers fail to synchronize access to critical sections, allowing race conditions to occur. Attackers exploit this by manipulating the timing of thread execution to trigger inconsistent states, potentially causing data corruption, privilege escalation, or application crashes. For instance, a thread might read a variable while another is mid-update, resulting in the use of invalid or partially initialized data. To prevent this, developers must implement robust synchronization mechanisms such as mutexes, semaphores, or atomic operations. These tools ensure exclusive access to shared resources during critical operations, thereby maintaining data integrity and preventing the unpredictable behavior inherent in unsynchronized concurrent execution environments.
int foo = 0; int storenum(int num) { static int counter = 0; counter++; if (num > foo) foo = num; return foo; }public classRace { static int foo = 0; public static void main() { new Threader().start(); foo = 1; } public static class Threader extends Thread { public void run() { System.out.println(foo); } } }Vulnerabilities classified as CWE-366 (单线程内的竞争条件) represent 14 CVEs. The CWE taxonomy describes the weakness; review individual CVEs for product-specific impact.