This site is the archived OWASP Foundation Wiki and is no longer accepting Account Requests.
To view the new OWASP Foundation website, please visit https://owasp.org
Difference between revisions of "Top 10-2017 A4-XML External Entities (XXE)"
(Prepare OWASP Top 10-2017 Release (Content)) |
m (Editorial changes e.g. line feeds, added a link) |
||
Line 24: | Line 24: | ||
<td colspan=2 {{Template:Top_10_2010:SummaryTableRowStyleTemplate|year=2017}}> | <td colspan=2 {{Template:Top_10_2010:SummaryTableRowStyleTemplate|year=2017}}> | ||
<!--- Security Weakness: ---> | <!--- Security Weakness: ---> | ||
− | By default, many older XML processors allow specification of an external entity, a URI that is dereferenced and evaluated during XML processing. <u>[[Source_Code_Analysis_Tools|SAST]]</u> tools can discover this issue by inspecting dependencies and configuration. <u>[[:Category:Vulnerability_Scanning_Tools|DAST]]</u> tools require additional manual steps to detect and exploit this issue. Manual testers need to be trained in how to test for XXE, as it not commonly tested as of 2017. </td> | + | By default, many older XML processors allow specification of an external entity, a URI that is dereferenced and evaluated during XML processing.<br/><u>[[Source_Code_Analysis_Tools|SAST]]</u> tools can discover this issue by inspecting dependencies and configuration. <u>[[:Category:Vulnerability_Scanning_Tools|DAST]]</u> tools require additional manual steps to detect and exploit this issue. Manual testers need to be trained in how to test for XXE, as it not commonly tested as of 2017. </td> |
<td colspan=2 {{Template:Top_10_2010:SummaryTableRowStyleTemplate|year=2017}}> | <td colspan=2 {{Template:Top_10_2010:SummaryTableRowStyleTemplate|year=2017}}> | ||
<!--- Impacts: ---> | <!--- Impacts: ---> | ||
− | These flaws can be used to extract data, execute a remote request from the server, scan internal systems, perform a denial-of-service attack, as well as execute other attacks. </td> | + | These flaws can be used to extract data, execute a remote request from the server, scan internal systems, perform a denial-of-service attack, as well as execute other attacks.<br/>The business impact depends on the protection needs of all affected application and data.</td> |
{{Top_10_2010:SummaryTableEndTemplate|year=2017}} | {{Top_10_2010:SummaryTableEndTemplate|year=2017}} | ||
Line 46: | Line 46: | ||
* Implement positive ("whitelisting") server-side input validation, filtering, or sanitization to prevent hostile data within XML documents, headers, or nodes. | * Implement positive ("whitelisting") server-side input validation, filtering, or sanitization to prevent hostile data within XML documents, headers, or nodes. | ||
* Verify that XML or XSL file upload functionality validates incoming XML using XSD validation or similar. | * Verify that XML or XSL file upload functionality validates incoming XML using XSD validation or similar. | ||
− | * SAST tools can help detect XXE in source code, although manual code review is the best alternative in large, complex applications with many integrations. | + | * <u>[[Source_Code_Analysis_Tools|SAST]]</u> tools can help detect XXE in source code, although manual code review is the best alternative in large, complex applications with many integrations. |
If these controls are not possible, consider using virtual patching, API security gateways, or Web Application Firewalls (WAFs) to detect, monitor, and block XXE attacks. | If these controls are not possible, consider using virtual patching, API security gateways, or Web Application Firewalls (WAFs) to detect, monitor, and block XXE attacks. | ||
Latest revision as of 16:35, 1 January 2018
Threat Agents / Attack Vectors | Security Weakness | Impacts | |||
---|---|---|---|---|---|
App Specific | Exploitability: 2 |
Prevalence: 2 |
Detectability: 3 |
Technical: 3 |
Business ? |
Attackers can exploit vulnerable XML processors if they can upload XML or include hostile content in an XML document, exploiting vulnerable code, dependencies or integrations. |
By default, many older XML processors allow specification of an external entity, a URI that is dereferenced and evaluated during XML processing. SAST tools can discover this issue by inspecting dependencies and configuration. DAST tools require additional manual steps to detect and exploit this issue. Manual testers need to be trained in how to test for XXE, as it not commonly tested as of 2017. |
These flaws can be used to extract data, execute a remote request from the server, scan internal systems, perform a denial-of-service attack, as well as execute other attacks. The business impact depends on the protection needs of all affected application and data. |
Is the Application Vulnerable?
Applications and in particular XML-based web services or downstream integrations might be vulnerable to attack if:
|
How to Prevent
Developer training is essential to identify and mitigate XXE. Besides that, preventing XXE requires:
If these controls are not possible, consider using virtual patching, API security gateways, or Web Application Firewalls (WAFs) to detect, monitor, and block XXE attacks. |
Example Attack Scenarios
Numerous public XXE issues have been discovered, including attacking embedded devices. XXE occurs in a lot of unexpected places, including deeply nested dependencies. The easiest way is to upload a malicious XML file, if accepted: Scenario #1: The attacker attempts to extract data from the server: <?xml version="1.0" encoding="ISO-8859-1"?>
Scenario #2: An attacker probes the server's private network by changing the above ENTITY line to:
Scenario #3: An attacker attempts a denial-of-service attack by including a potentially endless file:
|
References
OWASP
External |