Dark Mode

Settings

Capec-197 Detail

Exponential Data Expansion

Detailed Software Likelihood: High Typical Severity: Medium

Parents: 230

Threats: T61 T64 T74 T77 T269 T289

Description

An adversary submits data to a target application which contains nested exponential data expansion to produce excessively large output. Many data format languages allow the definition of macro-like structures that can be used to simplify the creation of complex structures. However, this capability can be abused to create excessive demands on a processor's CPU and memory. A small number of nested expansions can result in an exponential growth in demands on memory.

Not present

External ID Source Link Description
CAPEC-197 capec https://capec.mitre.org/data/definitions/197.html
CWE-770 cwe http://cwe.mitre.org/data/definitions/770.html
CWE-776 cwe http://cwe.mitre.org/data/definitions/776.html
44 WASC http://projects.webappsec.org/XML-Entity-Expansion XML Entity Expansion
REF-64 reference_from_CAPEC http://www.securityfocus.com/archive/1/303509 Amit Klein, Multiple vendors XML parser (and SOAP/WebServices server) Denial of Service attack using DTD
REF-65 reference_from_CAPEC http://www.webtorials.com/main/comnet/cn2003/web-service/24.pdf Pete Lindstrom, Attacking & Defending Web Services, 2002, SPiRE Security
REF-66 reference_from_CAPEC http://www.ibm.com/developerworks/xml/library/x-tipcfsx.html Elliotte Rusty Harold, Tip: Configure SAX parsers for secure processing, IBM developerWorks, 2005--05---27, IBM
REF-67 reference_from_CAPEC http://msdn.microsoft.com/en-us/magazine/ee335713.aspx Bryan Sullivan, XML Denial of Service Attacks and Defenses
REF-67 reference_from_CAPEC http://msdn.microsoft.com/en-us/magazine/ee335713.aspx Bryan Sullivan, XML Denial of Service Attacks and Defenses
Explore
  1. Survey the target: An adversary determines the input data stream that is being processed by a data parser that supports using subsitituion on the victim's side.

  2. Techniques
    Use an automated tool to record all instances of URLs to process requests.
    Use a browser to manually explore the website and analyze how the application processes requests.
Experiment
  1. Craft malicious payload: The adversary crafts a malicious message containing nested exponential expansion that completely uses up available server resources. See the "Example Instances" section for details on how to craft this malicious payload.

Exploit
  1. Send the message: Send the malicious crafted message to the target URL.

  1. This type of attack requires that the target must receive input but either fail to provide an upper limit for entity expansion or provide a limit that is so large that it does not preclude significant resource consumption.
  1. None: No specialized resources are required to execute this type of attack.
Low
Ability to craft nested data expansion messages.
Availability
Unreliable Execution (Denial of Service)
Resource Consumption (Denial of Service)
  1. The most common example of this type of attack is the "many laughs" attack (sometimes called the 'billion laughs' attack). For example: ]>&lol9; This is well formed and valid XML according to the DTD. Each entity increases the number entities by a factor of 10. The line of XML containing lol9; expands out exponentially to a message with 10^9 entities. A small message of a few KBs in size can easily be expanded into a few GB of memory in the parser. By including 3 more entities similar to the lol9 entity in the above code to the DTD, the program could expand out over a TB as there will now be 10^12 entities. Depending on the robustness of the target machine, this can lead to resource depletion, application crash, or even the execution of arbitrary code through a buffer overflow.
  2. This example is similar, but uses YAML. This was used to attack Kubernetes [REF-686] a: &a; ["lol","lol","lol","lol","lol","lol","lol","lol","lol"]b: &b; [a,a,a,a,a,a,a,a,a]c: &c; [b,b,b,b,b,b,b,b,b]d: &d; [c,c,c,c,c,c,c,c,c]e: &e; [d,d,d,d,d,d,d,d,d]f: &f; [e,e,e,e,e,e,e,e,e]g: &g; [f,f,f,f,f,f,f,f,f]h: &h; [g,g,g,g,g,g,g,g,g]i: &i; [h,h,h,h,h,h,h,h,h]