<?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 for SpotTheVuln.com &#187; Develop Secure Code and Identify Security Vulnerabilities</title>
	<atom:link href="http://spotthevuln.com/comments/feed/" rel="self" type="application/rss+xml" />
	<link>http://spotthevuln.com</link>
	<description>Helping Developers Understand Security</description>
	<lastBuildDate>Wed, 17 Aug 2011 15:39:31 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
	<item>
		<title>Comment on Imagination by Helping Developers Understand Security &#124; National Cyber Security</title>
		<link>http://spotthevuln.com/2011/07/imagination/comment-page-1/#comment-2160</link>
		<dc:creator>Helping Developers Understand Security &#124; National Cyber Security</dc:creator>
		<pubDate>Wed, 17 Aug 2011 15:39:31 +0000</pubDate>
		<guid isPermaLink="false">http://spotthevuln.com/?p=1540#comment-2160</guid>
		<description>[...] What about including these weekly challenges in your software security program, so that developers, development managers, and QA staff can test their source code analysis skills and enjoy security by solving them? This week challenge is about&#8230; Imagination. [...]</description>
		<content:encoded><![CDATA[<p>[...] What about including these weekly challenges in your software security program, so that developers, development managers, and QA staff can test their source code analysis skills and enjoy security by solving them? This week challenge is about&#8230; Imagination. [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Boundaries &#8211; SQL Injection by matt cool</title>
		<link>http://spotthevuln.com/2011/08/boundaries-sql-injection/comment-page-1/#comment-2155</link>
		<dc:creator>matt cool</dc:creator>
		<pubDate>Wed, 10 Aug 2011 14:54:18 +0000</pubDate>
		<guid isPermaLink="false">http://spotthevuln.com/?p=1575#comment-2155</guid>
		<description>Is there also a XSRF here? 

 else if (isset($_GET[&#039;mode&#039;]) &amp;&amp; isset($_GET[&#039;category_id&#039;]) &amp;&amp; $_GET[&#039;mode&#039;] == &#039;delete&#039;)

Thanks,
Matt</description>
		<content:encoded><![CDATA[<p>Is there also a XSRF here? </p>
<p> else if (isset($_GET['mode']) &amp;&amp; isset($_GET['category_id']) &amp;&amp; $_GET['mode'] == &#8216;delete&#8217;)</p>
<p>Thanks,<br />
Matt</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Invincible by Validating validation</title>
		<link>http://spotthevuln.com/2011/03/invincible/comment-page-1/#comment-2154</link>
		<dc:creator>Validating validation</dc:creator>
		<pubDate>Wed, 10 Aug 2011 07:08:44 +0000</pubDate>
		<guid isPermaLink="false">http://spotthevuln.com/?p=1391#comment-2154</guid>
		<description>[...] Success in increasing code quality comes from making it very difficult for a developer to do the wrong thing, making sure that the path of least resistance is also the most correct path.  Unfortunately as some programming languages have come to be used as much by designers and artists than the more mathematically included coder of old, a mindset of working around the coder and giving them results that they expect rather than what they’ve asked for has become common.  This leads the developers to think they’re doing the right thing, while actually shooting themselves in the foot.  A friend of mine (hat tip to @suburbsec) pointed me to a very good example of this the other day on one of spotthevuln.com’s latest entries. [...]</description>
		<content:encoded><![CDATA[<p>[...] Success in increasing code quality comes from making it very difficult for a developer to do the wrong thing, making sure that the path of least resistance is also the most correct path.  Unfortunately as some programming languages have come to be used as much by designers and artists than the more mathematically included coder of old, a mindset of working around the coder and giving them results that they expect rather than what they’ve asked for has become common.  This leads the developers to think they’re doing the right thing, while actually shooting themselves in the foot.  A friend of mine (hat tip to @suburbsec) pointed me to a very good example of this the other day on one of spotthevuln.com’s latest entries. [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Boundaries by Christina</title>
		<link>http://spotthevuln.com/2011/08/boundaries/comment-page-1/#comment-2151</link>
		<dc:creator>Christina</dc:creator>
		<pubDate>Fri, 05 Aug 2011 20:30:10 +0000</pubDate>
		<guid isPermaLink="false">http://spotthevuln.com/?p=1572#comment-2151</guid>
		<description>I just realised something about this.  If mysql_escape_string doesn&#039;t escape the % character, would that allow us to put in something like, say, %22 for a double-quote character?  It would be the same as with some URLs having %20 in place of a space character, wouldn&#039;t it? Or would that work with this?  Just a thought.</description>
		<content:encoded><![CDATA[<p>I just realised something about this.  If mysql_escape_string doesn&#8217;t escape the % character, would that allow us to put in something like, say, %22 for a double-quote character?  It would be the same as with some URLs having %20 in place of a space character, wouldn&#8217;t it? Or would that work with this?  Just a thought.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Boundaries by Christina</title>
		<link>http://spotthevuln.com/2011/08/boundaries/comment-page-1/#comment-2150</link>
		<dc:creator>Christina</dc:creator>
		<pubDate>Fri, 05 Aug 2011 17:36:45 +0000</pubDate>
		<guid isPermaLink="false">http://spotthevuln.com/?p=1572#comment-2150</guid>
		<description>Wow, this one is tougher.  The only thing I can see, aside from not knowing where some of the variables are defined, is that the coder uses mysql_escape_string, which has a great big red danger sign on the documentation page saying that it&#039;s deprecated.  It doesn&#039;t escape % or _.  Does this open us up to injection?  It also says that the new function escapes according to the current character set.

Can WP_CALENDAR_CATEGORIES_TABLE or WP_CALENDAR_TABLE be changed by an attacker? I&#039;m sort of assuming not, but assuming can get one in trouble. :)

If they can be, though, then it could be an SQL injection.

Related to SQL injection, but not to this particular code: Would it completely eliminate SQL vulnerabilities to use a function that sanitises inclusively instead of exclusively? For example, instead of looking for specific characters to escape, it woulde escape everything not on a &quot;whitelist&quot; of allowable characters - or scold the user if they try to use anything other than what we want them to use, say letters and numbers only.  It could limit globalisation, but it would be more secure.  Just an idea.</description>
		<content:encoded><![CDATA[<p>Wow, this one is tougher.  The only thing I can see, aside from not knowing where some of the variables are defined, is that the coder uses mysql_escape_string, which has a great big red danger sign on the documentation page saying that it&#8217;s deprecated.  It doesn&#8217;t escape % or _.  Does this open us up to injection?  It also says that the new function escapes according to the current character set.</p>
<p>Can WP_CALENDAR_CATEGORIES_TABLE or WP_CALENDAR_TABLE be changed by an attacker? I&#8217;m sort of assuming not, but assuming can get one in trouble. <img src='http://spotthevuln.com/wordpress/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>If they can be, though, then it could be an SQL injection.</p>
<p>Related to SQL injection, but not to this particular code: Would it completely eliminate SQL vulnerabilities to use a function that sanitises inclusively instead of exclusively? For example, instead of looking for specific characters to escape, it woulde escape everything not on a &#8220;whitelist&#8221; of allowable characters &#8211; or scold the user if they try to use anything other than what we want them to use, say letters and numbers only.  It could limit globalisation, but it would be more secure.  Just an idea.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Boundaries by Jon Zobrist</title>
		<link>http://spotthevuln.com/2011/08/boundaries/comment-page-1/#comment-2147</link>
		<dc:creator>Jon Zobrist</dc:creator>
		<pubDate>Tue, 02 Aug 2011 05:51:43 +0000</pubDate>
		<guid isPermaLink="false">http://spotthevuln.com/?p=1572#comment-2147</guid>
		<description>Rampant use of deprecated function mysql_escape_string() which &quot;does not escape % and _&quot; according to the linked man page. Especially bad is that % which is MySQL wildcard.
Any of the queries passed directly to MySQL with this could result in rampantly bad behavior...
WHERE category_id=&quot;.mysql_escape_string($_POST[&#039;category_id&#039;]);
If $_POST[&#039;category_id&#039;] where say iterated from 0% ... 9%</description>
		<content:encoded><![CDATA[<p>Rampant use of deprecated function mysql_escape_string() which &#8220;does not escape % and _&#8221; according to the linked man page. Especially bad is that % which is MySQL wildcard.<br />
Any of the queries passed directly to MySQL with this could result in rampantly bad behavior&#8230;<br />
WHERE category_id=&#8221;.mysql_escape_string($_POST['category_id']);<br />
If $_POST['category_id'] where say iterated from 0% &#8230; 9%</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Floods &#8211; SQL Injection by Yuliy</title>
		<link>http://spotthevuln.com/2011/08/floods-sql-injection/comment-page-1/#comment-2146</link>
		<dc:creator>Yuliy</dc:creator>
		<pubDate>Mon, 01 Aug 2011 07:14:05 +0000</pubDate>
		<guid isPermaLink="false">http://spotthevuln.com/?p=1569#comment-2146</guid>
		<description>There&#039;s also a vulnerability due to insufficient escaping and validation of data going into the log file. An attacker can easily generate arbitrary entries in the log file by embedding newlines into $_POST[&#039;info&#039;] and $_POST[&#039;user&#039;]</description>
		<content:encoded><![CDATA[<p>There&#8217;s also a vulnerability due to insufficient escaping and validation of data going into the log file. An attacker can easily generate arbitrary entries in the log file by embedding newlines into $_POST['info'] and $_POST['user']</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Floods by PHP, Solution, SQL Injection Vulnerability Code Example &#171; SpotTheVuln.com</title>
		<link>http://spotthevuln.com/2011/07/floods/comment-page-1/#comment-2145</link>
		<dc:creator>PHP, Solution, SQL Injection Vulnerability Code Example &#171; SpotTheVuln.com</dc:creator>
		<pubDate>Mon, 01 Aug 2011 07:03:44 +0000</pubDate>
		<guid isPermaLink="false">http://spotthevuln.com/?p=1565#comment-2145</guid>
		<description>[...]  [...]</description>
		<content:encoded><![CDATA[<p>[...]  [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Floods by Christina</title>
		<link>http://spotthevuln.com/2011/07/floods/comment-page-1/#comment-2144</link>
		<dc:creator>Christina</dc:creator>
		<pubDate>Fri, 29 Jul 2011 16:56:26 +0000</pubDate>
		<guid isPermaLink="false">http://spotthevuln.com/?p=1565#comment-2144</guid>
		<description>Ok ... first try here.  I&#039;m not overly good with PHP, but I think this one is an obvious SQL injection (obvious because even I can see it!).  The coder pulls $id, $info, and $user straight from POST and GET (lines 13-20), never sanitizes, escapes, or validates any of it, and puts it straight into the query on lines 31 and 32. At least, I don&#039;t see any validation or anything.  And, as I understand it, both POST and GET can be manipulated by the attacker.

If I&#039;m not mistaken, even if you turn off SQL by setting $use_mysql to something else, couldn&#039;t you still screw up the logs a little with some garbage? Line 41 seems to do the same as the injection, only it just puts it straight to the log file.

Did I win? :D</description>
		<content:encoded><![CDATA[<p>Ok &#8230; first try here.  I&#8217;m not overly good with PHP, but I think this one is an obvious SQL injection (obvious because even I can see it!).  The coder pulls $id, $info, and $user straight from POST and GET (lines 13-20), never sanitizes, escapes, or validates any of it, and puts it straight into the query on lines 31 and 32. At least, I don&#8217;t see any validation or anything.  And, as I understand it, both POST and GET can be manipulated by the attacker.</p>
<p>If I&#8217;m not mistaken, even if you turn off SQL by setting $use_mysql to something else, couldn&#8217;t you still screw up the logs a little with some garbage? Line 41 seems to do the same as the injection, only it just puts it straight to the log file.</p>
<p>Did I win? <img src='http://spotthevuln.com/wordpress/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Grammys by Cross-Site Scripting (XSS), PHP, Solution Vulnerability Code Example &#171; SpotTheVuln.com</title>
		<link>http://spotthevuln.com/2011/07/grammys/comment-page-1/#comment-2140</link>
		<dc:creator>Cross-Site Scripting (XSS), PHP, Solution Vulnerability Code Example &#171; SpotTheVuln.com</dc:creator>
		<pubDate>Wed, 27 Jul 2011 06:02:18 +0000</pubDate>
		<guid isPermaLink="false">http://spotthevuln.com/?p=1558#comment-2140</guid>
		<description>[...]  [...]</description>
		<content:encoded><![CDATA[<p>[...]  [...]</p>
]]></content:encoded>
	</item>
</channel>
</rss>

