mirror of
https://github.com/github/codeql.git
synced 2026-02-10 20:21:10 +01:00
Minor updates to qhelp file
This commit is contained in:
@@ -5,14 +5,14 @@
|
||||
<overview>
|
||||
<p>
|
||||
If an XPath expression is built using string concatenation, and the components of the concatenation
|
||||
include user input, a user is likely to be able to create a malicious XPath expression.
|
||||
include user input, it makes it very easy for a user to create a malicious XPath expression.
|
||||
</p>
|
||||
</overview>
|
||||
|
||||
<recommendation>
|
||||
<p>
|
||||
If user input must be included in an XPath expression, pre-compile the query and use variable
|
||||
references to include the user input.
|
||||
If user input must be included in an XPath expression, either sanitize the data or pre-compile the query
|
||||
and use variable references to include the user input.
|
||||
</p>
|
||||
<p>
|
||||
XPath injection can also be prevented by using XQuery.
|
||||
@@ -22,14 +22,14 @@ XPath injection can also be prevented by using XQuery.
|
||||
|
||||
<example>
|
||||
<p>
|
||||
In the first, second, and third example, the code accepts a name and password specified by the user, and uses this
|
||||
In the first three examples, the code accepts a name and password specified by the user, and uses this
|
||||
unvalidated and unsanitized value in an XPath expression. This is vulnerable to the user providing
|
||||
special characters or string sequences that change the meaning of the XPath expression to search
|
||||
for different values.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
In the fourth example, the code utilizes setXPathVariableResolver which prevents XPath Injection.
|
||||
In the fourth example, the code uses `setXPathVariableResolver` which prevents XPath injection.
|
||||
</p>
|
||||
<p>
|
||||
The fifth example is a dom4j XPath injection example.
|
||||
@@ -39,6 +39,6 @@ The fifth example is a dom4j XPath injection example.
|
||||
|
||||
<references>
|
||||
<li>OWASP: <a href="https://owasp.org/www-project-web-security-testing-guide/latest/4-Web_Application_Security_Testing/07-Input_Validation_Testing/09-Testing_for_XPath_Injection">Testing for XPath Injection</a>.</li>
|
||||
<li>OWASP: <a href="https://www.owasp.org/index.php/XPATH_Injection">XPath Injection</a>.</li>
|
||||
<li>OWASP: <a href="https://owasp.org/www-community/attacks/XPATH_Injection">XPath Injection</a>.</li>
|
||||
</references>
|
||||
</qhelp>
|
||||
|
||||
Reference in New Issue
Block a user