COMMON ATTACK PATTERN ENUMERATION AND CLASSIFICATIONLive MITRE record

CAPEC-491

Quadratic Data Expansion

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.

Abstraction

Detailed

Typical severity

High

Likelihood of attack

Medium

Understand the attack

What is this attack pattern?

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.

Execution flow

How does the attack proceed, step by step?

1

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 used

  • 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.
2

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.

Requirements

What does the attack require?

Prerequisites

  • This type of attack requires a server that accepts serialization data which supports substitution and parses the data.

Skills required

Not stated in the MITRE record.

Resources required

Not stated in the MITRE record.

Impact

What does a successful attack lead to?

Unreliable ExecutionResource Consumption

Affected scopes: Availability

Defence

How is it prevented and mitigated?

1
Design: Use libraries and templates that minimize unfiltered input. Use methods that limit entity expansion and throw exceptions on attempted entity expansion.
2
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.

Real world

MITRE example instances

Example instance 1Detail
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.
CAPEC-491: Quadratic Data Expansion — DayBreach Saldırı Sözlüğü · DayBreach