XPath injection occurs when an XML document is used for data storage in a manner similar to a relational database. This attack is similar to SQL injection (MSC33-J. Prevent against SQL Injection), wherein an attacker is able to can enter valid query logic into data fields. Most often, the conditional field of the query resolves to a tautology or gives the attacker access to privileged information.
...
Code Block |
---|
str_query = "//users/user[LoginID/text()= " & login & " and password/text()=" & password & "]" |
ThereforeConsequently, the user may specify input such as login = "' or 1=1
" and password = "' or 1=1
", yielding the following query string.
...