XML Parser Attack |
Attack Pattern ID: 99 (Standard Attack Pattern Completeness: Complete) | Typical Severity: Medium | Status: Draft |
Summary
Applications often need to transform data in and out of the XML format by using an XML parser. It may be possible for an attacker to inject data that may have an adverse effect on the XML parser when it is being processed. These adverse effects may include the parser crashing, consuming too much of a resource, executing too slowly, executing code supplied by an attacker, allowing usage of unintenteded system functionality, etc. An attacker's goal is to leverage parser failure to his or her advantage. In some cases it may be possible to jump from the data plane to the control plane via bad data being passed to an XML parser [1].
Attack Execution Flow
An attacker determines the input data stream that is being processed by an XML parser on the server side.
An attacker crafts input data that may have an adverse effect on the operation of the XML parser when the data is parsed on the server.
An application uses an XML parser to perform transformation on user-controllable data.
An application does not perform sufficient validation to ensure that user-controllable data is safe for an XML parser.
Description
"PHPXMLRPC aka XML-RPC For PHP is a PHP implementation of the XML-RPC web RPC protocol, and was originally developed by Edd Dumbill of Useful Information Company. As of the 1.0 stable release, the project has been opened to wider involvement and moved to SourceForge. PHPXMLRPC is used in a large number of popular web applications such as PostNuke, Drupal, b2evolution, and TikiWiki. Unfortunately PHPXMLRPC is vulnerable to a remote php code execution vulnerability that may be exploited by an attacker to compromise a vulnerable system.
Remote Command Execution:
PHPXMLRPC is vulnerable to a very high risk remote php code execution vulnerability that may allow for an attacker to compromise a vulnerable webserver. The vulnerability is the result of unsanatized data being passed directly into an eval() call in the parseRequest() function of the XMLRPC server.
By creating an XML file that uses single quotes to escape into the eval() call an attacker can easily execute php code on the target server. This has a lot to do with the fact that magic_quotes_gpc() does not apply to $HTTP_RAW_POST_DATA so using single quotes is not a problem" [2].
Reference: GulfTech Security Research"PHPXMLRPC Remote Code Execution", SecurePoint - BugTraq Archive: "http://msgs.securepoint.com/bugtraq"
Related Vulnerabilities
CVE-2005-2498
Skill or Knowledge Level: Low
Denial of service (making the parser crash)
Skill or Knowledge Level: High
Arbitrary code execution
Bad data is continuously passed to the XML parser, possibly making it crash.
Carefully validate and sanitize all user-controllable data prior to passing it to the XML parser routine. Ensure that the resultant data is safe to pass to the XML parser.
Perform validation on canonical data.
Pick a robust implementation of an XML parser.
Validate XML against a valid schema or DTD prior to parsing.
- Denial of Service
- Information Leakage
- Run Arbitrary Code
- Privilege Escalation
Nature | Type | ID | Name | Description | View(s) this relationship pertains to |
---|---|---|---|---|---|
ChildOf | Attack Pattern | 82 | Violating Implicit Assumptions Regarding XML Content (aka XML Denial of Service (XDoS)) | Mechanism of Attack (primary)1000 | |
ParentOf | Attack Pattern | 230 | Recursive Payloads Sent to XML Parsers | Mechanism of Attack (primary)1000 | |
ParentOf | Attack Pattern | 231 | Oversized Payloads Sent to XML Parsers | Mechanism of Attack (primary)1000 |