CWE-400: Uncontrolled Resource Consumption

What is CWE-400?

MITRE CWE

The product does not properly control the allocation and maintenance of a limited resource.

Verify to analyze this CWE entry

A short verification protects the official data source and prevents automated AI abuse.

Official definition

MITRE CWE

The product does not properly control the allocation and maintenance of a limited resource.

Detailed description

CyStack is analyzing this CWE entry. The page will update automatically when the bilingual analysis is ready.

Characteristics

CyStack is analyzing this CWE entry. The page will update automatically when the bilingual analysis is ready.
  • Resource Exhaustion

Modes of introduction

  • Operation: The product could be operated in a system or environment with lower resource limits than expected, which might make it easier for attackers to consume all available resources.
  • System Configuration: The product could be configured with lower resource limits than expected, which might make it easier for attackers to consume all available resources.
  • Architecture and Design: The designer might not consider how to handle and throttle excessive resource requests, which typically requires careful planning to handle more gracefully than a crash or exit.
  • Implementation: There are at least three distinct scenarios that can commonly lead to resource exhaustion: - Lack of throttling for the number of allocated resources. - Losing all references to a resource before reaching the shutdown stage. - Not closing/returning a resource after processing. Resource exhaustion problems often occur due to an incorrect implementation of the following situations: - Error conditions and other exceptional circumstances. - Confusion over which part of the program is responsible for releasing the resource.

Common consequences

CyStack is analyzing this CWE entry. The page will update automatically when the bilingual analysis is ready.
  • Availability

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

    If an attacker can trigger the allocation of the limited resources, but the number or size of the resources is not controlled, then the most common result is denial of service. This would prevent valid users from accessing the product, and it could potentially have an impact on the surrounding environment, i.e., the product may slow down, crash due to unhandled errors, or lock out legitimate users. For example, a memory exhaustion attack against an application could slow down the application as well as its host operating system.

  • Access Control, Other

    Bypass Protection Mechanism, Other

    In some cases it may be possible to force the product to "fail open" in the event of resource exhaustion. The state of the product -- and possibly the security functionality - may then be compromised.

Mitigations

CyStack is analyzing this CWE entry. The page will update automatically when the bilingual analysis is ready.
  • Architecture and DesignDesign throttling mechanisms into the system architecture. The best protection is to limit the amount of resources that an unauthorized user can cause to be expended. A strong authentication and access control model will help prevent such attacks from occurring in the first place. The login application should be protected against DoS attacks as much as possible. Limiting the database access, perhaps by caching result sets, can help minimize the resources expended. To further limit the potential for a DoS attack, consider tracking the rate of requests received from users and blocking requests that exceed a defined rate threshold.
  • Architecture and DesignMitigation of resource exhaustion attacks requires that the target system either: - recognizes the attack and denies that user further access for a given amount of time, or - uniformly throttles all requests in order to make it more difficult to consume resources more quickly than they can again be freed. The first of these solutions is an issue in itself though, since it may allow attackers to prevent the use of the system by a particular valid user. If the attacker impersonates the valid user, they may be able to prevent the user from accessing the server in question. The second solution is simply difficult to effectively institute -- and even when properly done, it does not provide a full solution. It simply makes the attack require more resources on the part of the attacker.
  • Architecture and DesignEnsure that protocols have specific limits of scale placed on them.
  • ImplementationEnsure that all failures in resource allocation place the system into a safe posture.

Detection methods

CyStack is analyzing this CWE entry. The page will update automatically when the bilingual analysis is ready.
  • Automated Static AnalysisAutomated static analysis typically has limited utility in recognizing resource exhaustion problems, except for program-independent system resources such as files, sockets, and processes. For system resources, automated static analysis may be able to detect circumstances in which resources are not released after they have expired. Automated analysis of configuration files may be able to detect settings that do not specify a maximum value. Automated static analysis tools will not be appropriate for detecting exhaustion of custom resources, such as an intended security policy in which a bulletin board user is only allowed to make a limited number of posts per day.Effectiveness: Limited
  • Automated Dynamic AnalysisCertain automated dynamic analysis techniques may be effective in spotting resource exhaustion problems, especially with resources such as processes, memory, and connections. The technique may involve generating a large number of requests to the product within a short time frame.Effectiveness: Moderate
  • FuzzingWhile fuzzing is typically geared toward finding low-level implementation bugs, it can inadvertently find resource exhaustion problems. This can occur when the fuzzer generates a large number of test cases but does not restart the targeted product in between test cases. If an individual test case produces a crash, but it does not do so reliably, then an inability to handle resource exhaustion may be the cause.Effectiveness: Opportunistic

Representative vulnerabilities

CyStack is analyzing this CWE entry. The page will update automatically when the bilingual analysis is ready.

These examples illustrate this CWE entry and are not an exhaustive list of related vulnerabilities.

  • CVE-2019-19911Chain: Python library does not limit the resources used to process images that specify a very large number of bands (CWE-1284), leading to excessive memory consumption (CWE-789) or an integer overflow (CWE-190).
  • CVE-2020-7218Go-based workload orchestrator does not limit resource usage with unauthenticated connections, allowing a DoS by flooding the service
  • CVE-2020-3566Resource exhaustion in distributed OS because of "insufficient" IGMP queue management, as exploited in the wild per CISA KEV.
  • CVE-2009-2874Product allows attackers to cause a crash via a large number of connections.
  • CVE-2009-1928Malformed request triggers uncontrolled recursion, leading to stack exhaustion.
  • CVE-2009-2858Chain: memory leak (CWE-404) leads to resource exhaustion.
  • CVE-2009-2726Driver does not use a maximum width when invoking sscanf style functions, causing stack consumption.
  • CVE-2009-2540Large integer value for a length property in an object causes a large amount of memory allocation.
  • CVE-2009-2299Web application firewall consumes excessive memory when an HTTP request contains a large Content-Length value but no POST data.
  • CVE-2009-2054Product allows exhaustion of file descriptors when processing a large number of TCP packets.
  • CVE-2008-5180Communication product allows memory consumption with a large number of SIP requests, which cause many sessions to be created.
  • CVE-2008-2121TCP implementation allows attackers to consume CPU and prevent new connections using a TCP SYN flood attack.
  • CVE-2008-2122Port scan triggers CPU consumption with processes that attempt to read data from closed sockets.
  • CVE-2008-1700Product allows attackers to cause a denial of service via a large number of directives, each of which opens a separate window.
  • CVE-2007-4103Product allows resource exhaustion via a large number of calls that do not complete a 3-way handshake.
  • CVE-2006-1173Mail server does not properly handle deeply nested multipart MIME messages, leading to stack exhaustion.
  • CVE-2007-0897Chain: anti-virus product encounters a malformed file but returns from a function without closing a file descriptor (CWE-775) leading to file descriptor consumption (CWE-400) and failed scans.

Sources and references

References

CWE™ Program, operated by The MITRE Corporation. Copyright © 2006–2026, The MITRE Corporation. The MITRE Corporation hereby grants you a non-exclusive, royalty-free license to use CWE for research, development, and commercial purposes. CWE Terms of Use.

Learn more

Run an in-depth assessment with complete web risk management

CyStack VulnScan continuously discovers assets, validates vulnerabilities, and helps security teams prioritize remediation across the organization.

Explore CyStack VulnScan
CyStack VulnScan dashboard