The product uses external input to dynamically construct an XPath expression used to retrieve data from an XML database, but it does not neutralize or incorrectly neutralizes that input. This allows an attacker to control the structure of the query.
Extended Description
The net effect is that the attacker will have control over the information selected from the XML database and may use that ability to control application flow, modify logic, retrieve unauthorized data, or bypass important checks (e.g. authentication).
ThreatScore
Threat Mapped score: 0.0
Industry: Finiancial
Threat priority: Unclassified
Observed Examples (CVEs)
No observed examples available.
Related Attack Patterns (CAPEC)
N/A
Attack TTPs
N/A
Modes of Introduction
Phase
Note
Implementation
REALIZATION: This weakness is caused during implementation of an architectural security tactic.
Impact: Read Application Data — Notes: The attacker could read restricted XML content.
Potential Mitigations
Implementation: Use parameterized XPath queries (e.g. using XQuery). This will help ensure separation between data plane and control plane. (N/A)
Implementation: Properly validate user input. Reject data where appropriate, filter where appropriate and escape where appropriate. Make sure input that will be used in XPath queries is safe in that context. (N/A)
Applicable Platforms
None (Not Language-Specific, Undetermined)
Demonstrative Examples
Intro: Consider the following simple XML document that stores authentication information and a snippet of Java code that uses XPath query to retrieve authentication information:
Body: The Java code used to retrieve the home directory based on the provided credentials is:
Relationship: This weakness is similar to other weaknesses that enable injection style attacks, such as SQL injection, command injection and LDAP injection. The main difference is that the target of attack here is the XML database.