CWEweakness
CWE-456 Missing Initialization of a Variable
- Abstraction
- Variant
- Structure
- Simple
- Status
- Draft
- Languages
- Not Language-Specific
- CWE version
- 5.0
Description
The product does not initialize critical variables.
Common consequences
• Integrity, Other: Unexpected State, Quality Degradation, Varies by Context — The execution environment might use unexpected values. The uninitialized data may be invalid, causing logic errors within the program. In some cases, this could result in a security problem.
Potential mitigations
• [Implementation] Ensure that critical variables are initialized before first use [REF-1485].
• [Requirements] Choose a language that is not susceptible to these issues.
Detection methods
• 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-2020-6078: Chain: The return value of a function returning a pointer is not checked for success (CWE-252) resulting in the later use of an uninitialized variable (CWE-456) and a null pointer dereference (CWE-476)
• CVE-2019-3836: Chain: secure communications library does not initialize a local variable for a data structure (CWE-456), leading to access of an uninitialized pointer (CWE-824).
• CVE-2018-14641: Chain: C union member is not initialized (CWE-456), leading to access of invalid pointer (CWE-824)
• CVE-2009-2692: Chain: Use of an unimplemented network socket operation pointing to an uninitialized handler function (CWE-456) causes a crash because of a null pointer dereference (CWE-476).
• CVE-2020-20739: A variable that has its value set in a conditional statement is sometimes used when the conditional fails, sometimes causing data leakage
• CVE-2005-2978: Product uses uninitialized variables for size and index, leading to resultant buffer overflow.
• CVE-2005-2109: Internal variable in PHP application is not initialized, allowing external modification.
• CVE-2005-2193: Array variable not initialized in PHP application, leading to resultant SQL injection.
Related
Observed example · CVE (8)
- CVE-2020-20739 im_vips2dz in /libvips/libvips/deprecated/im_vips2dz.c in libvips before 8.8.2 has an uninitialized variable which may cause the leakage of… vulnerability
- CVE-2020-6078 An exploitable denial-of-service vulnerability exists in the message-parsing functionality of Videolabs libmicrodns 0.1.0. vulnerability
- CVE-2019-3836 It was discovered in gnutls before version 3.6.7 upstream that there is an uninitialized pointer access in gnutls versions 3.6.3 or later… vulnerability
- CVE-2018-14641 A security flaw was found in the ip_frag_reasm() function in net/ipv4/ip_fragment.c in the Linux kernel from 4.19-rc1 to 4.19-rc3… vulnerability
- CVE-2009-2692 The Linux kernel 2.6.0 through 2.6.30.4, and 2.4.4 through 2.4.37.4, does not initialize all function pointers for socket operations in… vulnerability
- CVE-2005-2978 pnmtopng in netpbm before 10.25, when using the -trans option, uses uninitialized size and index variables when converting Portable Anymap… vulnerability
- CVE-2005-2193 SQL injection vulnerability in the user profile edit module in profile.php for PunBB 1.2.5 and earlier allows remote attackers to execute… vulnerability
- CVE-2005-2109 wp-login.php in WordPress 1.5.1.2 and earlier allows remote attackers to change the content of the forgotten password e-mail message via… vulnerability
Can precede · CWE (4)
Child of · CWE (2)
Referenced by CVE · weakness (9)
- CVE-2026-46300 In the Linux kernel, the following vulnerability has been resolved: net: skbuff: preserve shared-frag marker during coalescing… vulnerability
- CVE-2024-54131 The Kolide Agent (aka: Launcher) is the lightweight agent designed to work with Kolide's service. vulnerability
- CVE-2024-9780 ITS dissector crash in Wireshark 4.4.0 allows denial of service via packet injection or crafted capture file vulnerability
- CVE-2024-32878 Llama.cpp is LLM inference in C/C++. vulnerability
- CVE-2023-20226 A vulnerability in Application Quality of Experience (AppQoE) and Unified Threat Defense (UTD) on Cisco IOS XE Software could allow an… vulnerability
- CVE-2021-40403 An information disclosure vulnerability exists in the pick-and-place rotation parsing functionality of Gerbv 2.7.0 and dev (commit… vulnerability
- CVE-2021-34703 A vulnerability in the Link Layer Discovery Protocol (LLDP) message parser of Cisco IOS Software and Cisco IOS XE Software could allow an… vulnerability
- CVE-2019-3836 It was discovered in gnutls before version 3.6.7 upstream that there is an uninitialized pointer access in gnutls versions 3.6.3 or later… vulnerability
- CVE-2018-14641 A security flaw was found in the ip_frag_reasm() function in net/ipv4/ip_fragment.c in the Linux kernel from 4.19-rc1 to 4.19-rc3… vulnerability
Referenced by CWE · can also be (1)
- CWE-454 External Initialization of Trusted Variables or Data Stores weakness
Referenced by CWE · has member (1)
- CWE-884 CWE Cross-section view