CWE-776: Improper Restriction of Recursive Entity References in DTDs ('XML Entity Expansion')

BaseDraftExploit Likelihood: Medium

The product uses XML documents and allows their structure to be defined with a Document Type Definition (DTD), but it does not properly control the number of recursive definitions of entities.

View on MITRE
Back to CWE Lookup

Extended Description

If the DTD contains a large number of nested or recursive entities, this can lead to explosive growth of data when parsed, causing a denial of service.

Technical Details

Structure
Simple

Applicable To

Languages
XML
Platforms

Frequently Asked Questions

What is CWE-776: Improper Restriction of Recursive Entity References in DTDs ('XML Entity Expansion')?+

CWE-776: Improper Restriction of Recursive Entity References in DTDs ('XML Entity Expansion') is a Common Weakness Enumeration (CWE) entry maintained by MITRE. The product uses XML documents and allows their structure to be defined with a Document Type Definition (DTD), but it does not properly control the number of recursive definitions of entities. If the DTD contains a large number of nested or recursive entities, this can lead to explosive growth of data when parsed, causing a denial of service.

What are the security consequences of Improper Restriction of Recursive Entity References in DTDs ('XML Entity Expansion')?+

If exploited, CWE-776 (Improper Restriction of Recursive Entity References in DTDs ('XML Entity Expansion')) it can compromise Availability, leading to outcomes such as DoS: Resource Consumption (Other).

How do you prevent or mitigate Improper Restriction of Recursive Entity References in DTDs ('XML Entity Expansion')?+

Recommended mitigations for CWE-776 include: If possible, prohibit the use of DTDs or use an XML parser that limits the expansion of recursive DTD entities. Before parsing XML files with associated DTDs, scan for recursive entity declarations and do not continue parsing potentially explosive content.

Which programming languages are affected by Improper Restriction of Recursive Entity References in DTDs ('XML Entity Expansion')?+

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

What are real-world examples of Improper Restriction of Recursive Entity References in DTDs ('XML Entity Expansion')?+

MITRE documents real CVEs mapped to CWE-776, including CVE-2008-3281, CVE-2011-3288, CVE-2011-1755, CVE-2009-1955 and CVE-2003-1564. 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-776 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