Name |
Serialized Data with Nested Payloads |
|
Likelyhood of attack |
Typical severity |
Medium |
High |
|
Summary |
Applications often need to transform data in and out of a data format (e.g., XML and YAML) by using a parser. It may be possible for an adversary to inject data that may have an adverse effect on the parser when it is being processed. Many data format languages allow the definition of macro-like structures that can be used to simplify the creation of complex structures. By nesting these structures, causing the data to be repeatedly substituted, an adversary can cause the parser to consume more resources while processing, causing excessive memory consumption and CPU utilization. |
Prerequisites |
An application's user-controllable data is expressed in a language that supports subsitution. An application does not perform sufficient validation to ensure that user-controllable data is not malicious. |
Execution Flow |
Step |
Phase |
Description |
Techniques |
1 |
Explore |
An adversary determines the input data stream that is being processed by a data parser that supports using substitution on the victim's side. |
|
2 |
Exploit |
An adversary crafts input data that may have an adverse effect on the operation of the parser when the data is parsed on the victim's system. |
|
|
Solutions | Carefully validate and sanitize all user-controllable data prior to passing it to the data parser routine. Ensure that the resultant data is safe to pass to the data parser. Perform validation on canonical data. Pick a robust implementation of the data parser. |
Related Weaknesses |
CWE ID
|
Description
|
CWE-20 |
Improper Input Validation |
CWE-112 |
Missing XML Validation |
CWE-674 |
Uncontrolled Recursion |
CWE-770 |
Allocation of Resources Without Limits or Throttling |
|
Related CAPECS |
CAPEC ID
|
Description
|
CAPEC-130 |
An adversary causes the target to allocate excessive resources to servicing the attackers' request, thereby reducing the resources available for legitimate services and degrading or denying services. Usually, this attack focuses on memory allocation, but any finite resource on the target could be the attacked, including bandwidth, processing cycles, or other resources. This attack does not attempt to force this allocation through a large number of requests (that would be Resource Depletion through Flooding) but instead uses one or a small number of requests that are carefully formatted to force the target to allocate excessive resources to service this request(s). Often this attack takes advantage of a bug in the target to cause the target to allocate resources vastly beyond what would be needed for a normal request. |
|