Click here to Skip to main content
15,885,919 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Method CreateExchangeTb() gets user input from the currencyRow element. This element’s value then flows through the code without being properly sanitized or validated, and is eventually used in an XPath query.

C#
currencyID =
currencyRow["GeniCurrencyCode"].ToString();
 .
 .

 XPathNavigator rateNode =
exchangeNode.SelectSingleNode(string.Format("Rate[@Code='{0}' and
@ForecastValue='{1}']", currencyID, strYear));



Quote:
Can you please suggest how to fix XPath Injection issue ?
Posted

1 solution

Check this XPATH Injection[^]. They have briefly explain the mechanism
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900