CAPECattack pattern

CAPEC-228 DTD Injection

Medium Official page ↗
Abstraction
Detailed
Status
Draft
Typical severity
Medium
CAPEC version
3.9

Description

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

1. [Explore] [Survey the target] Using a browser or an automated tool, an attacker records all instances of web services to process XML requests. 2. [Explore] [Determine use of XML with DTDs] Examine application input to identify XML input that leverage the use of one or more DTDs. 3. [Exploit] [Craft and inject XML containg malicious DTD payload]

Prerequisites

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

Mitigations

• Design: Sanitize incoming DTDs to prevent excessive expansion or other actions that could result in impacts like resource depletion. • Implementation: Disallow the inclusion of DTDs as part of incoming messages. • Implementation: Use XML parsing tools that protect against DTD attacks.

Related

Can precede · CAPEC (2)

  • CAPEC-197 Exponential Data Expansion attack pattern
  • CAPEC-491 Quadratic Data Expansion attack pattern

Child of · CAPEC (1)

Weakness · CWE (1)

  • CWE-829 Inclusion of Functionality from Untrusted Control Sphere weakness

Referenced by CAPEC · can precede (1)

Referenced by CWE · attack pattern (1)

  • CWE-829 Inclusion of Functionality from Untrusted Control Sphere weakness