Improper Control of Document Type Definition

Incomplete Variant
Structure: Simple
Description

This vulnerability occurs when an application fails to properly restrict which Document Type Definitions (DTDs) can be referenced during XML parsing. Attackers can exploit this by injecting references to malicious DTDs, potentially leading to unauthorized file access, server-side request forgery (SSRF), or denial-of-service through resource exhaustion.

Extended Description

When an XML parser processes a DTD, it may automatically retrieve and execute external resources or read local files specified within that DTD. If an attacker controls the DTD reference, they can point the parser to sensitive system files, internal network endpoints, or malicious payloads, effectively using the application's parsing functionality as an attack vector. This is why many modern web standards explicitly forbid DTDs in certain contexts—for instance, the SOAP specification prohibits DTDs within messages. To prevent this, developers must either disable external DTD processing entirely in their XML parser configuration or implement strict allowlists that restrict DTD sources to trusted, intended locations only.

Common Consequences 3
Scope: Confidentiality

Impact: Read Files or Directories

If the attacker is able to include a crafted DTD and a default entity resolver is enabled, the attacker may be able to access arbitrary files on the system.

Scope: Availability

Impact: DoS: Resource Consumption (CPU)DoS: Resource Consumption (Memory)

The DTD may cause the parser to consume excessive CPU cycles or memory using techniques such as nested or recursive entity references (Improper Restriction of Recursive Entity References in DTDs ('XML Entity Expansion')).

Scope: IntegrityConfidentialityAvailabilityAccess Control

Impact: Execute Unauthorized Code or CommandsGain Privileges or Assume Identity

The DTD may include arbitrary HTTP requests that the server may execute. This could lead to other attacks leveraging the server's trust relationship with other entities.

Observed Examples 1
CVE-2010-2076Product does not properly reject DTDs in SOAP messages, which allows remote attackers to read arbitrary files, send HTTP requests to intranet servers, or cause a denial of service.
References 1
Apache CXF Security Advisory (CVE-2010-2076)
Daniel Kulp
16-06-2010
ID: REF-773