CAPEC-491: Quadratic Data Expansion |
Description An adversary exploits macro-like substitution to cause a denial of service situation due to excessive memory being allocated to fully expand the data. The result of this denial of service could cause the application to freeze or crash. This involves defining a very large entity and using it multiple times in a single entity substitution. CAPEC-197 is a similar attack pattern, but it is easier to discover and defend against. This attack pattern does not perform multi-level substitution and therefore does not obviously appear to consume extensive resources. Alternate Terms
Term: XML Entity Expansion (XEE)
Execution Flow Explore Survey the target: An adversary determines the input data stream that is being processed by a data parser that supports using substituion on the victim's side. | 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. |
Exploit Craft malicious payload: The adversary crafts malicious message containing nested quadratic expansion that completely uses up available server resource. Send the message: Send the malicious crafted message to the target URL.
Prerequisites
| This type of attack requires a server that accepts serialization data which supports substitution and parses the data. |
Consequences This table specifies different individual consequences associated with the attack pattern. The Scope identifies the security property that is violated, while the Impact describes the negative technical impact that arises if an adversary succeeds in their attack. The Likelihood provides information about how likely the specific consequence is expected to be seen relative to the other consequences in the list. For example, there may be high likelihood that a pattern will be used to achieve a certain impact, but a low likelihood that it will be exploited to achieve a different impact.| Scope | Impact | Likelihood |
|---|
Availability | Unreliable Execution Resource Consumption | |
Mitigations
| Design: Use libraries and templates that minimize unfiltered input. Use methods that limit entity expansion and throw exceptions on attempted entity expansion. |
| Implementation: For XML based data - disable altogether the use of inline DTD schemas when parsing XML objects. If a DTD must be used, normalize, filter and use an allowlist and parse with methods and routines that will detect entity expansion from untrusted sources. |
Example Instances
In this example the attacker defines one large entity and refers to it many times. <?xml version="1.0"?> <!DOCTYPE bomb [<!ENTITY x "AAAAA ... [100K of them] ... AAAA">]> <b><c>&x;&x; ... [100K of them]... &x;&x;</c></b> This results in a relatively small message of 100KBs that will expand to a message in the GB range. |
Content History | Submissions |
|---|
| Submission Date | Submitter | Organization |
|---|
| 2014-06-23 (Version 2.6) | CAPEC Content Team | The MITRE Corporation | | | Modifications |
|---|
| Modification Date | Modifier | Organization |
|---|
| 2017-08-04 (Version 2.11) | CAPEC Content Team | The MITRE Corporation | | Updated Related_Attack_Patterns | | 2019-04-04 (Version 3.1) | CAPEC Content Team | The MITRE Corporation | | Updated Related_Weaknesses | | 2020-07-30 (Version 3.3) | CAPEC Content Team | The MITRE Corporation | | Updated Mitigations | | 2020-12-17 (Version 3.4) | CAPEC Content Team | The MITRE Corporation | | Updated Mitigations, Related_Attack_Patterns | | 2021-10-21 (Version 3.6) | CAPEC Content Team | The MITRE Corporation | | Updated @Name, Alternate_Terms, Consequences, Description, Example_Instances, Execution_Flow, Mitigations, Prerequisites | | 2022-09-29 (Version 3.8) | CAPEC Content Team | The MITRE Corporation | | Updated Example_Instances | | Previous Entry Names |
|---|
| Change Date | Previous Entry Name |
|---|
| 2021-10-21 (Version 3.6) | XML Quadratic Expansion | |
More information is available — Please select a different filter.
|