CWE-665: CWE-665: Improper Initialization

ClassStable

Description

View on MITRE
Back to CWE Lookup

Extended Description

Extended Description

Technical Details

Structure
Simple
Vulnerability Mapping
DISCOURAGED

Applicable To

Languages
Languages
Platforms
Languages

Frequently Asked Questions

What is CWE-665: CWE-665: Improper Initialization?+

CWE-665: CWE-665: Improper Initialization is a Common Weakness Enumeration (CWE) entry maintained by MITRE. Description Extended Description

What are the security consequences of CWE-665: Improper Initialization?+

If exploited, CWE-665 (CWE-665: Improper Initialization) it can compromise Read Memory, Read Application Data, Bypass Protection Mechanism, DoS: Crash, Exit and or Restart, leading to outcomes such as Scope: Confidentiality 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., Scope: Access Control If security-critical decisions rely on a variable having a &#34, 0&#34, or equivalent value and and the programming language performs this initialization on behalf of the programmer.

How do you prevent or mitigate CWE-665: Improper Initialization?+

Recommended mitigations for CWE-665 include: Strategy: Language Selection Use a language that does not allow this weakness to occur or provides constructs that make this weakness easier to avoid. For example, in Java, if the programmer does not explicitly initialize a variable, then the code could produce a compile-time error (if the variable is local) or automatically initialize the variable to the default value for the variable's type. In Perl, if explicit initialization is not performed, then a default value of undef is assigned, which is interpreted as 0, false, or an equivalent value depending on the context in which the variable is accessed. Identify all variables and data stores that receive information from external sources, and apply input validation to make sure that they are only initialized to expected values. Explicitly initialize all your variables and other data stores, either during declaration or just before the first usage.

Which programming languages are affected by CWE-665: Improper Initialization?+

CWE-665 commonly affects Languages. Note that weaknesses are often language-agnostic patterns, so secure coding practices apply broadly.

What is the difference between a CWE and a CVE?+

A CWE (Common Weakness Enumeration) like CWE-665 describes a category of software weakness — the underlying flaw type. A CVE (Common Vulnerabilities and Exposures) identifies a specific, real-world vulnerability in a particular product. In short, a CWE is the kind of mistake, and a CVE is an instance of that mistake being found in software.

Learn More