Difference between revisions of "Resource exhaustion"

From OWASP
Jump to: navigation, search
 
(7 intermediate revisions by 2 users not shown)
Line 1: Line 1:
 +
{{Template:Vulnerability}}
 
{{Template:SecureSoftware}}
 
{{Template:SecureSoftware}}
  
==Overview==
+
Last revision (mm/dd/yy): '''{{REVISIONMONTH}}/{{REVISIONDAY}}/{{REVISIONYEAR}}'''
  
Resource exhaustion is a simple denial of service condition which occurs when the resources necessary to perform an action are entirely consumed, therefore preventing that action from taking place.
+
[[ASDR_TOC_Vulnerabilities|Vulnerabilities Table of Contents]]
  
==Consequences ==
+
==Description==
  
* Availability: The most common result of resource exhaustion is denial-of-service.
+
Resource exhaustion is a simple denial of service condition which occurs when the resources necessary to perform an action are entirely consumed, therefore preventing that action from taking place.
  
* Access control: In some cases it may be possible to force a system to "fail open" in the event of resource exhaustion.
+
'''Consequences'''
  
==Exposure period ==
+
* Availability: The most common result of resource exhaustion is denial-of-service.
 +
* Access control: In some cases it may be possible to force a system to "fail open" in the event of resource exhaustion.
  
* Design: Issues in system architecture and protocol design may make systems more subject to resource-exhaustion attacks.
+
'''Exposure period'''
  
 +
* Design: Issues in system architecture and protocol design may make systems more subject to resource-exhaustion attacks.
 
* Implementation: Lack of low level consideration often contributes to the problem.
 
* Implementation: Lack of low level consideration often contributes to the problem.
  
==Platform ==
+
'''Platform'''
  
* Languages: All
+
* Languages: All
 +
* Platforms: All
  
* Platforms: All
+
'''Required resources'''
 
+
==Required resources ==
+
  
 
Any
 
Any
  
==Severity ==
+
'''Severity'''
  
 
Low to medium
 
Low to medium
  
==Likelihood   of exploit ==
+
'''Likelihood of exploit'''
  
 
Very high
 
Very high
 
==Avoidance and mitigation ==
 
 
* Design: Design throttling mechanisms into the system architecture.
 
 
* 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.
 
 
* Implementation: Fail safely when a resource exhaustion occurs.
 
 
==Discussion ==
 
  
 
Resource exhaustion issues are generally understood but are far more difficult to successfully prevent. 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.  
 
Resource exhaustion issues are generally understood but are far more difficult to successfully prevent. 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.  
Line 51: Line 41:
 
Prevention of these attacks requires either that the target system:
 
Prevention of these attacks requires either that the target system:
  
* either recognizes the attack and denies that user further access for a given amount of time;
+
* 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.  
* 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, he may be able to prevent the user from accessing the server in question.  
 
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.  
Line 61: Line 50:
 
The final concern that must be discussed about issues of resource exhaustion is that of systems which "fail open." This means that in the event of resource consumption, the system fails in such a way that the state of the system - and possibly the security functionality of the system - is compromised. 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.
 
The final concern that must be discussed about issues of resource exhaustion is that of systems which "fail open." This means that in the event of resource consumption, the system fails in such a way that the state of the system - and possibly the security functionality of the system - is compromised. 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.
  
==Examples ==
+
 
 +
==Risk Factors==
 +
 
 +
TBD
 +
 
 +
==Examples==
 +
 
  
 
In Java:
 
In Java:
Line 111: Line 106:
 
There are no limits to runnables/forks. Potentially an attacker could cause resource problems very quickly.
 
There are no limits to runnables/forks. Potentially an attacker could cause resource problems very quickly.
  
==Related problems ==
 
  
Not available.
+
==Related [[Attacks]]==
  
 +
* [[Attack 1]]
 +
* [[Attack 2]]
  
[[Category:Vulnerability]]
 
  
[[Category:Environmental Problem]]
+
==Related [[Vulnerabilities]]==
  
 +
* [[Vulnerability 1]]
 +
* [[Vulnerabiltiy 2]]
 +
 +
==Related [[Controls]]==
 +
 +
* Design: Design throttling mechanisms into the system architecture.
 +
* 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.
 +
* Implementation: Fail safely when a resource exhaustion occurs.
 +
 +
 +
==Related [[Technical Impacts]]==
 +
 +
* [[Technical Impact 1]]
 +
* [[Technical Impact 2]]
 +
 +
 +
==References==
 +
 +
TBD
 +
 +
[[Category:FIXME|add links
 +
 +
In addition, one should classify vulnerability based on the following subcategories: Ex:<nowiki>[[Category:Error Handling Vulnerability]]</nowiki>
 +
 +
Availability Vulnerability
 +
 +
Authorization Vulnerability
 +
 +
Authentication Vulnerability
 +
 +
Concurrency Vulnerability
 +
 +
Configuration Vulnerability
 +
 +
Cryptographic Vulnerability
 +
 +
Encoding Vulnerability
 +
 +
Error Handling Vulnerability
 +
 +
Input Validation Vulnerability
 +
 +
Logging and Auditing Vulnerability
 +
 +
Session Management Vulnerability]]
 +
 +
__NOTOC__
 +
 +
 +
[[Category:OWASP ASDR Project]]
 +
[[Category:Vulnerability]]
 +
[[Category:Environmental Vulnerability]]
 
[[Category:OWASP_CLASP_Project]]
 
[[Category:OWASP_CLASP_Project]]

Latest revision as of 10:28, 28 February 2009

This is a Vulnerability. To view all vulnerabilities, please see the Vulnerability Category page.



Last revision (mm/dd/yy): 02/28/2009

Vulnerabilities Table of Contents

Description

Resource exhaustion is a simple denial of service condition which occurs when the resources necessary to perform an action are entirely consumed, therefore preventing that action from taking place.

Consequences

  • Availability: The most common result of resource exhaustion is denial-of-service.
  • Access control: In some cases it may be possible to force a system to "fail open" in the event of resource exhaustion.

Exposure period

  • Design: Issues in system architecture and protocol design may make systems more subject to resource-exhaustion attacks.
  • Implementation: Lack of low level consideration often contributes to the problem.

Platform

  • Languages: All
  • Platforms: All

Required resources

Any

Severity

Low to medium

Likelihood of exploit

Very high

Resource exhaustion issues are generally understood but are far more difficult to successfully prevent. 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.

Prevention of these attacks requires either 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, 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.

The final concern that must be discussed about issues of resource exhaustion is that of systems which "fail open." This means that in the event of resource consumption, the system fails in such a way that the state of the system - and possibly the security functionality of the system - is compromised. 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.


Risk Factors

TBD

Examples

In Java:

class Worker implements Executor {
 ...
  public void execute(Runnable r) {
  try {
   ...
  }
  catch (InterruptedException ie) { // postpone response
   Thread.currentThread().interrupt();
  }
 }

 public Worker(Channel ch, int nworkers) { 
  ... 
  }

 protected void activate() {
  Runnable loop = new Runnable() {
   public void run() {
    try {
     for (;;) {
      Runnable r = ...
      r.run();
     }
    }
    catch (InterruptedException ie) {...}
   }
  };
  new Thread(loop).start();
 }

In C/C++:

int main(int argc, char *argv[]) {
  sock=socket(AF_INET, SOCK_STREAM, 0);
  while (1) {    
    newsock=accept(sock, ...);
    printf("A connection has been accepted\n");
    pid = fork();
  }

There are no limits to runnables/forks. Potentially an attacker could cause resource problems very quickly.


Related Attacks


Related Vulnerabilities

Related Controls

  • Design: Design throttling mechanisms into the system architecture.
  • 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.
  • Implementation: Fail safely when a resource exhaustion occurs.


Related Technical Impacts


References

TBD