CWE-457 상세 정보

CWE-457

Use of Uninitialized Variable
2006-07-19
00h00 +00:00
높음
Draft
2026-10-28
00h00 +00:00
특정 CWE 알림
특정 CWE의 변경 사항에 대한 정보를 받아보세요.
알림 관리

이름: Use of Uninitialized Variable

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

일반 정보

배경 세부 정보

취약점 도입 방식

Implementation : The presence of an uninitialized variable can sometimes indicate a typographic error in the code.
Implementation : In C, using an uninitialized char * in some string libraries will return incorrect results, as the libraries expect the null terminator to always be at the end of a string, even if the string is empty.

적용 가능한 플랫폼

언어

이름: C (Sometimes)
이름: C++ (Sometimes)
이름: Perl (Often)
이름: PHP (Often)
클래스: Not Language-Specific (Undetermined)

일반적인 결과

범위 영향 가능성
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.
AvailabilityAlter 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.

관찰된 예시

참고 자료 설명

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.

잠재적 완화 방법

Phases : Implementation
Ensure that critical variables are initialized before first use [REF-1485].
Phases : Build and Compilation
Most compilers will complain about the use of uninitialized variables if warnings are turned on.
Phases : 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.
Phases : Requirements
Choose a language that is not susceptible to these issues.
Phases : Architecture and Design
Mitigating technologies such as safe string libraries and container abstractions could be introduced.

탐지 방법

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.
효과성 : High

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.)
효과성 : High

취약점 매핑 메모

근거 : This CWE entry is at the Variant level of abstraction, which is a preferred level of abstraction for mapping to the root causes of vulnerabilities.
댓글 : Carefully read both the name and description to ensure that this mapping is an appropriate fit. Do not try to 'force' a mapping to a lower-level Base/Variant simply to comply with this preferred level of abstraction.

참고 자료

REF-18

The CLASP Application Security Process
Secure Software, Inc..
https://cwe.mitre.org/documents/sources/TheCLASPApplicationSecurityProcess.pdf

REF-436

Exploiting Uninitialized Data
mercy.
https://web.archive.org/web/20070403193636/http://www.felinemenace.org/~mercy/papers/UBehavior/UBehavior.zip

REF-437

MS08-014 : The Case of the Uninitialized Stack Variable Vulnerability
Microsoft Security Vulnerability Research & Defense.
https://msrc.microsoft.com/blog/2008/03/ms08-014-the-case-of-the-uninitialized-stack-variable-vulnerability/

REF-44

24 Deadly Sins of Software Security
Michael Howard, David LeBlanc, John Viega.

REF-62

The Art of Software Security Assessment
Mark Dowd, John McDonald, Justin Schuh.

REF-1485

D3FEND: D3-VI Variable Initialization
D3FEND.
https://d3fend.mitre.org/technique/d3f:VariableInitialization/

REF-1534

Automated Technical Debt Measure, Version 2
OMG.
https://www.omg.org/spec/ATDM2/1.0/PDF

제출

이름 조직 날짜 출시일 Version
CLASP 2006-07-19 +00:00 2006-07-19 +00:00 Draft 3

수정 사항

이름 조직 날짜 댓글
Eric Dalci Cigital 2008-07-01 +00:00 updated Time_of_Introduction
KDM Analytics 2008-08-01 +00:00 added/updated white box definitions
CWE Content Team MITRE 2008-09-08 +00:00 updated Applicable_Platforms, Common_Consequences, Description, Relationships, Observed_Example, Other_Notes, References, Taxonomy_Mappings
CWE Content Team MITRE 2009-01-12 +00:00 updated Common_Consequences, Demonstrative_Examples, Potential_Mitigations
CWE Content Team MITRE 2009-03-10 +00:00 updated Demonstrative_Examples
CWE Content Team MITRE 2009-05-27 +00:00 updated Demonstrative_Examples
CWE Content Team MITRE 2011-06-01 +00:00 updated Common_Consequences
CWE Content Team MITRE 2012-05-11 +00:00 updated References, Relationships
CWE Content Team MITRE 2012-10-30 +00:00 updated Demonstrative_Examples
CWE Content Team MITRE 2013-02-21 +00:00 updated Applicable_Platforms, Description, Other_Notes, Potential_Mitigations, Relationships
CWE Content Team MITRE 2014-06-23 +00:00 updated Modes_of_Introduction, Other_Notes
CWE Content Team MITRE 2014-07-30 +00:00 updated Relationships, Taxonomy_Mappings
CWE Content Team MITRE 2017-11-08 +00:00 updated References, Relationships, Taxonomy_Mappings, White_Box_Definitions
CWE Content Team MITRE 2019-01-03 +00:00 updated Taxonomy_Mappings
CWE Content Team MITRE 2019-06-20 +00:00 updated Relationships, Type
CWE Content Team MITRE 2020-02-24 +00:00 updated References, Relationships, Type
CWE Content Team MITRE 2020-08-20 +00:00 updated Relationships
CWE Content Team MITRE 2020-12-10 +00:00 updated Relationships
CWE Content Team MITRE 2021-03-15 +00:00 updated Demonstrative_Examples, Observed_Examples, Relationships
CWE Content Team MITRE 2021-07-20 +00:00 updated Observed_Examples
CWE Content Team MITRE 2023-04-27 +00:00 updated Detection_Factors, References, Relationships
CWE Content Team MITRE 2023-06-29 +00:00 updated Mapping_Notes
CWE Content Team MITRE 2025-09-09 +00:00 updated Potential_Mitigations, References
CWE Content Team MITRE 2025-12-11 +00:00 updated Weakness_Ordinalities
CWE Content Team MITRE 2026-10-28 +00:00 updated Background_Details, Common_Consequences, Description, Modes_of_Introduction, References