XPath Injection occurs when an application uses unvalidated user input to build an XPath query for an XML database. Without proper sanitization, attackers can manipulate the query's structure.
This vulnerability allows an attacker to alter the intended logic of the XPath expression. By injecting special characters or control sequences, they can change which data is retrieved from the XML source, potentially bypassing application logic, authentication, or access controls. Successful exploitation can lead to unauthorized data exposure, information disclosure, or manipulation of application flow. Developers must treat all user input used in XPath queries as untrusted and implement proper validation or parameterization to prevent these attacks.
Impact: Bypass Protection Mechanism
Controlling application flow (e.g. bypassing authentication).
Impact: Read Application Data
The attacker could read restricted XML content.
xmljavabashHigh