CWE-827: Improper Control of Document Type Definition

VariantIncomplete

The product does not restrict a reference to a Document Type Definition (DTD) to the intended control sphere. This might allow attackers to reference arbitrary DTDs, possibly causing the product to expose files, consume excessive system resources, or execute arbitrary http requests on behalf of the attacker.

View on MITRE
Back to CWE Lookup

Extended Description

As DTDs are processed, they might try to read or include files on the machine performing the parsing. If an attacker is able to control the DTD, then the attacker might be able to specify sensitive resources or requests or provide malicious content. For example, the SOAP specification prohibits SOAP messages from containing DTDs.

Technical Details

Structure
Simple

Applicable To

Languages
XML
Platforms

Frequently Asked Questions

What is CWE-827: Improper Control of Document Type Definition?+

CWE-827: Improper Control of Document Type Definition is a Common Weakness Enumeration (CWE) entry maintained by MITRE. The product does not restrict a reference to a Document Type Definition (DTD) to the intended control sphere. This might allow attackers to reference arbitrary DTDs, possibly causing the product to expose files, consume excessive system resources, or execute arbitrary http requests on behalf of the attacker. As DTDs are processed, they might try to read or include files on the machine performing the parsing. If an attacker is able to control the DTD, then the attacker might be able to specify sensitive resources or requests or provide malicious content. For example, the SOAP specification prohibits SOAP messages from containing DTDs.

What are the security consequences of Improper Control of Document Type Definition?+

If exploited, CWE-827 (Improper Control of Document Type Definition) it can compromise Confidentiality, Availability, Integrity and Access Control, leading to outcomes such as Read Files or Directories, DoS: Resource Consumption (CPU), DoS: Resource Consumption (Memory), Execute Unauthorized Code or Commands and Gain Privileges or Assume Identity.

Which programming languages are affected by Improper Control of Document Type Definition?+

CWE-827 commonly affects XML. Note that weaknesses are often language-agnostic patterns, so secure coding practices apply broadly.

What are real-world examples of Improper Control of Document Type Definition?+

MITRE documents real CVEs mapped to CWE-827, including CVE-2010-2076. You can look up the full details of each CVE, including CVSS scores and remediation guidance, on our CVE Lookup tool.

What is the difference between a CWE and a CVE?+

A CWE (Common Weakness Enumeration) like CWE-827 describes a category of software weakness — the underlying flaw type. A CVE (Common Vulnerabilities and Exposures) identifies a specific, real-world vulnerability in a particular product. In short, a CWE is the kind of mistake, and a CVE is an instance of that mistake being found in software.

Learn More