CWE-400: Uncontrolled Resource Consumption

What is CWE-400?

CWE-400 is Uncontrolled Resource Consumption. The flaw arises when the product does not properly control the allocation and maintenance of a limited resource. The database currently holds 740 vulnerabilities mapped to CWE-400 and 1 of them are in the CISA Known Exploited Vulnerabilities catalog.

OWASP Top 10 Rank-
Related CVES (365 days)740
AbstractionClass
Likelihood of exploitHigh

Vulnerabilities mapped to CWE-400

740 vulnerabilities567% increase year over year

Vulnerabilities in CISA KEV for CWE-400

1 vulnerabilities

Official definition

ByMitre CWE

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

Detailed description

This weakness occurs when an actor can cause a product to allocate or retain a limited resource without suitable limits on quantity, size, rate, or duration. Resources may be consumed because excessive requests are not throttled, resources are not closed or returned, references are lost before release, or failures are handled unsafely. The usual result is degraded or lost availability, but resource exhaustion can sometimes cause the product to fail open and weaken security protections.

Characteristics

The weakness arises when the system does not limit the number or size of allocated resources, fails to release resources at the proper time, or loses all references to resources before cleanup. Common causes include missing throttling, failure to close or return resources after processing, and incorrect handling of errors or exceptional conditions because responsibility for releasing the resource is unclear. It can be introduced through operation or configuration when resource limits are lower than expected, as well as through design and implementation decisions that do not handle excessive requests safely.

Common consequences

The primary consequence is an availability impact, including denial of service through crashes, exits, restarts, or consumption of CPU, memory, and other resources. Legitimate users may be slowed down or locked out, and resource exhaustion can also affect the surrounding host environment. In some cases, the product may fail open, allowing a protection mechanism to be bypassed or otherwise compromising security functionality.

ImpactScopeExplanation
DoS: Crash, Exit, or Restart, DoS: Resource Consumption (CPU), DoS: Resource Consumption (Memory), DoS: Resource Consumption (Other)AvailabilityIf 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.
Bypass Protection Mechanism, OtherAccess Control, OtherIn 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.

Risk mitigations

Design and limit consumption. Build throttling into the architecture, limit the amount of resources an unauthorized user can cause to be consumed, and place explicit scale limits on protocols. Use strong authentication and access control, protect login functionality against denial of service, consider caching database result sets, and track request rates so requests exceeding a defined threshold can be blocked.

The system can recognize an attack and deny further access for a period, or uniformly throttle requests so resources cannot be consumed faster than they are released. The first approach can itself deny service to a legitimate user, especially if an attacker impersonates that user, while uniform throttling is difficult to implement and only raises the attack cost rather than fully solving the problem. Ensure that every resource-allocation failure leaves the system in a safe posture.

  1. 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.
  2. 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.
  3. Architecture and DesignEnsure that protocols have specific limits of scale placed on them.
  4. ImplementationEnsure that all failures in resource allocation place the system into a safe posture.

Detection methods

Automated static analysis has limited utility and is mainly applicable to system resources such as files, sockets, and processes. It may identify resources that are not released after expiration or configuration settings without a maximum value, but it is generally unsuitable for custom resources such as a policy limiting a user's posts per day.

Automated dynamic analysis has moderate effectiveness for processes, memory, and connections by generating many requests within a short period. Fuzzing can find resource exhaustion opportunistically when many test cases run without restarting the target; an intermittent crash may indicate that the product cannot handle accumulated resource exhaustion. These approaches are not complete guarantees and may miss weaknesses involving custom resource policies or scenarios not exercised by the tests.

MethodApproachEffectiveness
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.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.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.Opportunistic

Representative vulnerabilities

The following are representative examples, not an exhaustive list:

  • CVE-2019-19911: a Python library processes images with a very large number of bands without limiting resources, leading to excessive memory consumption or an integer overflow.
  • CVE-2020-7218: a Go-based workload orchestrator does not limit resource usage for unauthenticated connections, allowing denial of service through service flooding.
  • CVE-2020-3566: insufficient IGMP queue management in a distributed operating system results in resource exhaustion.
  • CVE-2009-2874, CVE-2007-4103, and CVE-2008-2121: these illustrate exhaustion caused by large numbers of connections, incomplete three-way handshakes, and a TCP SYN flood that consumes CPU.
  • CVE-2009-1928 and CVE-2006-1173: deeply nested requests or data exhaust the stack through uncontrolled recursion or deeply nested MIME messages.
  • CVE-2009-2858 and CVE-2007-0897: a memory leak or failure to close a file descriptor leads to resource exhaustion and processing failures.
  • CVE-2009-2726, CVE-2009-2540, and CVE-2009-2299: large inputs or unrestricted length values cause excessive stack or memory consumption.
  • CVE-2009-2054, CVE-2008-5180, CVE-2008-2122, and CVE-2007-0897: file descriptors, memory, CPU, or session resources are exhausted by large numbers of packets, requests, processes, or sessions.

Below are representative vulnerabilities related to this CWE, prioritized by severity.

Sources (2)

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.