Goal Reached Thanks to every supporter — we hit 100%!

Goal: 1000 CNY · Raised: 1000 CNY

100.0%

CWE-909 (资源初始化缺失) — Vulnerability Class 11

11 vulnerabilities classified as CWE-909 (资源初始化缺失). AI Chinese analysis included.

CWE-909 represents a critical resource management weakness where software fails to properly initialize essential variables or objects before use. This oversight typically allows attackers to exploit uninitialized memory or state, leading to unpredictable behavior, information disclosure, or denial of service. By accessing resources containing stale, default, or garbage data, adversaries can manipulate application logic, bypass security controls, or trigger crashes. Developers prevent this vulnerability by rigorously initializing all critical resources immediately upon allocation or declaration. Implementing strict coding standards that mandate explicit initialization, utilizing static analysis tools to detect uninitialized variables, and conducting thorough code reviews ensure that every resource holds a valid, expected state before execution. This proactive approach eliminates the risk of relying on undefined or insecure default values, thereby maintaining application integrity and security.

MITRE CWE Description
The product does not initialize a critical resource. Many resources require initialization before they can be properly used. If a resource is not initialized, it could contain unpredictable or expired data, or it could be initialized to defaults that are invalid. This can have security implications when the resource is expected to have certain properties or values.
Common Consequences (2)
ConfidentialityRead Memory, Read Application Data
When reusing a resource such as memory or a program variable, the original contents of that resource may not be cleared before it is sent to an untrusted party.
AvailabilityDoS: Crash, Exit, or Restart
The uninitialized resource may contain values that cause program flow to change in ways that the programmer did not intend.
Mitigations (4)
ImplementationExplicitly initialize the resource before use. If this is performed through an API function or standard procedure, follow all specified steps.
ImplementationPay close attention to complex conditionals that affect initialization, since some branches might not perform the initialization.
ImplementationAvoid race conditions (CWE-362) during initialization routines.
Build and CompilationRun or compile your product with settings that generate warnings about uninitialized variables or data.
Examples (2)
Here, a boolean initiailized field is consulted to ensure that initialization tasks are only completed once. However, the field is mistakenly set to true during static initialization, so the initialization code is never reached.
private boolean initialized = true; public void someMethod() { if (!initialized) { // perform initialization tasks ... initialized = true; }
Bad · Java
The following code intends to limit certain operations to the administrator only.
$username = GetCurrentUser(); $state = GetStateData($username); if (defined($state)) { $uid = ExtractUserID($state); } # do stuff if ($uid == 0) { DoAdminThings(); }
Bad · Perl

Vulnerabilities classified as CWE-909 (资源初始化缺失) represent 11 CVEs. The CWE taxonomy describes the weakness; review individual CVEs for product-specific impact.