| Impact | Details |
|---|---|
|
DoS: Crash, Exit, or Restart; DoS: Resource Consumption (CPU); DoS: Resource Consumption (Memory); DoS: Resource Consumption (Other) |
Scope: Availability
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.
|
|
Bypass Protection Mechanism; Other |
Scope: Access Control, 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.
|
| Phase(s) | Mitigation |
|---|---|
|
Architecture and Design |
Design 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 Design |
Mitigation of resource exhaustion attacks requires that the target system either:
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 Design |
Ensure that protocols have specific limits of scale placed on them.
|
|
Implementation |
Ensure that all failures in resource allocation place the system into a safe posture.
|
| Nature | Type | ID | Name |
|---|---|---|---|
| ChildOf | Pillar Pillar - a weakness that is the most abstract type of weakness and represents a theme for all class/base/variant weaknesses related to it. A Pillar is different from a Category as a Pillar is still technically a type of weakness that describes a mistake, while a Category represents a common characteristic used to group related things. | 664 | Improper Control of a Resource Through its Lifetime |
| ParentOf | Class Class - a weakness that is described in a very abstract fashion, typically independent of any specific language or technology. More specific than a Pillar Weakness, but more general than a Base Weakness. Class level weaknesses typically describe issues in terms of 1 or 2 of the following dimensions: behavior, property, and resource. | 405 | Asymmetric Resource Consumption (Amplification) |
| ParentOf | Base Base - a weakness that is still mostly independent of a resource or technology, but with sufficient details to provide specific methods for detection and prevention. Base level weaknesses typically describe issues in terms of 2 or 3 of the following dimensions: behavior, property, technology, language, and resource. | 770 | Allocation of Resources Without Limits or Throttling |
| ParentOf | Base Base - a weakness that is still mostly independent of a resource or technology, but with sufficient details to provide specific methods for detection and prevention. Base level weaknesses typically describe issues in terms of 2 or 3 of the following dimensions: behavior, property, technology, language, and resource. | 771 | Missing Reference to Active Allocated Resource |
| ParentOf | Base Base - a weakness that is still mostly independent of a resource or technology, but with sufficient details to provide specific methods for detection and prevention. Base level weaknesses typically describe issues in terms of 2 or 3 of the following dimensions: behavior, property, technology, language, and resource. | 779 | Logging of Excessive Data |
| ParentOf | Base Base - a weakness that is still mostly independent of a resource or technology, but with sufficient details to provide specific methods for detection and prevention. Base level weaknesses typically describe issues in terms of 2 or 3 of the following dimensions: behavior, property, technology, language, and resource. | 920 | Improper Restriction of Power Consumption |
| ParentOf | Base Base - a weakness that is still mostly independent of a resource or technology, but with sufficient details to provide specific methods for detection and prevention. Base level weaknesses typically describe issues in terms of 2 or 3 of the following dimensions: behavior, property, technology, language, and resource. | 1235 | Incorrect Use of Autoboxing and Unboxing for Performance Critical Operations |
| ParentOf | Base Base - a weakness that is still mostly independent of a resource or technology, but with sufficient details to provide specific methods for detection and prevention. Base level weaknesses typically describe issues in terms of 2 or 3 of the following dimensions: behavior, property, technology, language, and resource. | 1246 | Improper Write Handling in Limited-write Non-Volatile Memories |
| CanFollow | Class Class - a weakness that is described in a very abstract fashion, typically independent of any specific language or technology. More specific than a Pillar Weakness, but more general than a Base Weakness. Class level weaknesses typically describe issues in terms of 1 or 2 of the following dimensions: behavior, property, and resource. | 410 | Insufficient Resource Pool |
| Nature | Type | ID | Name |
|---|---|---|---|
| MemberOf | View View - a subset of CWE entries that provides a way of examining CWE content. The two main view structures are Slices (flat lists) and Graphs (containing relationships between entries). | 1003 | Weaknesses for Simplified Mapping of Published Vulnerabilities |
| ParentOf | Base Base - a weakness that is still mostly independent of a resource or technology, but with sufficient details to provide specific methods for detection and prevention. Base level weaknesses typically describe issues in terms of 2 or 3 of the following dimensions: behavior, property, technology, language, and resource. | 770 | Allocation of Resources Without Limits or Throttling |
| ParentOf | Base Base - a weakness that is still mostly independent of a resource or technology, but with sufficient details to provide specific methods for detection and prevention. Base level weaknesses typically describe issues in terms of 2 or 3 of the following dimensions: behavior, property, technology, language, and resource. | 920 | Improper Restriction of Power Consumption |
| Phase | Note |
|---|---|
| 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:
Resource exhaustion problems often occur due to an incorrect implementation of the following situations:
|
Class: Not Language-Specific (Undetermined Prevalence)
Example 1
The following example demonstrates the weakness.
There are no limits to runnables. Potentially an attacker could cause resource problems very quickly.
Example 2
This code allocates a socket and forks each time it receives a new connection.
The program does not track how many connections have been made, and it does not limit the number of connections. Because forking is a relatively expensive operation, an attacker would be able to cause the system to run out of CPU, processes, or memory by making a large number of connections. Alternatively, an attacker could consume all available connections, preventing others from accessing the system remotely.
Example 3
In the following example a server socket connection is used to accept a request to store data on the local file system using a specified filename. The method openSocketConnection establishes a server socket to accept requests from a client. When a client establishes a connection to this service the getNextMessage method is first used to retrieve from the socket the name of the file to store the data, the openFileToWrite method will validate the filename and open a file to write to on the local file system. The getNextMessage is then used within a while loop to continuously read data from the socket and output the data to the file until there is no longer any data from the socket.
This example creates a situation where data can be dumped to a file on the local file system without any limits on the size of the file. This could potentially exhaust file or disk resources and/or limit other clients' ability to access the service.
Example 4
In the following example, the processMessage method receives a two dimensional character array containing the message to be processed. The two-dimensional character array contains the length of the message in the first character array and the message body in the second character array. The getMessageLength method retrieves the integer value of the length from the first character array. After validating that the message length is greater than zero, the body character array pointer points to the start of the second character array of the two-dimensional character array and memory is allocated for the new body character array.
This example creates a situation where the length of the body character array can be very large and will consume excessive memory, exhausting system resources. This can be avoided by restricting the length of the second character array with a maximum length check
Also, consider changing the type from 'int' to 'unsigned int', so that you are always guaranteed that the number is positive. This might not be possible if the protocol specifically requires allowing negative values, or if you cannot control the return value from getMessageLength(), but it could simplify the check to ensure the input is positive, and eliminate other errors such as signed-to-unsigned conversion errors (CWE-195) that may occur elsewhere in the code.
Example 5
In the following example, a server object creates a server socket and accepts client connections to the socket. For every client connection to the socket a separate thread object is generated using the ClientSocketThread class that handles request made by the client through the socket.
In this example there is no limit to the number of client connections and client threads that are created. Allowing an unlimited number of client connections and threads could potentially overwhelm the system and system resources.
The server should limit the number of client connections and the client threads that are created. This can be easily done by creating a thread pool object that limits the number of threads that are generated.
Example 6
In the following example, the serve function receives an http request and an http response writer. It reads the entire request body.
Because ReadAll is defined to read from src until EOF, it does not treat an EOF from Read as an error to be reported. This example creates a situation where the length of the body supplied can be very large and will consume excessive memory, exhausting system resources. This can be avoided by ensuring the body does not exceed a predetermined length of bytes.
MaxBytesReader prevents clients from accidentally or maliciously sending a large request and wasting server resources. If possible, the code could be changed to tell ResponseWriter to close the connection after the limit has been reached.
Note: this is a curated list of examples for users to understand the variety of ways in which this weakness can be introduced. It is not a complete list of all CVEs that are related to this CWE entry.
| Reference | Description |
|---|---|
|
Go-based workload orchestrator does not limit resource usage with unauthenticated connections, allowing a DoS by flooding the service
|
|
|
Resource exhaustion in distributed OS because of "insufficient" IGMP queue management, as exploited in the wild per CISA KEV.
|
|
|
Product allows attackers to cause a crash via a large number of connections.
|
|
|
Malformed request triggers uncontrolled recursion, leading to stack exhaustion.
|
|
|
Chain: memory leak (CWE-404) leads to resource exhaustion.
|
|
|
Driver does not use a maximum width when invoking sscanf style functions, causing stack consumption.
|
|
|
Large integer value for a length property in an object causes a large amount of memory allocation.
|
|
|
Web application firewall consumes excessive memory when an HTTP request contains a large Content-Length value but no POST data.
|
|
|
Product allows exhaustion of file descriptors when processing a large number of TCP packets.
|
|
|
Communication product allows memory consumption with a large number of SIP requests, which cause many sessions to be created.
|
|
|
TCP implementation allows attackers to consume CPU and prevent new connections using a TCP SYN flood attack.
|
|
|
Port scan triggers CPU consumption with processes that attempt to read data from closed sockets.
|
|
|
Product allows attackers to cause a denial of service via a large number of directives, each of which opens a separate window.
|
|
|
Product allows resource exhaustion via a large number of calls that do not complete a 3-way handshake.
|
|
|
Mail server does not properly handle deeply nested multipart MIME messages, leading to stack exhaustion.
|
|
| Method | Details |
|---|---|
|
Automated Static Analysis |
Automated 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 Analysis |
Certain 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 |
|
Fuzzing |
While 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 |
| Nature | Type | ID | Name |
|---|---|---|---|
| MemberOf | CategoryCategory - a CWE entry that contains a set of other entries that share a common characteristic. | 730 | OWASP Top Ten 2004 Category A9 - Denial of Service |
| MemberOf | CategoryCategory - a CWE entry that contains a set of other entries that share a common characteristic. | 858 | The CERT Oracle Secure Coding Standard for Java (2011) Chapter 15 - Serialization (SER) |
| MemberOf | CategoryCategory - a CWE entry that contains a set of other entries that share a common characteristic. | 861 | The CERT Oracle Secure Coding Standard for Java (2011) Chapter 18 - Miscellaneous (MSC) |
| MemberOf | ViewView - a subset of CWE entries that provides a way of examining CWE content. The two main view structures are Slices (flat lists) and Graphs (containing relationships between entries). | 884 | CWE Cross-section |
| MemberOf | CategoryCategory - a CWE entry that contains a set of other entries that share a common characteristic. | 985 | SFP Secondary Cluster: Unrestricted Consumption |
| MemberOf | CategoryCategory - a CWE entry that contains a set of other entries that share a common characteristic. | 1148 | SEI CERT Oracle Secure Coding Standard for Java - Guidelines 14. Serialization (SER) |
| MemberOf | CategoryCategory - a CWE entry that contains a set of other entries that share a common characteristic. | 1152 | SEI CERT Oracle Secure Coding Standard for Java - Guidelines 49. Miscellaneous (MSC) |
| MemberOf | ViewView - a subset of CWE entries that provides a way of examining CWE content. The two main view structures are Slices (flat lists) and Graphs (containing relationships between entries). | 1200 | Weaknesses in the 2019 CWE Top 25 Most Dangerous Software Errors |
| MemberOf | ViewView - a subset of CWE entries that provides a way of examining CWE content. The two main view structures are Slices (flat lists) and Graphs (containing relationships between entries). | 1350 | Weaknesses in the 2020 CWE Top 25 Most Dangerous Software Weaknesses |
| MemberOf | ViewView - a subset of CWE entries that provides a way of examining CWE content. The two main view structures are Slices (flat lists) and Graphs (containing relationships between entries). | 1387 | Weaknesses in the 2022 CWE Top 25 Most Dangerous Software Weaknesses |
| MemberOf | CategoryCategory - a CWE entry that contains a set of other entries that share a common characteristic. | 1416 | Comprehensive Categorization: Resource Lifecycle Management |
| MemberOf | ViewView - a subset of CWE entries that provides a way of examining CWE content. The two main view structures are Slices (flat lists) and Graphs (containing relationships between entries). | 1430 | Weaknesses in the 2024 CWE Top 25 Most Dangerous Software Weaknesses |
Rationale
CWE-400 is intended for incorrect behaviors in which the product is expected to track and restrict how many resources it consumes, but CWE-400 is often misused because it is conflated with the "technical impact" of vulnerabilities in which resource consumption occurs. It is sometimes used for low-information vulnerability reports. It is a level-1 Class (i.e., a child of a Pillar).Comments
Closely analyze the specific mistake that is causing resource consumption, and perform a CWE mapping for that mistake. Consider children/descendants such as CWE-770: Allocation of Resources Without Limits or Throttling, CWE-771: Missing Reference to Active Allocated Resource, CWE-410: Insufficient Resource Pool, CWE-772: Missing Release of Resource after Effective Lifetime, CWE-834: Excessive Iteration, CWE-405: Asymmetric Resource Consumption (Amplification), and others.Theoretical
Other
Database queries that take a long time to process are good DoS targets. An attacker would have to write a few lines of Perl code to generate enough traffic to exceed the site's ability to keep up. This would effectively prevent authorized users from using the site at all. Resources can be exploited simply by ensuring that the target machine must do much more work and consume more resources in order to service a request than the attacker must do to initiate a request.
A prime example of this can be found in old switches that were vulnerable to "macof" attacks (so named for a tool developed by Dugsong). These attacks flooded a switch with random IP and MAC address combinations, therefore exhausting the switch's cache, which held the information of which port corresponded to which MAC addresses. Once this cache was exhausted, the switch would fail in an insecure way and would begin to act simply as a hub, broadcasting all traffic on all ports and allowing for basic sniffing attacks.
Limited resources include memory, file system storage, database connection pool entries, CPU, and others.
Maintenance
Maintenance
| Mapped Taxonomy Name | Node ID | Fit | Mapped Node Name |
|---|---|---|---|
| CLASP | Resource exhaustion (file descriptor, disk space, sockets, ...) | ||
| OWASP Top Ten 2004 | A9 | CWE More Specific | Denial of Service |
| WASC | 10 | Denial of Service | |
| WASC | 41 | XML Attribute Blowup | |
| The CERT Oracle Secure Coding Standard for Java (2011) | SER12-J | Avoid memory and resource leaks during serialization | |
| The CERT Oracle Secure Coding Standard for Java (2011) | MSC05-J | Do not exhaust heap space | |
| Software Fault Patterns | SFP13 | Unrestricted Consumption | |
| ISA/IEC 62443 | Part 3-3 | Req SR 7.1 | |
| ISA/IEC 62443 | Part 3-3 | Req SR 7.2 | |
| ISA/IEC 62443 | Part 4-1 | Req SI-1 | |
| ISA/IEC 62443 | Part 4-1 | Req SVV-3 | |
| ISA/IEC 62443 | Part 4-2 | Req CR 7.1 | |
| ISA/IEC 62443 | Part 4-2 | Req CR 7.2 |
| Submissions | |||
|---|---|---|---|
| Submission Date | Submitter | Organization | |
|
2006年07月19日
(CWE Draft 3, 2006年07月19日) |
CLASP | ||
| Contributions | |||
| Contribution Date | Contributor | Organization | |
|
2023年01月24日
(CWE 4.10, 2023年01月31日) |
"Mapping CWE to 62443" Sub-Working Group | CWE-CAPEC ICS/OT SIG | |
| Suggested mappings to ISA/IEC 62443. | |||
| 2023年04月25日 | "Mapping CWE to 62443" Sub-Working Group | CWE-CAPEC ICS/OT SIG | |
| Suggested mappings to ISA/IEC 62443. | |||
|
2025年02月25日
(CWE 4.17, 2025年04月03日) |
Abhi Balakrishnan | ||
| Provided diagram to improve CWE usability. | |||
| Modifications | |||
| Modification Date | Modifier | Organization | |
|
2025年09月09日
(CWE 4.18, 2025年09月09日) |
CWE Content Team | MITRE | |
| updated Observed_Examples, References | |||
|
2025年04月03日
(CWE 4.17, 2025年04月03日) |
CWE Content Team | MITRE | |
| updated Common_Consequences, Description, Diagram, Modes_of_Introduction, Other_Notes, Time_of_Introduction | |||
|
2024年11月19日
(CWE 4.16, 2024年11月19日) |
CWE Content Team | MITRE | |
| updated Relationships | |||
| 2023年06月29日 | CWE Content Team | MITRE | |
| updated Mapping_Notes, Relationships | |||
| 2023年04月27日 | CWE Content Team | MITRE | |
| updated Demonstrative_Examples, Relationships, Taxonomy_Mappings | |||
| 2023年01月31日 | CWE Content Team | MITRE | |
| updated Common_Consequences, Description, Detection_Factors, Maintenance_Notes, Related_Attack_Patterns, Taxonomy_Mappings | |||
| 2022年10月13日 | CWE Content Team | MITRE | |
| updated Observed_Examples, Relationships | |||
| 2022年06月28日 | CWE Content Team | MITRE | |
| updated Observed_Examples, Relationships | |||
| 2022年04月28日 | CWE Content Team | MITRE | |
| updated Related_Attack_Patterns | |||
| 2020年08月20日 | CWE Content Team | MITRE | |
| updated Relationships | |||
| 2020年06月25日 | CWE Content Team | MITRE | |
| updated Description, Maintenance_Notes | |||
| 2020年02月24日 | CWE Content Team | MITRE | |
| updated Description, References, Related_Attack_Patterns, Relationships | |||
| 2019年09月19日 | CWE Content Team | MITRE | |
| updated Description, Relationships | |||
| 2019年06月20日 | CWE Content Team | MITRE | |
| updated Related_Attack_Patterns, Relationships | |||
| 2019年01月03日 | CWE Content Team | MITRE | |
| updated Alternate_Terms, Description, Name, Relationships, Taxonomy_Mappings, Theoretical_Notes | |||
| 2018年03月27日 | CWE Content Team | MITRE | |
| updated References, Type | |||
| 2017年11月08日 | CWE Content Team | MITRE | |
| updated Applicable_Platforms, Demonstrative_Examples, Likelihood_of_Exploit, Potential_Mitigations, References, Relationships | |||
| 2017年01月19日 | CWE Content Team | MITRE | |
| updated Relationships | |||
| 2015年12月07日 | CWE Content Team | MITRE | |
| updated Related_Attack_Patterns, Relationships | |||
| 2014年07月30日 | CWE Content Team | MITRE | |
| updated Relationships, Taxonomy_Mappings | |||
| 2013年07月17日 | CWE Content Team | MITRE | |
| updated Relationships | |||
| 2012年05月11日 | CWE Content Team | MITRE | |
| updated Demonstrative_Examples, Related_Attack_Patterns, Relationships, Taxonomy_Mappings | |||
| 2011年06月01日 | CWE Content Team | MITRE | |
| updated Common_Consequences, Relationships, Taxonomy_Mappings | |||
| 2010年09月27日 | CWE Content Team | MITRE | |
| updated Demonstrative_Examples | |||
| 2010年06月21日 | CWE Content Team | MITRE | |
| updated Description | |||
| 2010年04月05日 | CWE Content Team | MITRE | |
| updated Related_Attack_Patterns | |||
| 2010年02月16日 | CWE Content Team | MITRE | |
| updated Detection_Factors, Potential_Mitigations, References, Taxonomy_Mappings | |||
| 2009年12月28日 | CWE Content Team | MITRE | |
| updated Common_Consequences, Demonstrative_Examples, Detection_Factors, Likelihood_of_Exploit, Observed_Examples, Other_Notes, Potential_Mitigations, References | |||
| 2009年10月29日 | CWE Content Team | MITRE | |
| updated Relationships | |||
| 2009年07月27日 | CWE Content Team | MITRE | |
| updated Description, Relationships | |||
| 2009年05月27日 | CWE Content Team | MITRE | |
| updated Name, Relationships | |||
| 2009年01月12日 | CWE Content Team | MITRE | |
| updated Description | |||
| 2008年10月14日 | CWE Content Team | MITRE | |
| updated Description, Name, Relationships | |||
| 2008年09月08日 | CWE Content Team | MITRE | |
| updated Common_Consequences, Relationships, Other_Notes, Taxonomy_Mappings | |||
| 2008年08月15日 | Veracode | ||
| Suggested OWASP Top Ten 2004 mapping | |||
| 2008年07月01日 | Eric Dalci | Cigital | |
| updated Time_of_Introduction | |||
| Previous Entry Names | |||
| Change Date | Previous Entry Name | ||
| 2008年10月14日 | Resource Exhaustion | ||
| 2009年05月27日 | Uncontrolled Resource Consumption (aka 'Resource Exhaustion') | ||
| 2019年01月03日 | Uncontrolled Resource Consumption ('Resource Exhaustion') | ||
Use of the Common Weakness Enumeration (CWE™) and the associated references from this website are subject to the Terms of Use. CWE is sponsored by the U.S. Department of Homeland Security (DHS) Cybersecurity and Infrastructure Security Agency (CISA) and managed by the Homeland Security Systems Engineering and Development Institute (HSSEDI) which is operated by The MITRE Corporation (MITRE). Copyright © 2006–2025, The MITRE Corporation. CWE, CWSS, CWRAF, and the CWE logo are trademarks of The MITRE Corporation.