CWEweakness

CWE-466 Return of Pointer Value Outside of Expected Range

Official page ↗
Abstraction
Base
Structure
Simple
Status
Draft
Languages
C, C++, Memory-Unsafe
CWE version
5.0

Description

A function can return a pointer to memory that is outside of the buffer that the pointer is expected to reference.

Common consequences

• Confidentiality, Integrity: Read Memory, Modify Memory

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.) • Automated Dynamic Analysis: Use tools that are integrated during compilation to insert runtime error-checking mechanisms related to memory safety errors, such as AddressSanitizer (ASan) for C/C++ [REF-1518].

Related

Child of · CWE (2)

  • CWE-119 Improper Restriction of Operations within the Bounds of a Memory Buffer weakness
  • CWE-20 Improper Input Validation weakness

Referenced by CVE · weakness (8)

  • CVE-2026-57025 A Return of Pointer Value Outside of Expected Range vulnerability in the fileio library of Juniper Networks Junos OS and Junos OS Evolved… vulnerability
  • CVE-2018-25227 Valentina Studio 9.0.4 contains a denial of service vulnerability that allows local attackers to crash the application by supplying an… vulnerability
  • CVE-2018-25234 SmartFTP Client 9.0.2615.0 contains a denial of service vulnerability that allows local attackers to crash the application by supplying an… vulnerability
  • CVE-2019-25586 Deluge 1.3.15 contains a denial of service vulnerability that allows local attackers to crash the application by supplying an excessively… vulnerability
  • CVE-2019-25599 Backup Key Recovery 2.2.4 contains a denial of service vulnerability that allows local attackers to crash the application by supplying an… vulnerability
  • CVE-2019-25548 BlueStacks 4.80.0.1060 contains a denial of service vulnerability that allows local attackers to crash the application by submitting… vulnerability
  • CVE-2024-33602 nscd: netgroup cache assumes NSS callback uses in-buffer strings The Name Service Cache Daemon's (nscd) netgroup cache can corrupt memory… vulnerability
  • CVE-2024-21849 When an Advanced WAF/ASM security policy and a Websockets profile are configured on a virtual server, undisclosed traffic can cause the… vulnerability