CWE-400: Uncontrolled Resource Consumption
Description
The product does not properly control the allocation and maintenance of a limited resource.
- Abstraction
- ClassAn abstract weakness, independent of any specific language or technology.
- Likelihood of exploit
- High
- Status
- Draft
Common consequences
- 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...
- Access ControlOther
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.
Potential mitigations
- 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...
- Architecture and Design
Mitigation 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...
- 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.
Related weaknesses
Parent weaknesses
Child weaknesses
- CWE-405Asymmetric Resource Consumption (Amplification)
- CWE-770Allocation of Resources Without Limits or Throttling
- CWE-771Missing Reference to Active Allocated Resource
- CWE-779Logging of Excessive Data
- CWE-920Improper Restriction of Power Consumption
- CWE-1235Incorrect Use of Autoboxing and Unboxing for Performance Critical Operations
- CWE-1246Improper Write Handling in Limited-write Non-Volatile Memories