Memory leaks have two common and sometimes overlapping causes:
Scope | Impact | Likelihood |
---|---|---|
Availability | DoS: Crash, Exit, or Restart, DoS: Instability, DoS: Resource Consumption (CPU), DoS: Resource Consumption (Memory) Note: Most memory leaks result in general product reliability problems, but if an attacker can intentionally trigger a memory leak, the attacker might be able to launch a denial of service attack (by crashing or hanging the program) or take advantage of other unexpected program behavior resulting from a low memory condition. | |
Other | Reduce Performance |
References | Description |
---|---|
CVE-2005-3119 | Memory leak because function does not free() an element of a data structure. |
CVE-2004-0427 | Memory leak when counter variable is not decremented. |
CVE-2002-0574 | chain: reference count is not decremented, leading to memory leak in OS by sending ICMP packets. |
CVE-2005-3181 | Kernel uses wrong function to release a data structure, preventing data from being properly tracked by other code. |
CVE-2004-0222 | Memory leak via unknown manipulations as part of protocol test suite. |
CVE-2001-0136 | Memory leak via a series of the same command. |
Choose a language or tool that provides automatic memory management, or makes manual memory management less error-prone.
For example, glibc in Linux provides protection against free of invalid pointers.
When using Xcode to target OS X or iOS, enable automatic reference counting (ARC) [REF-391].
To help correctly and consistently manage memory when programming in C++, consider using a smart pointer class such as std::auto_ptr (defined by ISO/IEC ISO/IEC 14882:2003), std::shared_ptr and std::unique_ptr (specified by an upcoming revision of the C++ standard, informally referred to as C++ 1x), or equivalent solutions such as Boost.
Name | Organization | Date | Date release | Version |
---|---|---|---|---|
PLOVER | Draft 3 |
Name | Organization | Date | Comment |
---|---|---|---|
Eric Dalci | Cigital | updated Time_of_Introduction | |
KDM Analytics | added/updated white box definitions | ||
Veracode | Suggested OWASP Top Ten 2004 mapping | ||
CWE Content Team | MITRE | updated Applicable_Platforms, Common_Consequences, Relationships, Other_Notes, References, Relationship_Notes, Taxonomy_Mappings, Terminology_Notes | |
CWE Content Team | MITRE | updated Description | |
CWE Content Team | MITRE | updated Other_Notes | |
CWE Content Team | MITRE | updated Name | |
KDM Analytics | Improved the White_Box_Definition | ||
CWE Content Team | MITRE | updated White_Box_Definitions | |
CWE Content Team | MITRE | updated Modes_of_Introduction, Other_Notes | |
CWE Content Team | MITRE | updated Relationships | |
CWE Content Team | MITRE | updated Other_Notes, Potential_Mitigations | |
CWE Content Team | MITRE | updated Demonstrative_Examples, Name | |
CWE Content Team | MITRE | updated Alternate_Terms | |
CWE Content Team | MITRE | updated Common_Consequences, Relationships, Taxonomy_Mappings | |
CWE Content Team | MITRE | updated Relationships, Taxonomy_Mappings | |
CWE Content Team | MITRE | updated Potential_Mitigations | |
CWE Content Team | MITRE | updated Observed_Examples | |
CWE Content Team | MITRE | updated Potential_Mitigations, References | |
CWE Content Team | MITRE | updated Relationships, Taxonomy_Mappings | |
CWE Content Team | MITRE | updated References, Relationships, Taxonomy_Mappings, White_Box_Definitions | |
CWE Content Team | MITRE | updated Common_Consequences, Demonstrative_Examples, Name, References, Relationships, Taxonomy_Mappings, Type, Weakness_Ordinalities | |
CWE Content Team | MITRE | updated Description, Name | |
CWE Content Team | MITRE | updated References, Relationships, Taxonomy_Mappings | |
CWE Content Team | MITRE | updated Relationships | |
CWE Content Team | MITRE | updated Relationships | |
CWE Content Team | MITRE | updated Taxonomy_Mappings | |
CWE Content Team | MITRE | updated Common_Consequences, Description | |
CWE Content Team | MITRE | updated Detection_Factors, References, Relationships, Time_of_Introduction | |
CWE Content Team | MITRE | updated Mapping_Notes |