Unsanitized User Input in XPath
Overview
Rule ID:
java_lang_xpath_injection
Applicable Languages: Java
Weakness ID: CWE-643
Description
Using unsanitized user input in XPath expressions can lead to XPath injection, allowing attackers to gain unauthorized access to sensitive information in XML documents. Ensure that all variables passed into XPath evaluation or compilation commands are properly sanitized.
Remediation Guidelines
Sanitize user input before including it in XPath queries to prevent XPath injection. This ensures that input values cannot alter the query structure.
Do not directly concatenate or embed unsanitized user inputs into XPath expressions. This practice can lead to XPath injection vulnerabilities.
References
Configuration
To omit this rule during a scan, and to provide you with continuous 24/7 code-level scanning, you can employ our SAST TOOL
Last updated