CAPEC-228 Metadata
Likelihood of Attack
High
Typical Severity
Medium
Overview
Summary
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.
Prerequisites
The target must be running an XML based application that leverages DTDs.
Execution Flow
Step | Phase | Description | Techniques |
---|---|---|---|
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] |
|
Potential Solutions / 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 Weaknesses (CWE)
CWE ID | Description |
---|---|
CWE-829 | Inclusion of Functionality from Untrusted Control Sphere |
Related CAPECs
CAPEC ID | Description |
---|---|
CAPEC-197 | An adversary submits data to a target application which contains nested exponential data expansion to produce excessively large output. Many data format languages allow the definition of macro-like structures that can be used to simplify the creation of complex structures. However, this capability can be abused to create excessive demands on a processor's CPU and memory. A small number of nested expansions can result in an exponential growth in demands on memory. |
CAPEC-250 | An attacker utilizes crafted XML user-controllable input to probe, attack, and inject data into the XML database, using techniques similar to SQL injection. The user-controllable input can allow for unauthorized viewing of data, bypassing authentication or the front-end application for direct XML database access, and possibly altering database information. |
CAPEC-491 | 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. |
Stay Ahead of Attack Patterns
Understanding CAPEC patterns helps security professionals anticipate and thwart potential attacks. Leverage these insights to enhance threat modeling, strengthen your software development lifecycle, and train your security teams effectively.