Tag Archives: Improper Restriction of XML External Entity Reference

CWE-611 – Improper Restriction of XML External Entity Reference

Read Time:1 Minute, 36 Second

Description

The software processes an XML document that can contain XML entities with URIs that resolve to documents outside of the intended sphere of control, causing the product to embed incorrect documents into its output.

Modes of Introduction:

– Implementation

 

 

Related Weaknesses

CWE-610
CWE-610
CWE-441

 

Consequences

Confidentiality: Read Application Data, Read Files or Directories

If the attacker is able to include a crafted DTD and a default entity resolver is enabled, the attacker may be able to access arbitrary files on the system.

Integrity: Bypass Protection Mechanism

The DTD may include arbitrary HTTP requests that the server may execute. This could lead to other attacks leveraging the server’s trust relationship with other entities.

Availability: DoS: Resource Consumption (CPU), DoS: Resource Consumption (Memory)

The software could consume excessive CPU cycles or memory using a URI that points to a large file, or a device that always returns data such as /dev/random. Alternately, the URI could reference a file that contains many nested or recursive entity references to further slow down parsing.

 

Potential Mitigations

Phase: Implementation, System Configuration

Description: 

Many XML parsers and validators can be configured to disable external entity expansion.

CVE References

  • CVE-2005-1306
    • A browser control can allow remote attackers to determine the existence of files via Javascript containing XML script.
  • CVE-2012-2239
    • XXE in PHP application allows reading the application’s configuration file.
  • CVE-2012-4399
    • XXE in rapid web application development framework allows reading arbitrary files.
  • CVE-2011-4107
    • XXE in web-based administration tool for database.
  • CVE-2010-3322
    • XXE in product that performs large-scale data analysis.
  • CVE-2009-1699
    • XXE in XSL stylesheet functionality in a common library used by some web browsers.