Skip to main content

CWE-763: Release of Invalid Pointer or Reference

BaseIncomplete

The product attempts to return a memory resource to the system, but it calls the wrong release function or calls the appropriate release function incorrectly.

View on MITRE
Back to CWE Lookup

Extended Description

This weakness can take several forms, such as: The memory was allocated, explicitly or implicitly, via one memory management method and deallocated using a different, non-compatible function (CWE-762). The function calls or memory management routines chosen are appropriate, however they are used incorrectly, such as in CWE-761.

Technical Details

Structure
Simple

Applicable To

Languages
CC++
Platforms

Frequently Asked Questions

What is CWE-763: Release of Invalid Pointer or Reference?+

CWE-763: Release of Invalid Pointer or Reference is a Common Weakness Enumeration (CWE) entry maintained by MITRE. The product attempts to return a memory resource to the system, but it calls the wrong release function or calls the appropriate release function incorrectly. This weakness can take several forms, such as: The memory was allocated, explicitly or implicitly, via one memory management method and deallocated using a different, non-compatible function (CWE-762). The function calls or memory management routines chosen are appropriate, however they are used incorrectly, such as in CWE-761.

What are the security consequences of Release of Invalid Pointer or Reference?+

If exploited, CWE-763 (Release of Invalid Pointer or Reference) it can compromise Integrity, Availability and Confidentiality, leading to outcomes such as Modify Memory, DoS: Crash, Exit, or Restart and Execute Unauthorized Code or Commands.

How do you prevent or mitigate Release of Invalid Pointer or Reference?+

Recommended mitigations for CWE-763 include: Only call matching memory management functions. Do not mix and match routines. For example, when you allocate a buffer with malloc(), dispose of the original pointer with free(). When programming in C++, consider using smart pointers provided by the boost library to help correctly and consistently manage memory. Use a language that provides abstractions for memory allocation and deallocation.

Which programming languages are affected by Release of Invalid Pointer or Reference?+

CWE-763 commonly affects C and C++. Note that weaknesses are often language-agnostic patterns, so secure coding practices apply broadly.

What are real-world examples of Release of Invalid Pointer or Reference?+

MITRE documents real CVEs mapped to CWE-763, including CVE-2019-11930. You can look up the full details of each CVE, including CVSS scores and remediation guidance, on our CVE Lookup tool.

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

A CWE (Common Weakness Enumeration) like CWE-763 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