<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://www.communities.hp.com/securitysoftware/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>Following the White Rabbit Blog : sql injection</title><link>http://www.communities.hp.com/securitysoftware/blogs/rafal/archive/tags/sql+injection/default.aspx</link><description>Tags: sql injection</description><dc:language>en</dc:language><generator>CommunityServer 2008.5 SP1 (Build: 31106.3070)</generator><item><title>Web Application Security 101: Simple SQL Injection</title><link>http://www.communities.hp.com/securitysoftware/blogs/rafal/archive/2008/10/04/web-application-security-101-simple-sql-injection.aspx</link><pubDate>Sat, 04 Oct 2008 05:08:00 GMT</pubDate><guid isPermaLink="false">94bda21f-7d63-4095-85de-7c2a68fb172c:86018</guid><dc:creator>RafalLos</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://www.communities.hp.com/securitysoftware/blogs/rafal/rsscomments.aspx?PostID=86018</wfw:commentRss><comments>http://www.communities.hp.com/securitysoftware/blogs/rafal/archive/2008/10/04/web-application-security-101-simple-sql-injection.aspx#comments</comments><description>&lt;p&gt;&amp;nbsp; Web application security is a hot topic, no doubting that these days.&amp;nbsp; The awareness is growing and developers are starting to take notice of the security shortfalls in their code.&amp;nbsp; Awareness of attacks like SQL injection, cross-site scripting, and CSRF (Cross-Site Request Forgery) is starting to spread and so are ways to protect against these types of attacks.&lt;/p&gt;&lt;p&gt;&amp;nbsp;With this Security 101 post I&amp;#39;d like to call attention to a particular type of attack that (after nearly 5 years of executing it successfully) is finally starting to trend towards extinction - but sadly still is all-too-common.&amp;nbsp; Let&amp;#39;s do this by example... &lt;/p&gt;&lt;p&gt;&amp;nbsp; As you visit your favorite site one of the first thing that the server on the other end of your connection does is checks your browser.&amp;nbsp; It does this for an obvious reason: it needs to know whether to serve you java or ActiveX/.Net -based content.&amp;nbsp; This isn&amp;#39;t going to go away since I don&amp;#39;t see either Microsoft or Mozilla dropping out of the browser game, so the checking of &amp;quot;user-agent&amp;quot; will continue. Moving on in our example, the server pulls the &amp;quot;user-Agent&amp;quot; header component and has to compare it against known types of browsers.&amp;nbsp; Now, there are a number of ways that the server can check your browser version (against an XML file, using JavaScript from within the page, or using a database call) but it is fairly likely that it will be done with a database call to the back-end database server against a table of supported browsers.&amp;nbsp; Here&amp;#39;s where the magic happens if you&amp;#39;re an attacker.&amp;nbsp; Most of the time, if the developer is making a database call to check browser version compatibility they are *not* sanitizing that parameter before passing it into the database server.&amp;nbsp; This, of course, leads to &lt;b&gt;SQL Injection&lt;/b&gt;.&lt;/p&gt;&lt;p&gt;&amp;nbsp; This absolutely fundamental check can cause a site or application with *zero form inputs* to still be vulnerable to SQL Injection.&amp;nbsp; I&amp;#39;ve seen it first-hand, so I know it exists in &amp;quot;the wild&amp;quot;. Absolutely fascinating since I&amp;#39;ve had developers ask me why they need to sanitize parameters when they have little (or no) form inputs on a site.&amp;nbsp; My answer is always this example.&lt;/p&gt;&lt;p&gt;&amp;nbsp; The moral of this story is don&amp;#39;t get over-confident.&amp;nbsp; Just because your site/application is &amp;#39;basic&amp;#39; or short of complex inputs it does not necessarily mean that you&amp;#39;re invulnerable to attacks like SQL Injection.&amp;nbsp; Check and sanitize &lt;b&gt;all&lt;/b&gt; your parameters coming from the user-side.&amp;nbsp; Never, ever, under any circumstances trust data coming from the client.&amp;nbsp; This goes for *any* data, including header fields! &lt;br /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://www.communities.hp.com/securitysoftware/aggbug.aspx?PostID=86018" width="1" height="1"&gt;</description><category domain="http://www.communities.hp.com/securitysoftware/blogs/rafal/archive/tags/hacking/default.aspx">hacking</category><category domain="http://www.communities.hp.com/securitysoftware/blogs/rafal/archive/tags/sql+injection/default.aspx">sql injection</category><category domain="http://www.communities.hp.com/securitysoftware/blogs/rafal/archive/tags/user-agent/default.aspx">user-agent</category><category domain="http://www.communities.hp.com/securitysoftware/blogs/rafal/archive/tags/data+sanitization/default.aspx">data sanitization</category><category domain="http://www.communities.hp.com/securitysoftware/blogs/rafal/archive/tags/web+application+hacking/default.aspx">web application hacking</category><category domain="http://www.communities.hp.com/securitysoftware/blogs/rafal/archive/tags/input+validation/default.aspx">input validation</category><category domain="http://www.communities.hp.com/securitysoftware/blogs/rafal/archive/tags/web+application+security/default.aspx">web application security</category></item><item><title>SQL Injection - Real and In Your Face</title><link>http://www.communities.hp.com/securitysoftware/blogs/rafal/archive/2008/09/18/sql-injection-real-and-in-your-face.aspx</link><pubDate>Thu, 18 Sep 2008 03:58:00 GMT</pubDate><guid isPermaLink="false">94bda21f-7d63-4095-85de-7c2a68fb172c:84789</guid><dc:creator>RafalLos</dc:creator><slash:comments>1</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://www.communities.hp.com/securitysoftware/blogs/rafal/rsscomments.aspx?PostID=84789</wfw:commentRss><comments>http://www.communities.hp.com/securitysoftware/blogs/rafal/archive/2008/09/18/sql-injection-real-and-in-your-face.aspx#comments</comments><description>&lt;p&gt;Not every company has &lt;em&gt;consumer data&lt;/em&gt; contained within the web applications.&lt;/p&gt;
&lt;p&gt;I get that.&amp;nbsp; Logic fails me, however, when someone tries to explain to me why because they don&amp;#39;t have consumer data (or other critical data that can be &amp;quot;stolen&amp;quot; from their applications) they really don&amp;#39;t need to pay attention to web application security issues.&amp;nbsp; Really...&lt;/p&gt;
&lt;p&gt;&amp;nbsp;This &lt;a class="" title="InternetNews.com Article" href="http://www.internetnews.com/security/article.php/3771671/Hackers+Hit+BusinessWeek+With+Malware.htm" target="_blank"&gt;news over at InternetNews.com&lt;/a&gt;&amp;nbsp;story could be a rude-awakening for some of those folks.&amp;nbsp; The point is - just because you don&amp;#39;t have data to &amp;quot;steal&amp;quot; doesn&amp;#39;t diminish the value of your web application as an attack surface.&amp;nbsp; In fact, the most important principle (other than data) that drives hacking is volume of traffic to your site/application.&amp;nbsp; A news organization, for example, lives off of driving traffic to the site.&amp;nbsp; Malware distributors (adware, for example) live off of the same principle because they use those viewers as &amp;quot;drive-by adware install victims&amp;quot;... and thus make their money.&amp;nbsp; Am I making sense here?&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp; The bottom line, Web Application Security is a serious business, and not only for those that have to be PCI compliant, or HIPPA compliant, or some other regulation-compliant... and not just for those who have consumer credit card data on their pages... no no - it&amp;#39;s for everyone with a web presence because &lt;strong&gt;you&lt;/strong&gt; are a target if you have viewers.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://www.communities.hp.com/securitysoftware/aggbug.aspx?PostID=84789" width="1" height="1"&gt;</description><category domain="http://www.communities.hp.com/securitysoftware/blogs/rafal/archive/tags/businessweek+attack/default.aspx">businessweek attack</category><category domain="http://www.communities.hp.com/securitysoftware/blogs/rafal/archive/tags/sql+injection+attack/default.aspx">sql injection attack</category><category domain="http://www.communities.hp.com/securitysoftware/blogs/rafal/archive/tags/sql+injection/default.aspx">sql injection</category><category domain="http://www.communities.hp.com/securitysoftware/blogs/rafal/archive/tags/adware/default.aspx">adware</category><category domain="http://www.communities.hp.com/securitysoftware/blogs/rafal/archive/tags/businessweek+hack/default.aspx">businessweek hack</category><category domain="http://www.communities.hp.com/securitysoftware/blogs/rafal/archive/tags/malware+distribution/default.aspx">malware distribution</category></item></channel></rss>