Weakness · Medium

CWE-911: Improper Update of Reference Count

What it is

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

Likelihood of exploit: MediumMITRE CWE 4.19.1

Severity (our rating)
Medium
Likelihood of exploit
Medium
Introduced during
Implementation
Exploited in the wild
No CVE in CISA's catalog

In more detail

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.

What an attacker can do

  • DoS: Resource Consumption (Memory) (Availability)
  • DoS: Resource Consumption (Other) (Availability)
  • DoS: Crash, Exit, or Restart (Availability)

How to prevent it

MITRE lists no specific mitigation for this weakness. Treat it like its parent weaknesses below: validate input, keep the design simple and review the code where it could appear.

CWE-911 on MITRE's CWE site

H2 Security

Found it in your code?

We review where it appears, fix it with your team, and check it was not already used against you.

Talk to our team

T Academy

Stop writing it in the first place

Learn to build software and systems without weaknesses like this one, with practice on real hosts in your browser, every objective checked on the machine.

Start free

Source: MITRE Common Weakness Enumeration, CWE version 4.19.1. CWE is a trademark of The MITRE Corporation.