cve.bz

CAPEC-84

XQuery Injection

Very High severityHigh likelihoodDetailed pattern

This attack utilizes XQuery to probe and attack server systems; in a similar manner that SQL Injection allows an attacker to exploit SQL calls to RDBMS, XQuery Injection uses improperly validated data that is passed to XQuery commands to traverse and execute commands that the XQuery routines have access to. XQuery injection can be used to enumerate elements on the victim's environment, inject commands to the local host, or execute queries to remote files and data sources.

On this page

Ask an AI about this attack pattern

Show the promptExplain the attack pattern CAPEC-84: XQuery Injection: how it unfolds, what it needs and how to prevent and detect it in my systems. Use https://capec.mitre.org/data/definitions/84.html and https://cve.bz/cve/capec/84?via=ask-ai-copy, which lists recent CVEs with the weaknesses it exploits. Cite the sources.

Opens a third-party assistant; its answer is its own, not cve.bz's. The prompt holds only this attack pattern's id and public links.

How the attack unfolds

  1. Explore

    The attacker looks for a way in.

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

      3 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.
  2. Experiment

    They probe what they found.

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

      5 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.
  3. Exploit

    They carry out the attack.

    1. [Information Disclosure] The attacker crafts and injects an XQuery payload which is acted on by an XQL query leading to inappropriate disclosure of information.

      1 technique
      • 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.
    2. [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.

      1 technique
      • 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.

Prerequisites

  • The XQL must execute unvalidated data

Skills required

  • Low skill

    Basic understanding of XQuery

Consequences

What a successful attack can lead to
ImpactAffectsNote
Modify DataIntegrity
Read DataConfidentiality
Gain PrivilegesConfidentiality, Access Control, Authorization
Execute Unauthorized CommandsConfidentiality, Integrity, AvailabilityRun Arbitrary Code

Mitigations

  • Design: Perform input allowlist validation on all XML input

  • Implementation: Run xml parsing and query infrastructure with minimal privileges so that an attacker is limited in their ability to probe other system resources from XQL.

Weaknesses it exploits

  • CWE-74 Improper Neutralization of Special Elements in Output Used by a Downstream Component
  • CWE-707 Improper Neutralization

Recent CVEs with these weaknesses

  1. 6.9CVE-2026-140128

    A flaw has been found in Baison E3 Omni-Channel Retail Platform up to 2.5.1. Affected is an unknown function of the component KHATTACH Controller. Executing a manipulation of the argument retObjs can lead to sql injection. It is possible t…

  2. 5.5CVE-2026-139983

    A vulnerability was identified in walinejs Waline up to 1.43.4. This issue affects some unknown processing. Such manipulation of the argument mail leads to sql injection. The attack can be executed remotely. The exploit is publicly availab…

  3. 5.5CVE-2026-139982

    A vulnerability was found in PerfreeBlog up to 4.0.11. This issue affects the function buildPage of the file MyBatisUtils.java. Performing a manipulation of the argument Field results in sql injection. Remote exploitation of the attack is …

  4. 2.1CVE-2026-139980

    A vulnerability was detected in PerfreeBlog up to 4.0.11. Affected by this issue is the function buildPage of the file MyBatisUtils.java. The manipulation of the argument Field results in sql injection. The attack can be launched remotely.…

  5. 7.7CVE-2026-105843

    A flaw was found in OpenShift Router. The regular expression used to validate the haproxy.router.openshift.io/hsts_header route annotation matches the whitespace character class, which includes newline characters, and the matched value is …

  6. 2.1CVE-2026-139895

    A vulnerability was determined in itsourcecode Stock Management System 1.0. The impacted element is an unknown function of the file fetchOrderData.php. Executing a manipulation of the argument orderId can lead to sql injection. It is possi…

  7. 5.5CVE-2026-139863

    A weakness has been identified in itsourcecode Stock Management System 1.0. This affects an unknown part of the file php_action/fetchProductImageUrl.php. This manipulation of the argument i causes sql injection. The attack can be initiated…

  8. 5.5CVE-2026-139862

    A vulnerability was identified in itsourcecode Stock Management System 1.0. Affected by this vulnerability is an unknown functionality of the file php_action/fetchSelectedCategories.php. The manipulation of the argument categoriesId leads …

The newest records naming one of them. Each weakness's page lists them all.

Part of

Examples

An attacker can pass XQuery expressions embedded in otherwise standard XML documents. Like SQL injection atta…

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.

MITRE's words, unchanged: CAPEC-84 at MITRE. CAPEC is Copyright © 2007–2026, The MITRE Corporation, used under the CAPEC terms of use: “The MITRE Corporation (MITRE) hereby grants you a non-exclusive, royalty-free license to use Common Attack Pattern Enumeration and Classification (CAPEC™) for research, development, and commercial purposes. Any copy you make for such purposes is authorized provided that you reproduce MITRE’s copyright designation and this license in any such copy.” CAPEC and the CAPEC logo are trademarks of The MITRE Corporation. Credits. All attack patterns.