CWEweakness

CWE-457 Use of Uninitialized Variable

High Official page ↗
Abstraction
Variant
Structure
Simple
Status
Draft
Likelihood of exploit
High
Languages
C, C++, Not Language-Specific, PHP, Perl
CWE version
5.0

Description

The code uses a variable that has not been initialized, leading to unpredictable or unintended results.

Common consequences

• Confidentiality, Integrity, Availability, Other: Varies by Context, Read Application Data — Uninitialized variables usually contain junk, which can not be trusted for consistency. Depending on the context, uninitialized variables could lead to denial of service conditions, or modify control flow in unexpected ways. They could also contain sensitive information that could be leaked if the variable is used in output. In some cases, an attacker can "pre-initialize" the variable using previous actions - i.e., control the contents of the variable - which might enable code execution. • Availability: Alter Execution Logic, Unexpected State — This can cause a race condition if a lock variable check passes when it should not. • Authorization, Other: Varies by Context — Strings that are not initialized are especially dangerous, since many functions expect a null at the end -- and only at the end -- of a string.

Potential mitigations

• [Implementation] Ensure that critical variables are initialized before first use [REF-1485]. • [Build and Compilation] Most compilers will complain about the use of uninitialized variables if warnings are turned on. • [Implementation, Operation] When using a language that does not require explicit declaration of variables, run or compile the software in a mode that reports undeclared or unknown variables. This may indicate the presence of a typographic error in the variable's name. • [Requirements] Choose a language that is not susceptible to these issues. • [Architecture and Design] Mitigating technologies such as safe string libraries and container abstractions could be introduced.

Detection methods

• Fuzzing: Fuzz testing (fuzzing) is a powerful technique for generating large numbers of diverse inputs - either randomly or algorithmically - and dynamically invoking the code with those inputs. Even with random inputs, it is often capable of generating unexpected results such as crashes, memory corruption, or resource consumption. Fuzzing effectively produces repeatable test cases that clearly indicate bugs, which helps developers to diagnose the issues. • Automated Static Analysis: Automated static analysis, commonly referred to as Static Application Security Testing (SAST), can find some instances of this weakness by analyzing source code (or binary/compiled code) without having to execute it. Typically, this is done by building a model of data flow and control flow, then searching for potentially-vulnerable patterns that connect "sources" (origins of input) with "sinks" (destinations where the data interacts with external components, a lower layer such as the OS, etc.)

Observed examples

• CVE-2019-15900: Chain: sscanf() call is used to check if a username and group exists, but the return value of sscanf() call is not checked (CWE-252), causing an uninitialized variable to be checked (CWE-457), returning success to allow authorization bypass for executing a privileged (CWE-863). • CVE-2008-3688: Chain: A denial of service may be caused by an uninitialized variable (CWE-457) allowing an infinite loop (CWE-835) resulting from a connection to an unresponsive server. • CVE-2008-0081: Uninitialized variable leads to code execution in popular desktop application. • CVE-2007-4682: Crafted input triggers dereference of an uninitialized object pointer. • CVE-2007-3468: Crafted audio file triggers crash when an uninitialized variable is used. • CVE-2007-2728: Uninitialized random seed variable used.

Related

Observed example · CVE (6)

  • CVE-2019-15900 An issue was discovered in slicer69 doas before 6.2 on certain platforms other than OpenBSD. vulnerability
  • CVE-2008-3688 sockethandler.cpp in HTTP Antivirus Proxy (HAVP) 0.88 allows remote attackers to cause a denial of service (hang) by connecting to a… vulnerability
  • CVE-2008-0081 Unspecified vulnerability in Microsoft Excel 2000 SP3 through 2003 SP2, Viewer 2003, and Office 2004 for Mac allows user-assisted remote… vulnerability
  • CVE-2007-4682 CoreText in Apple Mac OS X 10.4 through 10.4.10 allows attackers to cause a denial of service (application crash) and possibly execute… vulnerability
  • CVE-2007-3468 input.c in VideoLAN VLC Media Player before 0.8.6c allows remote attackers to cause a denial of service (crash) via a crafted WAV file that… vulnerability
  • CVE-2007-2728 The soap extension in PHP calls php_rand_r with an uninitialized seed variable, which has unknown impact and attack vectors, a related… vulnerability

Child of · CWE (2)

  • CWE-665 Improper Initialization weakness
  • CWE-908 Use of Uninitialized Resource weakness

Referenced by CVE · weakness (280)

  • CVE-2026-113400 Uninitialized memory in the Audio/Video: cubeb component. vulnerability
  • CVE-2026-92449 `_gx_binres_pixelmap_table_load()` in the GUIX binary resource (theme) loader indexes the pixelmap table with a value read verbatim from… vulnerability
  • CVE-2026-94018 The Web add-on's HTTP server dereferences and releases an uninitialized pointer when it detects a `Content-Length` underflow while… vulnerability
  • CVE-2026-112893 Pillow is a Python imaging library. vulnerability
  • CVE-2026-112898 Pillow is a Python imaging library. vulnerability
  • CVE-2026-68907 libIEC61850 is an open-source implementation of IEC 61850 client and server protocols including MMS, GOOSE, Sampled Values, and R-Session. vulnerability
  • CVE-2026-109828 A vulnerability was found in libsndfile up to 1.2.2. vulnerability
  • CVE-2026-109854 A flaw was found in m17n-lib. vulnerability
  • CVE-2026-110143 Use of uninitialized variable in ThirdParty lmza_sdk in Google Chrome prior to 155.0.8059.79 allowed a remote attacker to potentially read… vulnerability
  • CVE-2026-55280 In multiple locations, there is a possible out-of-bounds write due to uninitialized data. vulnerability
  • CVE-2026-66859 NULL Pointer Dereference, Use of Uninitialized Variable vulnerability in Apache Thrift c_glib bindings. vulnerability
  • CVE-2026-18397 This vulnerability enables unauthenticated remote code execution (RCE) on a victim's machine by exploiting a combination of cryptographic… vulnerability
  • CVE-2026-102717 MQTT WebSocket setter ABI mismatch may disclose memory or cause a crash vulnerability
  • CVE-2026-103436 apcupsd through 3.14.14 discloses uninitialized stack memory in getupsvar() in src/cgi/upsfetch.c (used by upsstats.cgi, multimon.cgi, and… vulnerability
  • CVE-2026-100759 Uninitialized memory in the Storage: Quota Manager component. vulnerability
  • CVE-2026-100783 Uninitialized memory in the Audio/Video component. vulnerability
  • CVE-2026-100799 Uninitialized memory in the Graphics: WebGPU component. vulnerability
  • CVE-2026-100802 Uninitialized memory in the Graphics: WebGPU component. vulnerability
  • CVE-2026-100806 Uninitialized memory in the Graphics: WebGPU component. vulnerability
  • CVE-2026-95332 Use of uninitialized variable in Tint in Google Chrome on on Android prior to 154.0.8037.57 allowed a remote attacker to read memory… vulnerability
  • CVE-2026-19492 IBM PowerVM Hypervisor FW1120.00 through FW1120.01, FW1110.00 through FW1110.31, and FW1060.00 through FW1060.81 is affected by a… vulnerability
  • CVE-2026-16141 OpenBMC's IPMI implementation, phosphor-net-ipmid, contains a logic flaw in which an unauthenticated client can force the RAKP Message 1… vulnerability
  • CVE-2026-58721 In multiple locations, there is a possible information disclosure due to uninitialized memory use. vulnerability
  • CVE-2026-58731 In multiple functions of physmem_extmem_linux.c, there is a possible out-of-bounds read due to uninitialized data. vulnerability
  • CVE-2026-91963 FreeRDP versions before 3.31.0 contain an uninitialized heap memory disclosure vulnerability in the urbdrc USB redirection channel. vulnerability
  • CVE-2026-92052 Privilege escalation due to uninitialized memory in the Graphics: CanvasWebGL component. vulnerability
  • CVE-2026-65405 A memory initialization issue was addressed with improved memory handling. vulnerability
  • CVE-2026-84564 An uninitialized memory issue was addressed with improved memory initialization. vulnerability
  • CVE-2026-84391 A use of uninitialized variable vulnerability in Fortinet FortiAnalyzer 7.6.3 through 7.6.6 may allow attacker to denial of service via… vulnerability
  • CVE-2026-84639 Triggering an error condition in certain MIME bodies would cause uninitialized memory to be used. vulnerability
Show all 280 ›

Referenced by CWE · can precede (1)

  • CWE-456 Missing Initialization of a Variable weakness