<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
		>
<channel>
	<title>Comments on: Vulnerable bug in CodeIgniter which took us hours to fix our corrupted database</title>
	<atom:link href="http://hasin.wordpress.com/2007/04/18/vulnerable-bug-in-codeigniter-which-took-us-hours-to-fix-our-corrupted-database/feed/" rel="self" type="application/rss+xml" />
	<link>http://hasin.wordpress.com/2007/04/18/vulnerable-bug-in-codeigniter-which-took-us-hours-to-fix-our-corrupted-database/</link>
	<description>Its me, myself</description>
	<lastBuildDate>Wed, 11 Nov 2009 21:31:50 +0000</lastBuildDate>
	<generator>http://wordpress.com/</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: yegiro</title>
		<link>http://hasin.wordpress.com/2007/04/18/vulnerable-bug-in-codeigniter-which-took-us-hours-to-fix-our-corrupted-database/#comment-68702</link>
		<dc:creator>yegiro</dc:creator>
		<pubDate>Sat, 22 Aug 2009 12:19:08 +0000</pubDate>
		<guid isPermaLink="false">http://hasin.wordpress.com/2007/04/18/vulnerable-bug-in-codeigniter-which-took-us-hours-to-fix-our-corrupted-database/#comment-68702</guid>
		<description>well actually its your fault for being lazy making validations.....</description>
		<content:encoded><![CDATA[<p>well actually its your fault for being lazy making validations&#8230;..</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Donny Kurnia</title>
		<link>http://hasin.wordpress.com/2007/04/18/vulnerable-bug-in-codeigniter-which-took-us-hours-to-fix-our-corrupted-database/#comment-68545</link>
		<dc:creator>Donny Kurnia</dc:creator>
		<pubDate>Sat, 27 Jun 2009 13:32:03 +0000</pubDate>
		<guid isPermaLink="false">http://hasin.wordpress.com/2007/04/18/vulnerable-bug-in-codeigniter-which-took-us-hours-to-fix-our-corrupted-database/#comment-68545</guid>
		<description>Bad programming habit, but blame the framework :)

Next time, write model with default value for each parameter, then check it again before using it in a query.</description>
		<content:encoded><![CDATA[<p>Bad programming habit, but blame the framework <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Next time, write model with default value for each parameter, then check it again before using it in a query.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Vin d Mam talent</title>
		<link>http://hasin.wordpress.com/2007/04/18/vulnerable-bug-in-codeigniter-which-took-us-hours-to-fix-our-corrupted-database/#comment-66965</link>
		<dc:creator>Vin d Mam talent</dc:creator>
		<pubDate>Fri, 21 Nov 2008 09:43:33 +0000</pubDate>
		<guid isPermaLink="false">http://hasin.wordpress.com/2007/04/18/vulnerable-bug-in-codeigniter-which-took-us-hours-to-fix-our-corrupted-database/#comment-66965</guid>
		<description>bug is a bug - but no reason to make it bigger then it should be. I also found 3 critical bugs in CI , posted it and fixed it BTW in my application.. nobodys perfect</description>
		<content:encoded><![CDATA[<p>bug is a bug &#8211; but no reason to make it bigger then it should be. I also found 3 critical bugs in CI , posted it and fixed it BTW in my application.. nobodys perfect</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: jovani</title>
		<link>http://hasin.wordpress.com/2007/04/18/vulnerable-bug-in-codeigniter-which-took-us-hours-to-fix-our-corrupted-database/#comment-64784</link>
		<dc:creator>jovani</dc:creator>
		<pubDate>Fri, 29 Feb 2008 03:38:07 +0000</pubDate>
		<guid isPermaLink="false">http://hasin.wordpress.com/2007/04/18/vulnerable-bug-in-codeigniter-which-took-us-hours-to-fix-our-corrupted-database/#comment-64784</guid>
		<description>well, as most developers will do before processing data is to first and foremost, validate entries. right? it&#039;s a simple logic..</description>
		<content:encoded><![CDATA[<p>well, as most developers will do before processing data is to first and foremost, validate entries. right? it&#8217;s a simple logic..</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Chui</title>
		<link>http://hasin.wordpress.com/2007/04/18/vulnerable-bug-in-codeigniter-which-took-us-hours-to-fix-our-corrupted-database/#comment-41778</link>
		<dc:creator>Chui</dc:creator>
		<pubDate>Thu, 09 Aug 2007 23:58:17 +0000</pubDate>
		<guid isPermaLink="false">http://hasin.wordpress.com/2007/04/18/vulnerable-bug-in-codeigniter-which-took-us-hours-to-fix-our-corrupted-database/#comment-41778</guid>
		<description>CI rocks. Can you post your patch?</description>
		<content:encoded><![CDATA[<p>CI rocks. Can you post your patch?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mahmudul Hasan</title>
		<link>http://hasin.wordpress.com/2007/04/18/vulnerable-bug-in-codeigniter-which-took-us-hours-to-fix-our-corrupted-database/#comment-25439</link>
		<dc:creator>Mahmudul Hasan</dc:creator>
		<pubDate>Fri, 08 Jun 2007 07:12:07 +0000</pubDate>
		<guid isPermaLink="false">http://hasin.wordpress.com/2007/04/18/vulnerable-bug-in-codeigniter-which-took-us-hours-to-fix-our-corrupted-database/#comment-25439</guid>
		<description>@Bowman, I do not work with him, but I do read his posts, because it helps me a lot. This post is really helpful, coz nowadays, I am building lots of models in CodeIgniters, and after now, I would be careful, while I am gonna run any query using the Active Record Class. He may not be native english speaker, but he is technically strong enough to grab the attention of almost all the php developers from Bangladesh. 

@hasin bhai, I would be careful. Thanks for this post.</description>
		<content:encoded><![CDATA[<p>@Bowman, I do not work with him, but I do read his posts, because it helps me a lot. This post is really helpful, coz nowadays, I am building lots of models in CodeIgniters, and after now, I would be careful, while I am gonna run any query using the Active Record Class. He may not be native english speaker, but he is technically strong enough to grab the attention of almost all the php developers from Bangladesh. </p>
<p>@hasin bhai, I would be careful. Thanks for this post.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Brian</title>
		<link>http://hasin.wordpress.com/2007/04/18/vulnerable-bug-in-codeigniter-which-took-us-hours-to-fix-our-corrupted-database/#comment-20900</link>
		<dc:creator>Brian</dc:creator>
		<pubDate>Wed, 30 May 2007 04:15:48 +0000</pubDate>
		<guid isPermaLink="false">http://hasin.wordpress.com/2007/04/18/vulnerable-bug-in-codeigniter-which-took-us-hours-to-fix-our-corrupted-database/#comment-20900</guid>
		<description>  This is really too bad, because I asked a question about this exact same issue last year in the CodeIgniter forum.  (well, close enough, but I was concerned with passing in a &quot;false&quot; instead of a null).  All I got was a single rude response from a community member questioning my knowledge of PHP. 

http://codeigniter.com/forums/viewthread/47012/

I really hope this behavior changes so that it doesn&#039;t cause problems for anyone else in the future.</description>
		<content:encoded><![CDATA[<p>This is really too bad, because I asked a question about this exact same issue last year in the CodeIgniter forum.  (well, close enough, but I was concerned with passing in a &#8220;false&#8221; instead of a null).  All I got was a single rude response from a community member questioning my knowledge of PHP. </p>
<p><a href="http://codeigniter.com/forums/viewthread/47012/" rel="nofollow">http://codeigniter.com/forums/viewthread/47012/</a></p>
<p>I really hope this behavior changes so that it doesn&#8217;t cause problems for anyone else in the future.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: hasin</title>
		<link>http://hasin.wordpress.com/2007/04/18/vulnerable-bug-in-codeigniter-which-took-us-hours-to-fix-our-corrupted-database/#comment-11761</link>
		<dc:creator>hasin</dc:creator>
		<pubDate>Fri, 20 Apr 2007 16:50:37 +0000</pubDate>
		<guid isPermaLink="false">http://hasin.wordpress.com/2007/04/18/vulnerable-bug-in-codeigniter-which-took-us-hours-to-fix-our-corrupted-database/#comment-11761</guid>
		<description>Sorry for my poor English, Bowman. And thanks again for you wonderful comment.</description>
		<content:encoded><![CDATA[<p>Sorry for my poor English, Bowman. And thanks again for you wonderful comment.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Joe Bowman</title>
		<link>http://hasin.wordpress.com/2007/04/18/vulnerable-bug-in-codeigniter-which-took-us-hours-to-fix-our-corrupted-database/#comment-11759</link>
		<dc:creator>Joe Bowman</dc:creator>
		<pubDate>Fri, 20 Apr 2007 16:29:28 +0000</pubDate>
		<guid isPermaLink="false">http://hasin.wordpress.com/2007/04/18/vulnerable-bug-in-codeigniter-which-took-us-hours-to-fix-our-corrupted-database/#comment-11759</guid>
		<description>While I&#039;ll start by saying that use, this does appear to be a bug in the ActiveRecord class used by CI, there are ways to avoid this from happening.

First off, this issue should have never made an impact on you, other than finding the bug and fixing it. It should have never affected your users.  You should have made your code change in a development environment, and tested them as a developer. Then pushed those changes to a staging site, for user acceptance testing with multiple users who are not developers, and then once your confirm the changes were valid, made the changes live. This should be your standard development cycle, and never be circumvented for even the tiniest changes, to avoid this from happening. 

Secondly, you may want to examine your data validation practices. Most websites/applications are multi-tiered. You have the user interface, the backend, and the database. You validation practices should look like

1. (optional) Interface validation. Speaking of websites, this would be javascript to validate form entries before allowing the submission. This is just a little nicer than kicking responses from the backend, as it cuts down client to server communication.

2. Backend data validation. Even if you validate at the interface, validate the data when it reaches the server. You have no way of guaranteeing where the data comes from.

3. When passing from your script/run time engine to the database, validate again. Just to avoid cases like these. While much of your data has come direct from the source, things like your user id may have been generated as part of the algorithm creating the query. So validate the data going into the query. Though I imagine you were counting on ActiveRecord for this, and honestly, I would too. 


Lastly, you may to consider how you put your words together when putting together blog entries such as these. Honestly, I was put off by your colorful language. I&#039;m a sysadmin with over 10 years of experience, so believe me, I fully appreciate the level of frustration you get when you have situations like these. However, the way you wrote this post is much better suited for behind closed door conversations and letting out steam with your co-workers, not for the world (and possible future potential employers) to see. Just a thought. 

Good luck with your future projects.</description>
		<content:encoded><![CDATA[<p>While I&#8217;ll start by saying that use, this does appear to be a bug in the ActiveRecord class used by CI, there are ways to avoid this from happening.</p>
<p>First off, this issue should have never made an impact on you, other than finding the bug and fixing it. It should have never affected your users.  You should have made your code change in a development environment, and tested them as a developer. Then pushed those changes to a staging site, for user acceptance testing with multiple users who are not developers, and then once your confirm the changes were valid, made the changes live. This should be your standard development cycle, and never be circumvented for even the tiniest changes, to avoid this from happening. </p>
<p>Secondly, you may want to examine your data validation practices. Most websites/applications are multi-tiered. You have the user interface, the backend, and the database. You validation practices should look like</p>
<p>1. (optional) Interface validation. Speaking of websites, this would be javascript to validate form entries before allowing the submission. This is just a little nicer than kicking responses from the backend, as it cuts down client to server communication.</p>
<p>2. Backend data validation. Even if you validate at the interface, validate the data when it reaches the server. You have no way of guaranteeing where the data comes from.</p>
<p>3. When passing from your script/run time engine to the database, validate again. Just to avoid cases like these. While much of your data has come direct from the source, things like your user id may have been generated as part of the algorithm creating the query. So validate the data going into the query. Though I imagine you were counting on ActiveRecord for this, and honestly, I would too. </p>
<p>Lastly, you may to consider how you put your words together when putting together blog entries such as these. Honestly, I was put off by your colorful language. I&#8217;m a sysadmin with over 10 years of experience, so believe me, I fully appreciate the level of frustration you get when you have situations like these. However, the way you wrote this post is much better suited for behind closed door conversations and letting out steam with your co-workers, not for the world (and possible future potential employers) to see. Just a thought. </p>
<p>Good luck with your future projects.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: hasin</title>
		<link>http://hasin.wordpress.com/2007/04/18/vulnerable-bug-in-codeigniter-which-took-us-hours-to-fix-our-corrupted-database/#comment-11693</link>
		<dc:creator>hasin</dc:creator>
		<pubDate>Fri, 20 Apr 2007 08:34:52 +0000</pubDate>
		<guid isPermaLink="false">http://hasin.wordpress.com/2007/04/18/vulnerable-bug-in-codeigniter-which-took-us-hours-to-fix-our-corrupted-database/#comment-11693</guid>
		<description>Hi Sevir, i agree that I must the user input beofre sending it to CI, if you check the forum post also there was a huge discussion that as I sent ti a null value and CI didn&#039;t interpret it correctly. 

If I send a &quot;null&quot; to CI, ActiveRecord must not apply any Fuzilogic to it and it should be treated as null, what CI developers overlooked.</description>
		<content:encoded><![CDATA[<p>Hi Sevir, i agree that I must the user input beofre sending it to CI, if you check the forum post also there was a huge discussion that as I sent ti a null value and CI didn&#8217;t interpret it correctly. </p>
<p>If I send a &#8220;null&#8221; to CI, ActiveRecord must not apply any Fuzilogic to it and it should be treated as null, what CI developers overlooked.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: SeViR</title>
		<link>http://hasin.wordpress.com/2007/04/18/vulnerable-bug-in-codeigniter-which-took-us-hours-to-fix-our-corrupted-database/#comment-11692</link>
		<dc:creator>SeViR</dc:creator>
		<pubDate>Fri, 20 Apr 2007 08:23:13 +0000</pubDate>
		<guid isPermaLink="false">http://hasin.wordpress.com/2007/04/18/vulnerable-bug-in-codeigniter-which-took-us-hours-to-fix-our-corrupted-database/#comment-11692</guid>
		<description>I am a CI fan, at the first, this small problem doesn&#039;t append if you validate the form with form validation class, it is absolutely necessary validate the user input  ( in the client side, and ALLWAYS in the server side ) before database modification, in other case you run with the risk of database corruption ;) . Of course, if your project is a commercial project, this care is more important.</description>
		<content:encoded><![CDATA[<p>I am a CI fan, at the first, this small problem doesn&#8217;t append if you validate the form with form validation class, it is absolutely necessary validate the user input  ( in the client side, and ALLWAYS in the server side ) before database modification, in other case you run with the risk of database corruption <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' />  . Of course, if your project is a commercial project, this care is more important.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jim</title>
		<link>http://hasin.wordpress.com/2007/04/18/vulnerable-bug-in-codeigniter-which-took-us-hours-to-fix-our-corrupted-database/#comment-11645</link>
		<dc:creator>Jim</dc:creator>
		<pubDate>Fri, 20 Apr 2007 01:13:02 +0000</pubDate>
		<guid isPermaLink="false">http://hasin.wordpress.com/2007/04/18/vulnerable-bug-in-codeigniter-which-took-us-hours-to-fix-our-corrupted-database/#comment-11645</guid>
		<description>For the record, I am &quot;JAAulde&quot; from the CI forums (among places) and I want you to know that while I did originate the above quote in your thread at CI,  I did not cross-post it to your blog.

Jim (JAAulde)</description>
		<content:encoded><![CDATA[<p>For the record, I am &#8220;JAAulde&#8221; from the CI forums (among places) and I want you to know that while I did originate the above quote in your thread at CI,  I did not cross-post it to your blog.</p>
<p>Jim (JAAulde)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Thijs</title>
		<link>http://hasin.wordpress.com/2007/04/18/vulnerable-bug-in-codeigniter-which-took-us-hours-to-fix-our-corrupted-database/#comment-11608</link>
		<dc:creator>Thijs</dc:creator>
		<pubDate>Thu, 19 Apr 2007 18:52:22 +0000</pubDate>
		<guid isPermaLink="false">http://hasin.wordpress.com/2007/04/18/vulnerable-bug-in-codeigniter-which-took-us-hours-to-fix-our-corrupted-database/#comment-11608</guid>
		<description>&quot;You found a bug, you reported it, the code is being worked on.  No need to blab all over the word about your “bad experience” with CI.  Especially when the problem was partially yours for not checking your data.  Methinks your ego must be gigantic.&quot; -- JAAulde</description>
		<content:encoded><![CDATA[<p>&#8220;You found a bug, you reported it, the code is being worked on.  No need to blab all over the word about your “bad experience” with CI.  Especially when the problem was partially yours for not checking your data.  Methinks your ego must be gigantic.&#8221; &#8212; JAAulde</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: PHPDeveloper.org</title>
		<link>http://hasin.wordpress.com/2007/04/18/vulnerable-bug-in-codeigniter-which-took-us-hours-to-fix-our-corrupted-database/#comment-11571</link>
		<dc:creator>PHPDeveloper.org</dc:creator>
		<pubDate>Thu, 19 Apr 2007 13:11:20 +0000</pubDate>
		<guid isPermaLink="false">http://hasin.wordpress.com/2007/04/18/vulnerable-bug-in-codeigniter-which-took-us-hours-to-fix-our-corrupted-database/#comment-11571</guid>
		<description>&lt;strong&gt;Hasin Hayder&#039;s Blog: Vulnerable bug in CodeIgniter which took us hours to fix our corrupted database&lt;/strong&gt;

</description>
		<content:encoded><![CDATA[<p><strong>Hasin Hayder&#8217;s Blog: Vulnerable bug in CodeIgniter which took us hours to fix our corrupted database</strong></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: hasin</title>
		<link>http://hasin.wordpress.com/2007/04/18/vulnerable-bug-in-codeigniter-which-took-us-hours-to-fix-our-corrupted-database/#comment-11433</link>
		<dc:creator>hasin</dc:creator>
		<pubDate>Wed, 18 Apr 2007 16:47:13 +0000</pubDate>
		<guid isPermaLink="false">http://hasin.wordpress.com/2007/04/18/vulnerable-bug-in-codeigniter-which-took-us-hours-to-fix-our-corrupted-database/#comment-11433</guid>
		<description>sorry hasan, I am a Big CI Fan. I dont want to f**k it just for this small bug, they themselves will fix it. 

CI Rocks. It makes my life a lot easier than before. 

Regards</description>
		<content:encoded><![CDATA[<p>sorry hasan, I am a Big CI Fan. I dont want to f**k it just for this small bug, they themselves will fix it. </p>
<p>CI Rocks. It makes my life a lot easier than before. </p>
<p>Regards</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: nhm tanveer hossain khan (hasan)</title>
		<link>http://hasin.wordpress.com/2007/04/18/vulnerable-bug-in-codeigniter-which-took-us-hours-to-fix-our-corrupted-database/#comment-11432</link>
		<dc:creator>nhm tanveer hossain khan (hasan)</dc:creator>
		<pubDate>Wed, 18 Apr 2007 16:42:11 +0000</pubDate>
		<guid isPermaLink="false">http://hasin.wordpress.com/2007/04/18/vulnerable-bug-in-codeigniter-which-took-us-hours-to-fix-our-corrupted-database/#comment-11432</guid>
		<description>nice catchup. f**k CI ;)</description>
		<content:encoded><![CDATA[<p>nice catchup. f**k CI <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
</channel>
</rss>
