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.
Attack Prerequisites
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.
Typical Likelihood of Exploit
Likelihood: Medium
Methods of Attack
Injection
API Abuse
Examples-Instances
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].
Bad data is continuously passed to the XML parser, possibly making it
crash.
Solutions and Mitigations
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.
Vision and Technical Leadership provided by Cigital, Inc.
This Web site is hosted by The MITRE Corporation.
Copyright 2009, The MITRE Corporation. CAPEC and the CAPEC logo are trademarks of The MITRE Corporation.