A function can return a pointer to memory that is outside of the buffer that the pointer is expected to reference.
View on MITRENo mitigation information available for this CWE.
No detection method information available for this CWE.
No examples or observed CVEs available for this CWE.
CWE-466: Return of Pointer Value Outside of Expected Range is a Common Weakness Enumeration (CWE) entry maintained by MITRE. A function can return a pointer to memory that is outside of the buffer that the pointer is expected to reference.
If exploited, CWE-466 (Return of Pointer Value Outside of Expected Range) it can compromise Confidentiality and Integrity, leading to outcomes such as Read Memory and Modify Memory.
CWE-466 commonly affects C and C++. Note that weaknesses are often language-agnostic patterns, so secure coding practices apply broadly.
A CWE (Common Weakness Enumeration) like CWE-466 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.