[Forgot Password]
Login  Register Subscribe

30430

 
 

423868

 
 

247621

 
 

909

 
 

194512

 
 

282

Paid content will be excluded from the download.


Download | Alert*
CWE
view XML

Unrestricted Recursive Entity References in DTDs ('XML Bomb')

ID: 776Date: (C)2012-05-14   (M)2022-10-10
Type: weaknessStatus: DRAFT
Abstraction Type: Variant





Description

The software requires the use of XML documents and allows their structure to be defined with a Document Type Definition (DTD). The software allows the DTD to recursively define entities which can lead to explosive growth of data when parsed.

Likelihood of Exploit: Low to Medium

Applicable Platforms
Language: XML

Time Of Introduction

  • Implementation
  • Operation

Common Consequences

ScopeTechnical ImpactNotes
Availability
 
DoS: resource consumption (other)
 
If parsed, recursive entity references allow the attacker to expand data exponentially, quickly consuming all system resources.
 

Detection Methods
None

Potential Mitigations

PhaseStrategyDescriptionEffectivenessNotes
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.
 
  

Relationships

Related CWETypeViewChain
CWE-776 ChildOf CWE-409 Weakness CWE-1000
CWE-699 
 

Demonstrative Examples   (Details)

  1. The DTD and the very brief XML below illustrate what is meant by an XML bomb. The ZERO entity contains one character, the letter A. The choice of entity name ZERO is being used to indicate length equivalent to that exponent on two, that is, the length of ZERO is 2^0. Similarly, ONE refers to ZERO twice, therefore the XML parser will expand ONE to a length of 2, or 2^1. Ultimately, we reach entity THIRTYTWO, which will expand to 2^32 characters in length, or 4 GB, probably consuming far more data than expected. (Demonstrative Example Id DX-53)

Observed Examples

  1. CVE-2009-1955 : XML bomb in web server module
  2. CVE-2003-1564 : Parsing library allows XML bomb

For more examples, refer to CVE relations in the bottom box.

White Box Definitions
None

Black Box Definitions
None

Taxynomy Mappings

TaxynomyIdNameFit
WASC 44
 
XML Entity Expansion
 
 

References:

  1. Amit Klein .Multiple vendors XML parser (and SOAP/WebServices server) Denial of Service attack using DTD. 2002-12-16.
  2. Rami Jaamour .XML security: Preventing XML bombs. 2006-02-22.
  3. Didier Stevens .Dismantling an XML-Bomb. 2008-09-23.
  4. Robert Auger .XML Entity Expansion.
  5. Elliotte Rusty Harold .Tip: Configure SAX parsers for secure processing. 2005-05-27.
  6. ..
CVE    40
CVE-2014-2228
CVE-2013-4335
CVE-2013-6461
CVE-2013-6460
...

© SecPod Technologies