Uncontrolled Resource Consumption ('Resource Exhaustion') |
Weakness ID: 400 (Weakness Base) | Status: Incomplete |
Description Summary
Extended Description
Limited resources include memory, file system storage, database connection pool entries, or CPU. If an attacker can trigger the allocation of these limited resources, but the number or size of the resources is not controlled, then the attacker could cause a denial of service that consumes all available resources. This would prevent valid users from accessing the software, and it could potentially have an impact on the surrounding environment. For example, a memory exhaustion attack against an application could slow down the application as well as its host operating system.
Resource exhaustion problems have at least two common causes:
(1) Error conditions and other exceptional circumstances
(2) Confusion over which part of the program is responsible for releasing the resource
Scope | Effect |
---|---|
Availability | The most common result of resource exhaustion is denial of service. The software may slow down, crash due to unhandled errors, or lock out legitimate users. |
Integrity | In some cases it may be possible to force the software to "fail open" in the event of resource exhaustion. The state of the software -- and possibly the security functionality - may then be compromised. |
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 software 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 software 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 |
Example 1
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.
Reference | Description |
---|---|
CVE-2009-2874 | Product allows attackers to cause a crash via a large number of connections. |
CVE-2009-1928 | Malformed request triggers uncontrolled recursion, leading to stack exhaustion. |
CVE-2009-2858 | Chain: memory leak (CWE-404) leads to resource exhaustion. |
CVE-2009-2726 | Driver does not use a maximum width when invoking sscanf style functions, causing stack consumption. |
CVE-2009-2540 | Large integer value for a length property in an object causes a large amount of memory allocation. |
CVE-2009-2299 | Web application firewall consumes excessive memory when an HTTP request contains a large Content-Length value but no POST data. |
CVE-2009-2054 | Product allows exhaustion of file descriptors when processing a large number of TCP packets. |
CVE-2008-5180 | Communication product allows memory consumption with a large number of SIP requests, which cause many sessions to be created. |
CVE-2008-2121 | TCP implementation allows attackers to consume CPU and prevent new connections using a TCP SYN flood attack. |
CVE-2008-2122 | Port scan triggers CPU consumption with processes that attempt to read data from closed sockets. |
CVE-2008-1700 | Product allows attackers to cause a denial of service via a large number of directives, each of which opens a separate window. |
CVE-2007-4103 | Product allows resource exhaustion via a large number of calls that do not complete a 3-way handshake. |
CVE-2006-1173 | Mail server does not properly handle deeply nested multipart MIME messages, leading to stack exhaustion. |
CVE-2007-0897 | Chain: 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. |
Phase: 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. |
Phase: 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, he 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. |
Phase: Architecture and Design Ensure that protocols have specific limits of scale placed on them. |
Phase: Implementation Ensure that all failures in resource allocation place the system into a safe posture. |
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. |
Nature | Type | ID | Name | View(s) this relationship pertains to |
---|---|---|---|---|
ChildOf | Category | 399 | Resource Management Errors | Development Concepts (primary)699 |
ChildOf | Weakness Class | 664 | Improper Control of a Resource Through its Lifetime | Research Concepts (primary)1000 |
ChildOf | Category | 730 | OWASP Top Ten 2004 Category A9 - Denial of Service | Weaknesses in OWASP Top Ten (2004) (primary)711 |
ParentOf | Category | 769 | File Descriptor Exhaustion | Development Concepts (primary)699 |
ParentOf | Weakness Base | 770 | Allocation of Resources Without Limits or Throttling | Development Concepts (primary)699 Research Concepts1000 |
ParentOf | Weakness Base | 771 | Missing Reference to Active Allocated Resource | Research Concepts (primary)1000 |
ParentOf | Weakness Base | 772 | Missing Release of Resource after Effective Lifetime | Research Concepts1000 |
ParentOf | Weakness Base | 779 | Logging of Excessive Data | Development Concepts (primary)699 Research Concepts (primary)1000 |
CanFollow | Weakness Base | 410 | Insufficient Resource Pool | Development Concepts699 Research Concepts1000 |
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 |
Joao Antunes, Nuno Ferreira Neves and Paulo Verissimo. "Detection and Prediction of Resource-Exhaustion Vulnerabilities". Proceedings of the IEEE International Symposium on Software Reliability Engineering (ISSRE). November 2008. <http://homepages.di.fc.ul.pt/~nuno/PAPERS/ISSRE08.pdf>. |
D.J. Bernstein. "Resource exhaustion". <http://cr.yp.to/docs/resources.html>. |
Pascal Meunier. "Resource exhaustion". Secure Programming Educational Material. 2004. <http://homes.cerias.purdue.edu/~pmeunier/secprog/sanitized/class1/6.resource%20exhaustion.ppt>. |
[REF-11] M. Howard and D. LeBlanc. "Writing Secure Code". Chapter 17, "Protecting Against Denial of Service Attacks" Page 517. 2nd Edition. Microsoft. 2002. |
Submissions | ||||
---|---|---|---|---|
Submission Date | Submitter | Organization | Source | |
CLASP | Externally Mined | |||
Modifications | ||||
Modification Date | Modifier | Organization | Source | |
2008-07-01 | Eric Dalci | Cigital | External | |
updated Time of Introduction | ||||
2008-08-15 | Veracode | External | ||
Suggested OWASP Top Ten 2004 mapping | ||||
2008-09-08 | CWE Content Team | MITRE | Internal | |
updated Common Consequences, Relationships, Other Notes, Taxonomy Mappings | ||||
2008-10-14 | CWE Content Team | MITRE | Internal | |
updated Description, Name, Relationships | ||||
2009-01-12 | CWE Content Team | MITRE | Internal | |
updated Description | ||||
2009-05-27 | CWE Content Team | MITRE | Internal | |
updated Name, Relationships | ||||
2009-07-27 | CWE Content Team | MITRE | Internal | |
updated Description, Relationships | ||||
2009-10-29 | CWE Content Team | MITRE | Internal | |
updated Relationships | ||||
2009-12-28 | CWE Content Team | MITRE | Internal | |
updated Common Consequences, Demonstrative Examples, Detection Factors, Likelihood of Exploit, Observed Examples, Other Notes, Potential Mitigations, References | ||||
Previous Entry Names | ||||
Change Date | Previous Entry Name | |||
2008-10-14 | Resource Exhaustion | |||
2009-05-27 | Uncontrolled Resource Consumption (aka 'Resource Exhaustion') | |||