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

Goal: 1000 CNY · Raised: 1000 CNY

100.0%

CWE-457 (使用未经初始化的变量) — Vulnerability Class 111

111 vulnerabilities classified as CWE-457 (使用未经初始化的变量). AI Chinese analysis included.

CWE-457 represents a critical code quality weakness where software utilizes a variable before assigning it a defined value, resulting in unpredictable behavior or unintended execution paths. In languages like C and C++, uninitialized stack variables often retain residual data from previous operations, creating a source of non-deterministic state. Attackers typically exploit this by manipulating memory contents to influence program flow, potentially leading to information disclosure, privilege escalation, or denial of service through crashes. To mitigate this risk, developers must rigorously initialize all variables at the point of declaration or immediately before first use. Employing static analysis tools to detect uninitialized reads and adhering to strict coding standards that enforce explicit initialization practices are essential strategies for preventing this vulnerability and ensuring application stability and security.

MITRE CWE Description
The code uses a variable that has not been initialized, leading to unpredictable or unintended results. In some languages such as C and C++, stack variables are not initialized by default. They generally contain junk data with the contents of stack memory before the function was invoked. An attacker can sometimes control or read these contents. In other languages or conditions, a variable that is not explicitly initialized can be given a default value that has security implications, depending on the logic of the program. The presence of an uninitialized variable can sometimes indicate a typographic error in the code.
Common Consequences (2)
Availability, Integrity, OtherOther
Initial variables usually contain junk, which can not be trusted for consistency. This can lead to denial of service conditions, or modify control flow in unexpected ways. In some cases, an attacker can "pre-initialize" the variable using previous actions, which might enable code execution. This can…
Authorization, OtherOther
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.
Mitigations (5)
ImplementationEnsure that critical variables are initialized before first use [REF-1485].
Build and CompilationMost compilers will complain about the use of uninitialized variables if warnings are turned on.
Implementation, OperationWhen 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.
RequirementsChoose a language that is not susceptible to these issues.
Architecture and DesignMitigating technologies such as safe string libraries and container abstractions could be introduced.
Examples (2)
This code prints a greeting using information stored in a POST request:
if (isset($_POST['names'])) { $nameArray = $_POST['names']; } echo "Hello " . $nameArray['first'];
Bad · PHP
The following switch statement is intended to set the values of the variables aN and bN before they are used:
int aN, Bn; switch (ctl) { case -1: aN = 0; bN = 0; break; case 0: aN = i; bN = -i; break; case 1: aN = i + NEXT_SZ; bN = i - NEXT_SZ; break; default: aN = -1; aN = -1; break; } repaint(aN, bN);
Bad · C
CVE IDTitleCVSSSeverityPublished
CVE-2022-28317 Bentley Systems MicroStation 代码注入漏洞 — MicroStation CONNECT 7.8 -2023-03-29
CVE-2022-28319 Bentley Systems MicroStation 安全漏洞 — MicroStation CONNECT 7.8 -2023-03-29
CVE-2022-28320 Bentley Systems Bentley View 安全漏洞 — View 7.8 -2023-03-29
CVE-2022-42432 Linux kernel 安全漏洞 — Kernel 4.4 -2023-03-29
CVE-2022-34390 Dell BIOS 安全漏洞 — CPG BIOS 7.5 High2022-10-12
CVE-2022-2308 Linux kernel 安全漏洞 — Linux kernel 8.4 -2022-09-01
CVE-2022-33716 SAMSUNG Mobile devices 安全漏洞 — Samsung Mobile Devices 2.3 Low2022-08-05
CVE-2022-34655 TMM vulnerability CVE-2022-34655 — BIG-IP 7.5 High2022-08-04
CVE-2021-46631 Bentley Systems Bentley View 安全漏洞 — View 7.8 -2022-02-18
CVE-2021-46617 Bentley Systems MicroStation 安全漏洞 — MicroStation CONNECT 7.8 -2022-02-18
CVE-2021-46570 Bentley Systems Bentley View 安全漏洞 — View 5.5 -2022-02-18
CVE-2021-46566 Bentley Systems MicroStation 安全漏洞 — MicroStation CONNECT 7.8 -2022-02-18
CVE-2021-21966 Texas Instruments Cc3200 SimpleLink Solution Nwp 环境问题漏洞 — Texas Instruments 5.3 -2022-02-16
CVE-2022-21217 Reolink Rlc-410W 缓冲区错误漏洞 — n/a 9.8 -2022-01-28
CVE-2021-40418 Blackmagic Design DaVinci Resolve 安全漏洞 — Blackmagic Design 9.8 Critical2021-12-22
CVE-2021-44003 Siemens Jt2go 安全漏洞 — JT2Go 5.5 -2021-12-14
CVE-2021-3928 Use of Uninitialized Variable in vim/vim — vim/vim 8.4 -2021-11-05
CVE-2021-31435 Foxit Studio Photo 安全漏洞 — Studio Photo 7.8 -2021-04-29
CVE-2019-1010317 WavPack 安全漏洞 — WavPack 7.1 -2019-07-11
CVE-2019-1010319 WavPack 安全漏洞 — WavPack 7.1 -2019-07-11
CVE-2019-11038 Uninitialized read in gdImageCreateFromXbm — PHP 5.3 -2019-06-18

Vulnerabilities classified as CWE-457 (使用未经初始化的变量) represent 111 CVEs. The CWE taxonomy describes the weakness; review individual CVEs for product-specific impact.