COMMON WEAKNESS ENUMERATIONDraft

CWE-776

Improper Restriction of Recursive Entity References in DTDs ('XML Entity Expansion')

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.

Soyutlama

Base

Yapı

Simple

Sömürü İhtimali

Medium

Problemi anla

Problem nedir?

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.

Genişletilmiş açıklama

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.

Terminoloji

Alternatif adlar ve kullanım biçimleri

XEE

XEE is the acronym commonly used for XML Entity Expansion.

Billion Laughs Attack

XML Bomb

While the "XML Bomb" term was used in the early years of knowledge of this issue, the XEE term seems to be more commonly used.

Kök neden

Problem nasıl ve ne zaman oluşur?

Yaşam döngüsü evresi

Implementation

Yaşam döngüsü evresi

Operation

Risk

Başarılı sömürü neye yol açar?

DoS: Resource Consumption (Other)

Etkilenen güvenlik alanları: Availability

If parsed, recursive entity references allow the attacker to expand data exponentially, quickly consuming all system resources.

Savunma

Nasıl önlenir ve çözülür?

Operation

Operasyonel savunma

Detay
If possible, prohibit the use of DTDs or use an XML parser that limits the expansion of recursive DTD entities.

Implementation

Uygulama aşaması savunması

Detay
Before parsing XML files with associated DTDs, scan for recursive entity declarations and do not continue parsing potentially explosive content.

Doğrulama

Nasıl tespit edilir?

Automated Static Analysis

High
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.)