How can I prevent XPATH implementation in the .NET Framework?
Previously, we used string concatenation to create XPATH instructions, but found that end users can execute arbitrary XPATHs. For instance:
string queryValue = "pages[@url='" + USER_INPUT_VALUE + "']"; node = doc.DocumentElement.SelectSingleNode(queryValue);
Would it be sufficient to exclude single and double quotes from input strings?
Or is .NET support supported in parameterized XPATH queries?
source share