<?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/"
		>
<channel>
	<title>Comments on: Mongodb is vulnerable to SQL injection in PHP at least</title>
	<atom:link href="http://www.idontplaydarts.com/2010/07/mongodb-is-vulnerable-to-sql-injection-in-php-at-least/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.idontplaydarts.com/2010/07/mongodb-is-vulnerable-to-sql-injection-in-php-at-least/</link>
	<description>PHP &#38; LAMP Stack Security</description>
	<lastBuildDate>Tue, 31 Jan 2012 14:07:48 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	
	<item>
		<title>By: witty</title>
		<link>http://www.idontplaydarts.com/2010/07/mongodb-is-vulnerable-to-sql-injection-in-php-at-least/#comment-1071</link>
		<dc:creator>witty</dc:creator>
		<pubDate>Sun, 01 Jan 2012 16:15:34 +0000</pubDate>
		<guid isPermaLink="false">http://www.idontplaydarts.com/?p=22#comment-1071</guid>
		<description>well Andrew ,
But where can we find the code of the functions :
get_string()
and/or
get()

I can&#039;t find them in the http://php.net/manual/ !</description>
		<content:encoded><![CDATA[<p>well Andrew ,<br />
But where can we find the code of the functions :<br />
get_string()<br />
and/or<br />
get()</p>
<p>I can&#8217;t find them in the <a href="http://php.net/manual/" rel="nofollow">http://php.net/manual/</a> !</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Andrew</title>
		<link>http://www.idontplaydarts.com/2010/07/mongodb-is-vulnerable-to-sql-injection-in-php-at-least/#comment-163</link>
		<dc:creator>Andrew</dc:creator>
		<pubDate>Tue, 05 Jul 2011 08:14:34 +0000</pubDate>
		<guid isPermaLink="false">http://www.idontplaydarts.com/?p=22#comment-163</guid>
		<description>Nice catch! Just a suggestion though: never access $_GET directly. Always use a getter function, to which developer MUST specify the expected format. This approach solves most of the web application security problems. 

For instance:
&quot;username&quot; =&gt; get(&#039;username&#039;, GET_STRING, &#039;/^[a-zA-Z0-9]+$/&#039;)
(regex is optional)

Or:
&quot;username&quot; =&gt; get_string(&#039;username&#039;, &#039;/^[a-zA-Z0-9]+$/&#039;)

Function get() should be the only way to access $_GET. You should even rename $_GET to make sure developers obey this convention. 

My 0.02 EUR.</description>
		<content:encoded><![CDATA[<p>Nice catch! Just a suggestion though: never access $_GET directly. Always use a getter function, to which developer MUST specify the expected format. This approach solves most of the web application security problems. </p>
<p>For instance:<br />
&#8220;username&#8221; =&gt; get(&#8216;username&#8217;, GET_STRING, &#8216;/^[a-zA-Z0-9]+$/&#8217;)<br />
(regex is optional)</p>
<p>Or:<br />
&#8220;username&#8221; =&gt; get_string(&#8216;username&#8217;, &#8216;/^[a-zA-Z0-9]+$/&#8217;)</p>
<p>Function get() should be the only way to access $_GET. You should even rename $_GET to make sure developers obey this convention. </p>
<p>My 0.02 EUR.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: phil</title>
		<link>http://www.idontplaydarts.com/2010/07/mongodb-is-vulnerable-to-sql-injection-in-php-at-least/#comment-5</link>
		<dc:creator>phil</dc:creator>
		<pubDate>Mon, 21 Feb 2011 07:17:44 +0000</pubDate>
		<guid isPermaLink="false">http://www.idontplaydarts.com/?p=22#comment-5</guid>
		<description>Your code would work but this would also work and means you don&#039;t have to declare $username. 

&lt;blockquote&gt;
&quot;username&quot; =&gt; &quot;{$_GET[&#039;username&#039;]}&quot;
&lt;/blockquote&gt;

Either way as long as the input to mongodb remains a string your safe :)</description>
		<content:encoded><![CDATA[<p>Your code would work but this would also work and means you don&#8217;t have to declare $username. </p>
<blockquote><p>
&#8220;username&#8221; => &#8220;{$_GET['username']}&#8221;
</p></blockquote>
<p>Either way as long as the input to mongodb remains a string your safe :)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Michael Grech</title>
		<link>http://www.idontplaydarts.com/2010/07/mongodb-is-vulnerable-to-sql-injection-in-php-at-least/#comment-4</link>
		<dc:creator>Michael Grech</dc:creator>
		<pubDate>Sun, 20 Feb 2011 07:48:22 +0000</pubDate>
		<guid isPermaLink="false">http://www.idontplaydarts.com/?p=22#comment-4</guid>
		<description>Ah answered my own question. So you could do something like the following as well:

&lt;blockquote&gt;$username = $_GET[&#039;username&#039;]&lt;/blockquote&gt;

than...

&lt;blockquote&gt;“username” =&gt; “$username&quot;&lt;/blockquote&gt;

</description>
		<content:encoded><![CDATA[<p>Ah answered my own question. So you could do something like the following as well:</p>
<blockquote><p>$username = $_GET['username']</p></blockquote>
<p>than&#8230;</p>
<blockquote><p>“username” =&gt; “$username&#8221;</p></blockquote>
]]></content:encoded>
	</item>
	<item>
		<title>By: Michael Grech</title>
		<link>http://www.idontplaydarts.com/2010/07/mongodb-is-vulnerable-to-sql-injection-in-php-at-least/#comment-3</link>
		<dc:creator>Michael Grech</dc:creator>
		<pubDate>Sun, 20 Feb 2011 07:39:21 +0000</pubDate>
		<guid isPermaLink="false">http://www.idontplaydarts.com/?p=22#comment-3</guid>
		<description>Hey Phil, thanks for the post. Would this work as well than? Note the double quotes.

&lt;blockquote&gt;&quot;username&quot; =&gt; &quot;$_GET[&#039;username&#039;] &quot;&lt;/blockquote&gt;

</description>
		<content:encoded><![CDATA[<p>Hey Phil, thanks for the post. Would this work as well than? Note the double quotes.</p>
<blockquote><p>&#8220;username&#8221; =&gt; &#8220;$_GET['username'] &#8220;</p></blockquote>
]]></content:encoded>
	</item>
</channel>
</rss>

