Base · Medium

CWE-911: Improper Update of Reference Count

The product uses a reference count to manage a resource, but it does not update or incorrectly updates the reference count.

CWE-911 · Base Level ·17 CVEs

Description

The product uses a reference count to manage a resource, but it does not update or incorrectly updates the reference count.

Reference counts can be used when tracking how many objects contain a reference to a particular resource, such as in memory management or garbage collection. When the reference count reaches zero, the resource can be de-allocated or reused because there are no more objects that use it. If the reference count accidentally reaches zero, then the resource might be released too soon, even though it is still in use. If all objects no longer use the resource, but the reference count is not zero, then the resource might not ever be released.

Potential Impact

Availability

DoS: Resource Consumption (Memory), DoS: Resource Consumption (Other)

Availability

DoS: Crash, Exit, or Restart

Real-World CVE Examples

CVE IDDescription
CVE-2002-0574chain: reference count is not decremented, leading to memory leak in OS by sending ICMP packets.
CVE-2004-0114Reference count for shared memory not decremented when a function fails, potentially allowing unprivileged users to read kernel memory.
CVE-2006-3741chain: improper reference count tracking leads to file descriptor consumption
CVE-2007-1383chain: integer overflow in reference counter causes the same variable to be destroyed twice.
CVE-2007-1700Incorrect reference count calculation leads to improper object destruction and code execution.
CVE-2008-2136chain: incorrect update of reference count leads to memory leak.
CVE-2008-2785chain/composite: use of incorrect data type for a reference counter allows an overflow of the counter, leading to a free of memory that is still in use.
CVE-2008-5410Improper reference counting leads to failure of cryptographic operations.
CVE-2009-1709chain: improper reference counting in a garbage collection routine leads to use-after-free
CVE-2009-3553chain: reference count not correctly maintained when client disconnects during a large operation, leading to a use-after-free.
CVE-2009-3624Reference count not always incremented, leading to crash or code execution.
CVE-2010-0176improper reference counting leads to expired pointer dereference.
CVE-2010-0623OS kernel increments reference count twice but only decrements once, leading to resource consumption and crash.
CVE-2010-2549OS kernel driver allows code execution
CVE-2010-4593improper reference counting leads to exhaustion of IP addresses

Showing 15 of 17 observed examples.

Frequently Asked Questions

What is CWE-911?

CWE-911 (Improper Update of Reference Count) is a software weakness identified by MITRE's Common Weakness Enumeration. It is classified as a Base-level weakness. The product uses a reference count to manage a resource, but it does not update or incorrectly updates the reference count.

How can CWE-911 be exploited?

Attackers can exploit CWE-911 (Improper Update of Reference Count) to dos: resource consumption (memory), dos: resource consumption (other). This weakness is typically introduced during the Implementation phase of software development.

How do I prevent CWE-911?

Follow secure coding practices, conduct code reviews, and use automated security testing tools (SAST/DAST) to detect this weakness early in the development lifecycle.

What is the severity of CWE-911?

CWE-911 is classified as a Base-level weakness (Medium abstraction). It has been observed in 17 real-world CVEs.