Name |
XML Nested Payloads |
|
Likelyhood of attack |
Typical severity |
Medium |
High |
|
Summary |
Applications often need to transform data in and out of the XML format by using an XML parser. It may be possible for an adversary to inject data that may have an adverse effect on the XML parser when it is being processed. By nesting XML data and causing this data to be continuously self-referential, an adversary can cause the XML parser to consume more resources while processing, causing excessive memory consumption and CPU utilization. An adversary's goal is to leverage parser failure to their advantage. In most cases this type of an attack will result in a XML Denial of Service (XDoS) due to an application becoming unstable, freezing, or crashing. However it may be possible to cause a crash resulting in arbitrary code execution, leading to a jump from the data plane to the control plane [REF-89]. XDoS is most closely associated with web services, SOAP, and Rest, because remote service requesters can post malicious XML payloads to the service provider designed to exhaust the service provider's memory, CPU, and/or disk space. The main weakness in XDoS is that the service provider generally must inspect, parse, and validate the XML messages to determine routing, workflow, security considerations, and so on. It is exactly these inspection, parsing, and validation routines that XDoS targets. This attack exploits the loosely coupled nature of web services, where the service provider has little to no control over the service requester and any messages the service requester sends. |
Prerequisites |
An application uses an XML parser to perform transformation on user-controllable data. An application does not perform sufficient validation to ensure that user-controllable data is safe for an XML parser. |
Execution Flow |
Step |
Phase |
Description |
Techniques |
1 |
Explore |
An adversary determines the input data stream that is being processed by an XML parser on the victim's side. |
|
2 |
Experiment |
An adversary crafts input data that may have an adverse effect on the operation of the XML 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 XML parser routine. Ensure that the resultant data is safe to pass to the XML parser. Perform validation on canonical data. Pick a robust implementation of an XML parser. Validate XML against a valid schema or DTD prior to parsing. |
Related Weaknesses |
CWE ID
|
Description
|
CWE-19 |
Data Processing Errors |
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. |
|