XML documents optionally contain a Document Type Definition (DTD), which, among other features, enables the definition of XML entities. It is possible to define an entity by providing a substitution string in the form of a URI. The XML parser can access the contents of this URI and embed these contents back into the XML document for further processing.
By submitting an XML file that defines an external entity with a file:// URI, an attacker can cause the processing application to read the contents of a local file. For example, a URI such as "file:///c:/winnt/win.ini" designates (in Windows) the file C:\Winnt\win.ini, or file:///etc/passwd designates the password file in Unix-based systems. Using URIs with other schemes such as http://, the attacker can force the application to make outgoing requests to servers that the attacker cannot reach directly, which can be used to bypass firewall restrictions or hide the source of attacks such as port scanning.
Once the content of the URI is read, it is fed back into the application that is processing the XML. This application may echo back the data (e.g. in an error message), thereby exposing the file contents.
Portée | Impact | Probabilité |
---|---|---|
Confidentiality | Read Application Data, Read Files or Directories Note: 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 Note: 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) Note: The product 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. |
Références | Description |
---|---|
CVE-2022-42745 | Recruiter software allows reading arbitrary files using XXE |
CVE-2005-1306 | A browser control can allow remote attackers to determine the existence of files via Javascript containing XML script. |
CVE-2012-5656 | XXE during SVG image conversion |
CVE-2012-2239 | XXE in PHP application allows reading the application's configuration file. |
CVE-2012-3489 | XXE in database server |
CVE-2012-4399 | XXE in rapid web application development framework allows reading arbitrary files. |
CVE-2012-3363 | XXE via XML-RPC request. |
CVE-2012-0037 | XXE in office document product using RDF. |
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. |
CAPEC-ID | Nom du modèle d'attaque |
---|---|
CAPEC-221 | Data Serialization External Entities Blowup This attack takes advantage of the entity replacement property of certain data serialization languages (e.g., XML, YAML, etc.) where the value of the replacement is a URI. A well-crafted file could have the entity refer to a URI that consumes a large amount of resources to create a denial of service condition. This can cause the system to either freeze, crash, or execute arbitrary code depending on the URI. |
Nom | Organisation | Date | Date de publication | Version |
---|---|---|---|---|
Anonymous Tool Vendor (under NDA) | Draft 6 |
Nom | Organisation | Date | Commentaire |
---|---|---|---|
Eric Dalci | Cigital | updated Time_of_Introduction | |
CWE Content Team | MITRE | updated Description, Relationships, Observed_Example, Other_Notes, Taxonomy_Mappings | |
CWE Content Team | MITRE | updated Taxonomy_Mappings | |
CWE Content Team | MITRE | updated Background_Details, Other_Notes | |
CWE Content Team | MITRE | updated Name | |
CWE Content Team | MITRE | updated Common_Consequences | |
CWE Content Team | MITRE | updated Relationships | |
CWE Content Team | MITRE | updated Alternate_Terms, Applicable_Platforms, Background_Details, Common_Consequences, Description, Name, Observed_Examples, Potential_Mitigations, References, Relationship_Notes, Relationships, Taxonomy_Mappings | |
CWE Content Team | MITRE | updated Relationships, Taxonomy_Mappings | |
CWE Content Team | MITRE | updated Relationships | |
CWE Content Team | MITRE | updated Modes_of_Introduction, References, Relationships, Relevant_Properties | |
CWE Content Team | MITRE | updated Relationships | |
CWE Content Team | MITRE | updated Related_Attack_Patterns | |
CWE Content Team | MITRE | updated Name, Type | |
CWE Content Team | MITRE | updated Relationships | |
CWE Content Team | MITRE | updated Applicable_Platforms, Relationships | |
CWE Content Team | MITRE | updated Relationships | |
CWE Content Team | MITRE | updated Relationships | |
CWE Content Team | MITRE | updated Relationships | |
CWE Content Team | MITRE | updated Relationships | |
CWE Content Team | MITRE | updated Relationships | |
CWE Content Team | MITRE | updated Alternate_Terms, Common_Consequences, Description | |
CWE Content Team | MITRE | updated Detection_Factors, References, Relationships | |
CWE Content Team | MITRE | updated Mapping_Notes | |
CWE Content Team | MITRE | updated Observed_Examples |