<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	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:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Pressed Words &#187; mysql_real_escape_string</title>
	<atom:link href="http://pressedwords.com/tag/mysql_real_escape_string/feed/" rel="self" type="application/rss+xml" />
	<link>http://pressedwords.com</link>
	<description>News and commentary about all things WordPress</description>
	<lastBuildDate>Thu, 11 Jun 2009 03:54:22 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=4.1</generator>
	<item>
		<title>Protecting WordPress from SQL Injection Attacks</title>
		<link>http://pressedwords.com/protecting-wordpress-from-sql-injection-attacks/</link>
		<comments>http://pressedwords.com/protecting-wordpress-from-sql-injection-attacks/#comments</comments>
		<pubDate>Wed, 23 Jan 2008 18:31:04 +0000</pubDate>
		<dc:creator><![CDATA[Austin Matzko]]></dc:creator>
				<category><![CDATA[Security]]></category>
		<category><![CDATA[database]]></category>
		<category><![CDATA[mysql_real_escape_string]]></category>
		<category><![CDATA[SQL Injection]]></category>

		<guid isPermaLink="false">http://pressedwords.com/protecting-wordpress-from-sql-injection-attacks/</guid>
		<description><![CDATA[David Kierznowski at BlogSecurity suggests that WordPress is &#8220;insecure by design.&#8221; What he means is that in general WordPress does not sanitize MySQL queries. He recommends that WordPress provide &#8220;a proper set of SQL safe functions (i.e. $wpdb->escape_int and $wpdb->escape_str&#8221; and &#8220;use mysql_real_escape_string(), and have clearly defined coding standards and security policies&#8221; like Drupal does. [&#8230;]]]></description>
				<content:encoded><![CDATA[<p>David Kierznowski at BlogSecurity suggests that <a href="http://blogsecurity.net/wordpress/wordpress-insecure-by-design/">WordPress is &#8220;insecure by design.&#8221;</a>  What he means is that in general WordPress does not sanitize MySQL queries.  He recommends that WordPress provide &#8220;a proper set of SQL safe functions (i.e. $wpdb->escape_int and $wpdb->escape_str&#8221; and &#8220;use mysql_real_escape_string(), and have clearly defined coding standards and security policies&#8221; like Drupal does.  </p>
<p>Actually, the development version of WordPress has been implementing a new &#8220;<code>prepare</code>&#8221; method of the WordPress DB class.  The &#8220;<code>prepare</code>&#8221; method uses <code>vsprintf</code> to makes sure sure, for example, that integers are truly integers, which should accomplish the same thing as Kierznowski&#8217;s proposed <code>escape_int</code> and <code>escape_str</code> methods.  </p>
<p>And WordPress once actually did use <code>mysql_real_escape_string()</code>, over two and a half years ago.  The problem is that <a href="http://wordpress.org/about/requirements/">WordPress&#8217;s minimum requirements specify only that one use PHP version 4.2 or newer</a>.  However, <a href="http://us3.php.net/mysql_real_escape_string"><code>mysql_real_escape_string()</code> was not introduced until PHP version 4.3.0</a>, so WordPress had to rely on an alternate way of escaping queries, one that apparently <a href="http://trac.wordpress.org/changeset/2737">has caused some trouble, so the whole thing was bypassed</a>.  However, <a href="http://trac.wordpress.org/ticket/5416">PHP 4.3.0 functions have crept into development WordPress already</a>, so it&#8217;s likely by the time of the next release (version 2.5) in the spring, that the minimum version will have increased and WordPress will be free to use <code>mysql_real_escape_string</code>.  </p>
]]></content:encoded>
			<wfw:commentRss>http://pressedwords.com/protecting-wordpress-from-sql-injection-attacks/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
	</channel>
</rss>

<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Page Caching using memcached
Database Caching 1/10 queries in 0.003 seconds using memcached
Object Caching 230/246 objects using memcached

 Served from: pressedwords.com @ 2026-04-14 22:10:12 by W3 Total Cache -->