98 vulnerabilities classified as CWE-789 (未经控制的内存分配). AI Chinese analysis included.
CWE-789 represents a critical memory management weakness where software allocates resources based on unvalidated, excessively large size values provided by external inputs. This flaw typically arises when developers fail to enforce upper bounds on integer parameters before invoking allocation functions, allowing attackers to supply maliciously crafted values that trigger massive memory consumption. Exploitation often leads to denial-of-service conditions through system exhaustion or resource starvation, potentially destabilizing the entire host environment. To mitigate this risk, developers must implement rigorous input validation strategies that strictly check size parameters against predefined, safe thresholds before any allocation occurs. Additionally, utilizing language-specific bounds checking mechanisms and static analysis tools can help identify potential overflows early in the development lifecycle, ensuring that memory requests remain within acceptable operational limits and preventing arbitrary resource depletion.
unsigned int size = GetUntrustedInt(); /* ignore integer overflow (CWE-190) for this example */ unsigned int totBytes = size * sizeof(char); char *string = (char *)malloc(totBytes); InitializeString(string);unsigned int size = GetUntrustedInt(); HashMap list = new HashMap(size);Vulnerabilities classified as CWE-789 (未经控制的内存分配) represent 98 CVEs. The CWE taxonomy describes the weakness; review individual CVEs for product-specific impact.