Click here to Skip to main content
15,892,965 members
Please Sign up or sign in to vote.
5.00/5 (1 vote)
hi I am creating a sample login application which will authenticate all the valid users but, I am storing my username and passwords in a xml file. My code is working for valid credential as well as invalid credential like xpath injection code ' or '1' = '1. I am banging my head to overcome this I have gone through XPathDocument, XPathNavigator, XPathExpression, XPathNodeIterator but still the same output. Please suggest me how would I do without any third party dll.
Posted
Updated 29-Jul-13 21:34pm
v3

1 solution

Hi Prafulla,

If you can deny usage of apostrophe in the string that you store, that would be an up front solution.

The preferred solution of course is the usage of variables, this goes for SQL Injection as well as the less known XPath Injection.

Read\watch more about Injection
XPath Injection Exploitation[^]
How to prevent XPath/XML injection in .NET[^]
SQL Injection Attacks and Some Tips on How to Prevent Them[^]

Good luck,
Edo
 
Share this answer
 
v2

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