COMMON ATTACK PATTERN ENUMERATION AND CLASSIFICATIONLive MITRE record

CAPEC-228

DTD Injection

An attacker injects malicious content into an application's DTD in an attempt to produce a negative technical impact. DTDs are used to describe how XML documents are processed. Certain malformed DTDs (for example, those with excessive entity expansion as described in CAPEC 197) can cause the XML parsers that process the DTDs to consume excessive resources resulting in resource depletion.

Abstraction

Detailed

Typical severity

Medium

Likelihood of attack

Medium

Understand the attack

What is this attack pattern?

An attacker injects malicious content into an application's DTD in an attempt to produce a negative technical impact. DTDs are used to describe how XML documents are processed. Certain malformed DTDs (for example, those with excessive entity expansion as described in CAPEC 197) can cause the XML parsers that process the DTDs to consume excessive resources resulting in resource depletion.

Execution flow

How does the attack proceed, step by step?

1

Explore

Survey the target

Using a browser or an automated tool, an attacker records all instances of web services to process XML requests.

Techniques used

  • Use an automated tool to record all instances of URLs to process XML requests.
  • Use a browser to manually explore the website and analyze how the application processes XML requests.

Determine use of XML with DTDs

Examine application input to identify XML input that leverage the use of one or more DTDs.

Techniques used

  • Examine any available documentation for the application that discusses expected XML input.
  • Exercise the application using XML input with and without a DTD specified. Failure without DTD likely indicates use of DTD.
2

Exploit

Craft and inject XML containg malicious DTD payload

Techniques used

  • Inject XML expansion attack that creates a Denial of Service impact on the targeted server using its DTD.
  • Inject XML External Entity (XEE) attack that can cause the disclosure of confidential information, execute abitrary code, create a Denial of Service of the targeted server, or several other malicious impacts.

Requirements

What does the attack require?

Prerequisites

  • The target must be running an XML based application that leverages DTDs.

Skills required

Not stated in the MITRE record.

Resources required

Not stated in the MITRE record.

Defence

How is it prevented and mitigated?

1
Design: Sanitize incoming DTDs to prevent excessive expansion or other actions that could result in impacts like resource depletion.
2
Implementation: Disallow the inclusion of DTDs as part of incoming messages.
3
Implementation: Use XML parsing tools that protect against DTD attacks.
CAPEC-228: DTD Injection — DayBreach Saldırı Sözlüğü · DayBreach