背景の詳細
導入モード
Implementation : REALIZATION: This weakness is caused during implementation of an architectural security tactic.
適用可能なプラットフォーム
言語
クラス: Not Language-Specific (Undetermined)
名前: XML (Undetermined)
テクノロジー
クラス: Not Technology-Specific (Undetermined)
クラス: Web Based (Undetermined)
一般的な結果
| スコープ |
影響 |
可能性 |
| 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. 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. 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. | |
| Integrity | Bypass Protection Mechanism
注記:An attacker may supply a crafted DTD using URIs with schemes such as http://, forcing the application to make outgoing HTTP requests to servers that the attacker cannot reach directly, which can be used to bypass firewall restrictions; hide the source of attacks such as port scanning; or otherwise leverage the server's trust relationship with other entities. | |
| Availability | DoS: Resource Consumption (CPU), DoS: Resource Consumption (Memory)
注記: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. | |
観察された例
| 参考文献 |
説明 |
| Recruiter software allows reading arbitrary files using XXE |
| A browser control can allow remote attackers to determine the existence of files via Javascript containing XML script. |
| XXE during SVG image conversion |
| XXE in PHP application allows reading the application's configuration file. |
| XXE in database server |
| XXE in rapid web application development framework allows reading arbitrary files. |
| XXE via XML-RPC request. |
| XXE in office document product using RDF. |
| XXE in web-based administration tool for database. |
| XXE in product that performs large-scale data analysis. |
| XXE in XSL stylesheet functionality in a common library used by some web browsers. |
潜在的な緩和策
Phases : Implementation // System Configuration
Many XML parsers and validators can be configured to disable external entity expansion.
検出方法
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.)
有効性 : High
脆弱性マッピングノート
理由 : This CWE entry is at the Base level of abstraction, which is a preferred level of abstraction for mapping to the root causes of vulnerabilities.
コメント : Carefully read both the name and description to ensure that this mapping is an appropriate fit. Do not try to 'force' a mapping to a lower-level Base/Variant simply to comply with this preferred level of abstraction.
関連する攻撃パターン
| CAPEC ID |
攻撃パターン名 |
| 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. |
ノート
CWE-918 (SSRF) and CWE-611 (XXE) are closely related, because they both involve web-related technologies and can launch outbound requests to unexpected destinations. However, XXE can be performed client-side, or in other contexts in which the software is not acting directly as a server, so the "Server" portion of the SSRF acronym does not necessarily apply.
参考文献
REF-496
XML External Entity (XXE) Processing
OWASP.
https://www.owasp.org/index.php/XML_External_Entity_(XXE)_Processing REF-497
XML External Entity Attacks (XXE)
Sascha Herzog.
https://mohemiv.com/files/XML_Exteral_Entity_Attack.pdf REF-498
XXE (Xml eXternal Entity) Attack
Gregory Steuck.
https://seclists.org/bugtraq/2002/Oct/420/ REF-499
XML External Entities (XXE) Attack
WASC.
http://projects.webappsec.org/w/page/13247003/XML%20External%20Entities REF-500
XML Denial of Service Attacks and Defenses
Bryan Sullivan.
https://learn.microsoft.com/en-us/archive/msdn-magazine/2009/november/xml-denial-of-service-attacks-and-defenses REF-501
Preventing XXE in PHP
Chris Cornutt.
https://websec.io/2012/08/27/Preventing-XXE-in-PHP.html REF-1534
Automated Technical Debt Measure, Version 2
OMG.
https://www.omg.org/spec/ATDM2/1.0/PDF
登録情報
| 名前 |
組織 |
日付 |
リリース日 |
Version |
| Anonymous Tool Vendor (under NDA) |
|
2007-05-07 +00:00 |
2007-05-07 +00:00 |
Draft 6 |
変更履歴
| 名前 |
組織 |
日付 |
コメント |
| Eric Dalci |
Cigital |
2008-07-01 +00:00 |
updated Time_of_Introduction |
| CWE Content Team |
MITRE |
2008-09-08 +00:00 |
updated Description, Relationships, Observed_Example, Other_Notes, Taxonomy_Mappings |
| CWE Content Team |
MITRE |
2010-02-16 +00:00 |
updated Taxonomy_Mappings |
| CWE Content Team |
MITRE |
2010-09-27 +00:00 |
updated Background_Details, Other_Notes |
| CWE Content Team |
MITRE |
2011-03-29 +00:00 |
updated Name |
| CWE Content Team |
MITRE |
2011-06-01 +00:00 |
updated Common_Consequences |
| CWE Content Team |
MITRE |
2012-05-11 +00:00 |
updated Relationships |
| CWE Content Team |
MITRE |
2013-02-21 +00:00 |
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 |
2014-07-30 +00:00 |
updated Relationships, Taxonomy_Mappings |
| CWE Content Team |
MITRE |
2015-12-07 +00:00 |
updated Relationships |
| CWE Content Team |
MITRE |
2017-11-08 +00:00 |
updated Modes_of_Introduction, References, Relationships, Relevant_Properties |
| CWE Content Team |
MITRE |
2018-03-27 +00:00 |
updated Relationships |
| CWE Content Team |
MITRE |
2019-01-03 +00:00 |
updated Related_Attack_Patterns |
| CWE Content Team |
MITRE |
2019-06-20 +00:00 |
updated Name, Type |
| CWE Content Team |
MITRE |
2019-09-19 +00:00 |
updated Relationships |
| CWE Content Team |
MITRE |
2020-02-24 +00:00 |
updated Applicable_Platforms, Relationships |
| CWE Content Team |
MITRE |
2020-08-20 +00:00 |
updated Relationships |
| CWE Content Team |
MITRE |
2020-12-10 +00:00 |
updated Relationships |
| CWE Content Team |
MITRE |
2021-07-20 +00:00 |
updated Relationships |
| CWE Content Team |
MITRE |
2021-10-28 +00:00 |
updated Relationships |
| CWE Content Team |
MITRE |
2022-06-28 +00:00 |
updated Relationships |
| CWE Content Team |
MITRE |
2023-01-31 +00:00 |
updated Alternate_Terms, Common_Consequences, Description |
| CWE Content Team |
MITRE |
2023-04-27 +00:00 |
updated Detection_Factors, References, Relationships |
| CWE Content Team |
MITRE |
2023-06-29 +00:00 |
updated Mapping_Notes |
| CWE Content Team |
MITRE |
2023-10-26 +00:00 |
updated Observed_Examples |
| CWE Content Team |
MITRE |
2025-09-09 +00:00 |
updated References |
| CWE Content Team |
MITRE |
2025-12-11 +00:00 |
updated Applicable_Platforms, Background_Details, Common_Consequences, Description, Diagram, Relationships, Weakness_Ordinalities |
| CWE Content Team |
MITRE |
2026-10-28 +00:00 |
updated References |