VariantDraft

CWE-457Use of Uninitialized Variable

Category: other

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 / Other — Other
    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 cause a race condition if a lock variable check passes when it should not.
  • Authorization / Other — Other
    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· 5

  • [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.

References

  1. https://cwe.mitre.org/data/definitions/457.html

(incoming)10

TypeTargetConfidenceTier
VulnerabilityCVE-2025-20271cve-2025-202710%live
VulnerabilityCVE-2025-53644cve-2025-536440%live
VulnerabilityCVE-2025-54874cve-2025-548740%live
VulnerabilityCVE-2025-5749cve-2025-57490%live
VulnerabilityCitrix NetScaler ADC and Gateway Out-of-Bounds Read Vulnerabilitycve-2025-57770%live
VulnerabilityCVE-2025-65295cve-2025-652950%live
VulnerabilityCVE-2026-2806cve-2026-28060%live
VulnerabilityCVE-2026-34608cve-2026-346080%live
VulnerabilityCVE-2026-6311cve-2026-63110%live
VulnerabilityCVE-2026-6748cve-2026-67480%live

Related by meaning· 6

Nearest entities by semantic similarity across the cs-graph corpus.

CWE
Insufficient Control Flow Management
CWE
Assignment to Variable without Use
CWE
Unchecked Error Condition
CWE
DEPRECATED: Use of Uninitialized Resource
CWE
External Initialization of Trusted Variables or Data Stores
CWE
Use of sizeof() on a Pointer Type
Sourced from MITRE CWE 4.20. Curated for EU compliance use cases by Adam Lundqvist, Founder at SQUR.