CAPEC-99 - XML Parser Attack

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 unintended 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. [R.99.1]

Severity

Likelihood

Confidentiality

Integrity

Availability

  • Attack Methods 2
  • Injection
  • API Abuse
  • Purposes 2
  • Penetration
  • Exploitation
  • Scopes 4
  • DoS: resource consumption (memory)
  • Availability
  • Read memory
  • Confidentiality
  • Execute unauthorized code or commands
  • Availability
  • Integrity
  • Confidentiality
  • Gain privileges / assume identity
  • Authorization
  • Access_Control
  • Confidentiality

Low level: Denial of service (making the parser crash)

High level: Arbitrary code execution

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.

Step 1 -

An attacker determines the input data stream that is being processed by an XML parser on the server side..


Step 1 -

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..


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.