Dark Mode
Capec-84 Detail
XQuery Injection
Detailed Software Likelihood: High Typical Severity: Very High
Parents: 250
Threats: T290
Not present
| External ID | Source | Link | Description |
|---|---|---|---|
| CAPEC-84 | capec | https://capec.mitre.org/data/definitions/84.html | |
| CWE-74 | cwe | http://cwe.mitre.org/data/definitions/74.html | |
| CWE-707 | cwe | http://cwe.mitre.org/data/definitions/707.html | |
| 46 | WASC | http://projects.webappsec.org/XQuery-Injection | XQuery Injection |
Explore
-
Survey the application for user-controllable inputs: Using a browser or an automated tool, an attacker follows all public links and actions on a web site. They record all the links, the forms, the resources accessed and all other potential entry-points for the web application.
| Techniques |
|---|
| Use a spidering tool to follow and record all links and analyze the web pages to find entry points. Make special note of any links that include parameters in the URL. |
| Use a proxy tool to record all user input entry points visited during a manual traversal of the web application. |
| Use a browser to manually explore the website and analyze how it is constructed. Many browsers' plugins are available to facilitate the analysis or automate the discovery. |
Experiment
-
Determine user-controllable input susceptible to injection: Determine the user-controllable input susceptible to injection. For each user-controllable input that the attacker suspects is vulnerable to XQL injection, attempt to inject characters that have special meaning in XQL. The goal is to create an XQL query with an invalid syntax.
| Techniques |
|---|
| Use web browser to inject input through text fields or through HTTP GET parameters. |
| Use a web application debugging tool such as Tamper Data, TamperIE, WebScarab,etc. to modify HTTP POST parameters, hidden fields, non-freeform fields, etc. |
| Use XML files to inject input. |
| Use network-level packet injection tools such as netcat to inject input |
| Use modified client (modified by reverse engineering) to inject input. |
Exploit
-
Information Disclosure: The attacker crafts and injects an XQuery payload which is acted on by an XQL query leading to inappropriate disclosure of information.
-
Manipulate the data in the XML database: The attacker crafts and injects an XQuery payload which is acted on by an XQL query leading to modification of application data.
| Techniques |
|---|
| Leveraging one of the vulnerable inputs identified during the Experiment phase, inject malicious XQuery payload. The payload aims to get information on the structure of the underlying XML database and/or the content in it. |
| Techniques |
|---|
| Leveraging one of the vulnerable inputs identified during the Experiment phase, inject malicious XQuery payload.. The payload tries to insert or replace data in the XML database. |
- The XQL must execute unvalidated data
Not present
| Low |
|---|
| Basic understanding of XQuery |
| Integrity | Availability | Authorization | Access Control | Confidentiality |
|---|---|---|---|---|
| Modify Data | Execute Unauthorized Commands (Run Arbitrary Code) | Gain Privileges | Gain Privileges | Read Data |
| Execute Unauthorized Commands (Run Arbitrary Code) | Gain Privileges | |||
| Execute Unauthorized Commands (Run Arbitrary Code) |
- An attacker can pass XQuery expressions embedded in otherwise standard XML documents. Like SQL injection attacks, the attacker tunnels through the application entry point to target the resource access layer. The string below is an example of an attacker accessing the accounts.xml to request the service provider send all user names back. doc(accounts.xml)//user[Name=''] The attacks that are possible through XQuery are difficult to predict, if the data is not validated prior to executing the XQL.