CWEweakness

CWE-776 Improper Restriction of Recursive Entity References in DTDs

Medium Official page ↗
Alternate terms
XEE, Billion Laughs Attack, XML Bomb
Abstraction
Base
Structure
Simple
Status
Draft
Likelihood of exploit
Medium
Languages
Not Language-Specific, XML
CWE version
5.0

Description

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.

Common consequences

• Availability: DoS: Resource Consumption (Other) — If the DTD contains a large number of nested or recursive entities, this allows the attacker to expand data exponentially when the DTD is parsed, quickly consuming all system resources.

Potential mitigations

• [Operation] If possible, prohibit the use of DTDs or use an XML parser that limits the expansion of recursive DTD entities. • [Implementation] Before parsing XML files with associated DTDs, scan for recursive entity declarations and do not continue parsing potentially explosive content.

Detection methods

• Automated Static Analysis: Automated static analysis, commonly referred to as Static Application Security Testing (SAST), can find some instances of this weakness by analyzing source code (or binary/compiled code) without having to execute it. Typically, this is done by building a model of data flow and control flow, then searching for potentially-vulnerable patterns that connect "sources" (origins of input) with "sinks" (destinations where the data interacts with external components, a lower layer such as the OS, etc.)

Observed examples

• CVE-2008-3281: XEE in XML-parsing library. • CVE-2011-3288: XML bomb / XEE in enterprise communication product. • CVE-2011-1755: "Billion laughs" attack in XMPP server daemon. • CVE-2009-1955: XML bomb in web server module • CVE-2003-1564: Parsing library allows XML bomb

Related

Attack pattern · CAPEC (1)

  • CAPEC-197 Exponential Data Expansion attack pattern

Observed example · CVE (5)

  • CVE-2011-3288 Cisco Unified Presence before 8.5(4) does not properly detect recursion during entity expansion, which allows remote attackers to cause a… vulnerability
  • CVE-2011-1755 jabberd2 before 2.2.14 does not properly detect recursion during entity expansion, which allows remote attackers to cause a denial of… vulnerability
  • CVE-2009-1955 The expat XML parser in the apr_xml_* interface in xml/apr_xml.c in Apache APR-util before 1.3.7, as used in the mod_dav and mod_dav_svn… vulnerability
  • CVE-2008-3281 libxml2 2.6.32 and earlier does not properly detect recursion during entity expansion in an attribute value, which allows context-dependent… vulnerability
  • CVE-2003-1564 libxml2, possibly before 2.5.0, does not properly detect recursion during entity expansion, which allows context-dependent attackers to… vulnerability

Child of · CWE (2)

  • CWE-405 Asymmetric Resource Consumption (Amplification) weakness
  • CWE-674 Uncontrolled Recursion weakness

Referenced by CAPEC · weakness (1)

  • CAPEC-197 Exponential Data Expansion attack pattern

Referenced by CVE · weakness (101)

  • CVE-2026-108357 PhpSpreadsheet is a pure PHP library for reading and writing spreadsheet files. vulnerability
  • CVE-2026-108358 PhpSpreadsheet is a pure PHP library for reading and writing spreadsheet files. vulnerability
  • CVE-2026-115506 libexpat through 2.9.0 contains a denial of service vulnerability because billion laughs protection in accountingDiffTolerated() in… vulnerability
  • CVE-2026-108086 ** UNSUPPORTED WHEN ASSIGNED ** Improper restriction of recursive entity references in DTDs ('XML entity expansion') vulnerability in… vulnerability
  • CVE-2026-111252 A denial of service vulnerability exists in the XML parsing of multiple versions of OpenNMS Meridian and Horizon. vulnerability
  • CVE-2026-74030 Wazuh from 3.9.0 before 4.14.8 contains an uncontrolled YAML alias expansion vulnerability in yaml2json_node that allows a… vulnerability
  • CVE-2026-108039 By default, StaxUtils placed no limit on the total number of elements or the total number of characters in an XML document. vulnerability
  • CVE-2026-92001 Improper restriction of recursive entity references in DTDs ('XML entity expansion') vulnerability in Apache Sling XSS. vulnerability
  • CVE-2026-54077 ArcadeDB is a Multi-Model DBMS. vulnerability
  • CVE-2023-46035 The svg_optimizer gem before 0.3.0 for Ruby performs entity expansion on untrusted documents. vulnerability
  • CVE-2026-58234 SAP Process Integration (SOAP Adapter) allows a privileged user to send specially crafted requests containing deeply nested entity… vulnerability
  • CVE-2026-16180 IBM App Connect Enterprise 13.0.1.0 through 13.0.8.1, and 12.0.1.0 through 12.0.12.28 and IBM Integration Bus for z/OS 10.1.0.0 through… vulnerability
  • CVE-2026-78681 NLTK versions before 3.10.3 use xml.etree.ElementTree to parse XML in multiple modules, which honors entity declarations in document DTDs. vulnerability
  • CVE-2026-73569 fast-xml-parser allows users to process XML from JS object without C/C++ based libraries or callbacks. vulnerability
  • CVE-2026-3415 The XML and schema validation functionalities within the SchemaValidator Mediator process XML input as part of validation flows. vulnerability
  • CVE-2026-14865 In Progress® Telerik® UI for AJAX prior to v2026.2.708, the internal LayoutBuilder control processes client-state XML without disabling DTD… vulnerability
  • CVE-2026-14979 IBM Engineering Lifecycle Management 7.0.3 ( Interim Fix 001 through ) Interim Fix 021, 7.1.0 ( Interim Fix 001 through ) Interim Fix 009,… vulnerability
  • CVE-2026-45133 Symfony is a PHP framework for web and console applications and a set of reusable PHP components. vulnerability
  • CVE-2026-45304 Symfony is a PHP framework for web and console applications and a set of reusable PHP components. vulnerability
  • CVE-2026-12993 A flaw was found in Apicurio Registry. vulnerability
  • CVE-2026-44018 Docling simplifies document processing by parsing diverse formats and providing integrations with the generative AI ecosystem. vulnerability
  • CVE-2026-44020 Docling simplifies document processing by parsing diverse formats and providing integrations with the generative AI ecosystem. vulnerability
  • CVE-2026-45771 FreeSWITCH is a Software Defined Telecom Stack enabling the digital transformation from proprietary telecom switches to a software… vulnerability
  • CVE-2026-23822 A vulnerability in the XML handling component of AOS-8 DHCP services could allow an unauthenticated remote attacker to trigger a… vulnerability
  • CVE-2026-31248 Docling's METS GBS backend is vulnerable to XML Entity Expansion (XXE) attacks thru 2.61.0. vulnerability
  • CVE-2026-42212 SolidCAM-GPPL-IDE is an unofficial, independently developed extension, Postprocessor IDE for SolidCAM. vulnerability
  • CVE-2026-41673 xmldom is a pure JavaScript W3C standard-based (XML DOM Level 2 Core) `DOMParser` and `XMLSerializer` module. vulnerability
  • CVE-2026-40260 pypdf is a free and open-source pure-python PDF library. vulnerability
  • CVE-2026-26171 Uncontrolled resource consumption in .NET allows an unauthorized attacker to deny service over a network. vulnerability
  • CVE-2026-33116 Loop with unreachable exit condition ('infinite loop') in .NET, .NET Framework, Visual Studio allows an unauthorized attacker to deny… vulnerability
Show all 101 ›

Referenced by CWE · can precede (1)

  • CWE-827 Improper Control of Document Type Definition weakness

Referenced by OWASP · mapped cwe (2)

  • A02:2025 Security Misconfiguration Top 10 2025
  • A05:2021 Security Misconfiguration Top 10 2021