<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://weblogs.asp.net/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Please, please, please, learn about injection attacks!</title><link>http://weblogs.asp.net/bleroy/archive/2004/08/18/please-please-please-learn-about-injection-attacks.aspx</link><description>I answer a lot of posts on the forums of the ASP.NET site. And more often than I would like to, I answer a different question than the one the poster asked, because I happened to easily spot a potential injection attack in the posted code. Now, what is</description><dc:language>en</dc:language><generator>CommunityServer 2007 SP1 (Build: 20510.895)</generator><item><title>re: Please, please, please, learn about injection attacks!</title><link>http://weblogs.asp.net/bleroy/archive/2004/08/18/please-please-please-learn-about-injection-attacks.aspx#6824994</link><pubDate>Thu, 08 Jan 2009 00:37:11 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:6824994</guid><dc:creator>Bertrand Le Roy</dc:creator><author>Bertrand Le Roy</author><description>&lt;p&gt;@bahamas4ever: you should use integrated security to avoid sticking passwords in config &lt;a rel="nofollow" target="_new" href="http://msdn.microsoft.com/en-us/library/ms254500.aspx"&gt;msdn.microsoft.com/.../ms254500.aspx&lt;/a&gt;&lt;/p&gt;
&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=6824994" width="1" height="1"&gt;</description></item><item><title>re: Please, please, please, learn about injection attacks!</title><link>http://weblogs.asp.net/bleroy/archive/2004/08/18/please-please-please-learn-about-injection-attacks.aspx#6823196</link><pubDate>Wed, 07 Jan 2009 03:56:38 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:6823196</guid><dc:creator>bahamas4ever</dc:creator><author>bahamas4ever</author><description>&lt;p&gt;using htmlencode/decode works well i have been using it awhile. it is a bit of a pain to have to encode all user input but it works. &lt;/p&gt;
&lt;p&gt;i never really thought about the error messages being a weakness but it makes perfect sense, it really would reveal database information.&lt;/p&gt;
&lt;p&gt;the db connection thing in webconfig i can&amp;#39;t seem to get around not having to put user &amp;amp; password information in it. &lt;/p&gt;
&lt;p&gt;any ideas ?&lt;/p&gt;
&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=6823196" width="1" height="1"&gt;</description></item><item><title>re: Please, please, please, learn about injection attacks!</title><link>http://weblogs.asp.net/bleroy/archive/2004/08/18/please-please-please-learn-about-injection-attacks.aspx#6790627</link><pubDate>Tue, 16 Dec 2008 15:45:31 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:6790627</guid><dc:creator>David Nelson</dc:creator><author>David Nelson</author><description>&lt;p&gt;Did you know you have two &amp;quot;Rule #4&amp;quot;&amp;#39;s? :)&lt;/p&gt;
&lt;p&gt;Good writeup, stuff every beginning programmer should know but most never learn.&lt;/p&gt;
&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=6790627" width="1" height="1"&gt;</description></item><item><title>re: Please, please, please, learn about injection attacks!</title><link>http://weblogs.asp.net/bleroy/archive/2004/08/18/please-please-please-learn-about-injection-attacks.aspx#6328545</link><pubDate>Fri, 27 Jun 2008 19:21:58 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:6328545</guid><dc:creator>Bertrand Le Roy</dc:creator><author>Bertrand Le Roy</author><description>&lt;p&gt;@Dan: I updated the link. Thanks for the heads up.&lt;/p&gt;
&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=6328545" width="1" height="1"&gt;</description></item><item><title>re: Please, please, please, learn about injection attacks!</title><link>http://weblogs.asp.net/bleroy/archive/2004/08/18/please-please-please-learn-about-injection-attacks.aspx#6327462</link><pubDate>Fri, 27 Jun 2008 13:48:06 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:6327462</guid><dc:creator>Dan</dc:creator><author>Dan</author><description>&lt;p&gt;Bertrand,&lt;/p&gt;
&lt;p&gt;the link you highlighted from Kyle Heon no longer seems to work, I just get a page with a load of Chinese characters.&lt;/p&gt;
&lt;p&gt;Please can you check or advise on what solution the page revealed?&lt;/p&gt;
&lt;p&gt;Thanks&lt;/p&gt;
&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=6327462" width="1" height="1"&gt;</description></item><item><title>re: Please, please, please, learn about injection attacks!</title><link>http://weblogs.asp.net/bleroy/archive/2004/08/18/please-please-please-learn-about-injection-attacks.aspx#6291534</link><pubDate>Wed, 18 Jun 2008 16:51:56 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:6291534</guid><dc:creator>Bertrand Le Roy</dc:creator><author>Bertrand Le Roy</author><description>&lt;p&gt;@Todd: thanks for the tip, and I apologize for my English which may sometimes be imprecise as I'm a non-native English speaker. Still, I did some research and here's the definition I found:&lt;/p&gt;
&lt;p&gt;&amp;quot;quo&amp;#183;ta&amp;#183;tion mark (plural quo&amp;#183;ta&amp;#183;tion marks) noun&lt;/p&gt;
&lt;p&gt;Definition:&lt;/p&gt;
&lt;p&gt;punctuation identifying quotation: either of a pair of punctuation marks, either in double (&amp;quot; &amp;quot;) or single (' ') form, used around direct speech, quotations, and titles, or to give special emphasis to a word or phrase&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;a rel="nofollow" target="_new" href="http://encarta.msn.com/dictionary_1861698453/quotation_mark.html"&gt;encarta.msn.com/.../quotation_mark.html&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Still, I'll update the post to make this clearer as this definition doesn't seem to be universally adopted and yours is less ambiguous.&lt;/p&gt;
&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=6291534" width="1" height="1"&gt;</description></item><item><title>re: Please, please, please, learn about injection attacks!</title><link>http://weblogs.asp.net/bleroy/archive/2004/08/18/please-please-please-learn-about-injection-attacks.aspx#6291286</link><pubDate>Wed, 18 Jun 2008 15:39:02 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:6291286</guid><dc:creator>Todd</dc:creator><author>Todd</author><description>&lt;p&gt;One thing I see all over the place in programming circles that people mess up all the time is quotes and apostrophes.&lt;/p&gt;
&lt;p&gt;A quote is a &amp;quot;&lt;/p&gt;
&lt;p&gt;An apostrophe is a &amp;#39;&lt;/p&gt;
&lt;p&gt;There is no such thing as a double quote unless it&amp;#39;s two quotation marks back to back like &amp;quot;&amp;quot;&lt;/p&gt;
&lt;p&gt;If we all help educate people, then perhaps they will start to understand.&lt;/p&gt;
&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=6291286" width="1" height="1"&gt;</description></item><item><title>SQL Injections</title><link>http://weblogs.asp.net/bleroy/archive/2004/08/18/please-please-please-learn-about-injection-attacks.aspx#6242894</link><pubDate>Mon, 02 Jun 2008 19:50:47 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:6242894</guid><dc:creator>Robert Folkesson</dc:creator><author>Robert Folkesson</author><description>&lt;p&gt;Den senaste tiden har en m&amp;#228;ngd sajter blivit infekterade av en SQL Injection-attack som anv&amp;#228;nder SQL&lt;/p&gt;
&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=6242894" width="1" height="1"&gt;</description></item><item><title>re: Please, please, please, learn about injection attacks!</title><link>http://weblogs.asp.net/bleroy/archive/2004/08/18/please-please-please-learn-about-injection-attacks.aspx#5787920</link><pubDate>Thu, 14 Feb 2008 18:59:10 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:5787920</guid><dc:creator>df</dc:creator><author>df</author><description>&lt;p&gt;hello&lt;/p&gt;
&lt;p&gt;i am like hack login admin panel in asp.net web applection !&lt;/p&gt;
&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=5787920" width="1" height="1"&gt;</description></item><item><title>re: Please, please, please, learn about injection attacks!</title><link>http://weblogs.asp.net/bleroy/archive/2004/08/18/please-please-please-learn-about-injection-attacks.aspx#4483002</link><pubDate>Mon, 08 Oct 2007 04:55:35 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:4483002</guid><dc:creator>Bertrand Le Roy</dc:creator><author>Bertrand Le Roy</author><description>&lt;p&gt;Jigar: do you mean in an html input tag? Then use an asp:textbox, or just html-encode the value when rendering it.&lt;/p&gt;
&lt;p&gt;If you mean in input data in general, the trick is to always use a technique that makes it impossible in the current context to inject code. That means parameters &amp;nbsp;in SQL instead of concatenation, HTML-encoding when rendering HTML, etc. Finally, validate input through a white list.&lt;/p&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=4483002" width="1" height="1"&gt;</description></item></channel></rss>