<?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>2718.us blog &#187; security</title>
	<atom:link href="http://2718.us/blog/tag/security/feed/" rel="self" type="application/rss+xml" />
	<link>http://2718.us/blog</link>
	<description>Miscellaneous Technological Geekery</description>
	<lastBuildDate>Tue, 18 May 2010 02:42:55 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.4</generator>
		<item>
		<title>A Variety of Issues with Pseudo-Random Numbers in PHP</title>
		<link>http://2718.us/blog/2008/08/31/a-variety-of-issues-with-pseudo-random-numbers-in-php/</link>
		<comments>http://2718.us/blog/2008/08/31/a-variety-of-issues-with-pseudo-random-numbers-in-php/#comments</comments>
		<pubDate>Mon, 01 Sep 2008 01:10:22 +0000</pubDate>
		<dc:creator>2718.us</dc:creator>
				<category><![CDATA[Web Programming]]></category>
		<category><![CDATA[/dev/random]]></category>
		<category><![CDATA[/dev/srandom]]></category>
		<category><![CDATA[mersenne twister]]></category>
		<category><![CDATA[mt_rand]]></category>
		<category><![CDATA[password]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[prng]]></category>
		<category><![CDATA[pseudo-random number]]></category>
		<category><![CDATA[pseudo-random number generator]]></category>
		<category><![CDATA[pseudorandom number generator]]></category>
		<category><![CDATA[rand]]></category>
		<category><![CDATA[random]]></category>
		<category><![CDATA[random number]]></category>
		<category><![CDATA[random number generator]]></category>
		<category><![CDATA[rng]]></category>
		<category><![CDATA[security]]></category>

		<guid isPermaLink="false">http://2718.us/blog/?p=106</guid>
		<description><![CDATA[It appears that there are now demonstrated exploits of PHP apps that use mt_rand() and/or rand() as a result of issues of seeding in one application affecting the PRNG stream in another application that used the PRNG to generate passwords or similar such things.  From mt_srand and not so random numbers: &#8230; it is strongly [...]]]></description>
			<content:encoded><![CDATA[<p>It appears that there are now demonstrated exploits of PHP apps that use mt_rand() and/or rand() as a result of issues of seeding in one application affecting the PRNG stream in another application that used the PRNG to generate passwords or similar such things.  From <a href="http://www.suspekt.org/2008/08/17/mt_srand-and-not-so-random-numbers/">mt_srand and not so random numbers</a>:</p>
<blockquote><p>&#8230; it is strongly recommended for the PHP developers to add more secure random number functions to the PHP core and it is strongly recommended for PHP application developers to keep their fingers away from srand() or mt_srand() and to never ever use rand() or mt_rand() for cryptographic secrets.</p></blockquote>
<p>It sounds like the PRNGs in PHP, mt_rand() and rand(), shouldn&#8217;t be used for anything security-related, and perhaps /dev/random or /dev/srandom or some such should be used instead (though this is much more system-dependent).</p>
]]></content:encoded>
			<wfw:commentRss>http://2718.us/blog/2008/08/31/a-variety-of-issues-with-pseudo-random-numbers-in-php/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Authenticating with WordPress 2.6 (part 3)</title>
		<link>http://2718.us/blog/2008/08/03/authenticating-with-wordpress-26-part-3/</link>
		<comments>http://2718.us/blog/2008/08/03/authenticating-with-wordpress-26-part-3/#comments</comments>
		<pubDate>Sun, 03 Aug 2008 23:55:48 +0000</pubDate>
		<dc:creator>2718.us</dc:creator>
				<category><![CDATA[Web Programming]]></category>
		<category><![CDATA[2.6]]></category>
		<category><![CDATA[action hook]]></category>
		<category><![CDATA[add_action]]></category>
		<category><![CDATA[admin_cookie_path]]></category>
		<category><![CDATA[authentication]]></category>
		<category><![CDATA[auth_redirect]]></category>
		<category><![CDATA[cookie]]></category>
		<category><![CDATA[cookie path]]></category>
		<category><![CDATA[cookie paths]]></category>
		<category><![CDATA[COOKIEPATH]]></category>
		<category><![CDATA[cookies]]></category>
		<category><![CDATA[do_action]]></category>
		<category><![CDATA[hook]]></category>
		<category><![CDATA[is_user_logged_in]]></category>
		<category><![CDATA[plugin]]></category>
		<category><![CDATA[plugin api]]></category>
		<category><![CDATA[security]]></category>
		<category><![CDATA[set_auth_cookie]]></category>
		<category><![CDATA[user]]></category>
		<category><![CDATA[user authentication]]></category>
		<category><![CDATA[user login]]></category>
		<category><![CDATA[wordpress]]></category>
		<category><![CDATA[wordpress 2.6]]></category>
		<category><![CDATA[wp]]></category>
		<category><![CDATA[wp2.6]]></category>

		<guid isPermaLink="false">http://2718.us/blog/?p=82</guid>
		<description><![CDATA[So, as a followup to parts 1 and 2, per WordPress Trac ticket #7001, WordPress 2.6 has split up the login cookies into three parts: what was the one and only login cookie in 2.5 is now limited to /wp-admin there&#8217;s a copy of that one that&#8217;s just limited to /wp-content/plugins, for backward compatibility with [...]]]></description>
			<content:encoded><![CDATA[<p>So, as a followup to parts <a href="http://2718.us/blog/2008/07/29/authenticating-with-wordpress-26-part-1/">1</a> and <a href="http://2718.us/blog/2008/07/29/authenticating-with-wordpress-26-part-2/">2</a>, per <a href="http://trac.wordpress.org/">WordPress Trac</a> <a href="http://trac.wordpress.org/ticket/7001">ticket #7001</a>, WordPress 2.6 has split up the login cookies into three parts:</p>
<ul>
<li>what was the one and only login cookie in 2.5 is now limited to /wp-admin</li>
<li>there&#8217;s a copy of that one that&#8217;s just limited to /wp-content/plugins, for backward compatibility with plugins</li>
<li>there&#8217;s a new cookie that is at COOKIEPATH (which can be defined in your config file), that is checked by calling
<pre>is_user_logged_in()</pre>
<p> (but perhaps this isn&#8217;t intended for secure authorization?)</li>
</ul>
<p>So, it appears the way to go may be to change
<pre>auth_redirect()</pre>
<p> to </p>
<div class="geshi no php">
<ol>
<li class="li1">
<div class="de1"><span class="kw1">if</span> <span class="br0">&#40;</span><span class="sy0">!</span>is_user_logged_in<span class="br0">&#40;</span><span class="br0">&#41;</span><span class="br0">&#41;</span> auth_redirect<span class="br0">&#40;</span><span class="br0">&#41;</span><span class="sy0">;</span></div>
</li>
</ol>
</div>
<p>Maybe more to follow on this when I&#8217;ve more thoroughly explored it.</p>
]]></content:encoded>
			<wfw:commentRss>http://2718.us/blog/2008/08/03/authenticating-with-wordpress-26-part-3/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>Authenticating with WordPress 2.6 (part 2)</title>
		<link>http://2718.us/blog/2008/07/29/authenticating-with-wordpress-26-part-2/</link>
		<comments>http://2718.us/blog/2008/07/29/authenticating-with-wordpress-26-part-2/#comments</comments>
		<pubDate>Wed, 30 Jul 2008 04:32:54 +0000</pubDate>
		<dc:creator>2718.us</dc:creator>
				<category><![CDATA[Web Programming]]></category>
		<category><![CDATA[2.6]]></category>
		<category><![CDATA[action hook]]></category>
		<category><![CDATA[add_action]]></category>
		<category><![CDATA[admin_cookie_path]]></category>
		<category><![CDATA[authentication]]></category>
		<category><![CDATA[auth_redirect]]></category>
		<category><![CDATA[cookie]]></category>
		<category><![CDATA[cookie path]]></category>
		<category><![CDATA[cookie paths]]></category>
		<category><![CDATA[cookies]]></category>
		<category><![CDATA[do_action]]></category>
		<category><![CDATA[hook]]></category>
		<category><![CDATA[plugin]]></category>
		<category><![CDATA[plugin api]]></category>
		<category><![CDATA[security]]></category>
		<category><![CDATA[set_auth_cookie]]></category>
		<category><![CDATA[user]]></category>
		<category><![CDATA[user authentication]]></category>
		<category><![CDATA[user login]]></category>
		<category><![CDATA[wordpress]]></category>
		<category><![CDATA[wordpress 2.6]]></category>
		<category><![CDATA[wp]]></category>
		<category><![CDATA[wp2.6]]></category>

		<guid isPermaLink="false">http://2718.us/blog/?p=70</guid>
		<description><![CDATA[Having stated the problem and now played further, I&#8217;ve got good news and bad news. The good news is that there&#8217;s an action hook, &#8216;set_auth_cookie&#8217;, that gets called whenever the cookies are set, so if the stuff for which you want to authenticate is on the same server but at a different path, you can [...]]]></description>
			<content:encoded><![CDATA[<p>Having <a href="http://2718.us/blog/2008/07/29/authenticating-with-wordpress-26-part-1/">stated the problem</a> and now played further, I&#8217;ve got good news and bad news.</p>
<p>The good news is that there&#8217;s an action hook, &#8216;set_auth_cookie&#8217;, that gets called whenever the cookies are set, so if the stuff for which you want to authenticate is on the same server but at a different path, you can create a plugin (or maybe use functions.php in your theme?) with something like the following:</p>
<div class="geshi no php">
<ol>
<li class="li1">
<div class="de1"><span class="kw2">function</span> your_unique_name_here_set_auth_cookie<span class="br0">&#40;</span><span class="re1">$auth_cookie</span><span class="sy0">,</span> <span class="re1">$expire</span><span class="sy0">,</span> <span class="re1">$expiration</span><span class="sy0">,</span> <span class="re1">$user_id</span><span class="sy0">,</span> <span class="re1">$scheme</span><span class="br0">&#41;</span> <span class="br0">&#123;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; <span class="kw3">setcookie</span><span class="br0">&#40;</span>AUTH_COOKIE<span class="sy0">,</span> <span class="re1">$auth_cookie</span><span class="sy0">,</span> <span class="re1">$expire</span><span class="sy0">,</span> <span class="st0">&#39;/path/to/your/stuff&#39;</span><span class="sy0">,</span> COOKIE_DOMAIN<span class="br0">&#41;</span><span class="sy0">;</span></div>
</li>
<li class="li1">
<div class="de1"><span class="br0">&#125;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li1">
<div class="de1">add_action<span class="br0">&#40;</span><span class="st0">&#39;set_auth_cookie&#39;</span><span class="sy0">,</span><span class="st0">&#39;your_unique_name_here_set_auth_cookie&#39;</span><span class="sy0">,</span><span class="nu0">10</span><span class="sy0">,</span><span class="nu0">5</span><span class="br0">&#41;</span><span class="sy0">;</span></div>
</li>
</ol>
</div>
<p>The bad news is that if your WordPress install is at example.com/something and you want to use it to authenticate at portal.example.com, you can&#8217;t set a cookie for portal.example.com from a script on example.com, so your only choice would be to set a cookie with path / on .example.com (note the leading period), which completely breaks the security added by the separate cookies.</p>
<p>Hopefully, there&#8217;ll be a &#8220;part 3&#8243; to this wherein I solve this last problem somehow, since that&#8217;s the setup I&#8217;m dealing with.</p>
]]></content:encoded>
			<wfw:commentRss>http://2718.us/blog/2008/07/29/authenticating-with-wordpress-26-part-2/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Authenticating with WordPress 2.6 (part 1)</title>
		<link>http://2718.us/blog/2008/07/29/authenticating-with-wordpress-26-part-1/</link>
		<comments>http://2718.us/blog/2008/07/29/authenticating-with-wordpress-26-part-1/#comments</comments>
		<pubDate>Wed, 30 Jul 2008 03:03:51 +0000</pubDate>
		<dc:creator>2718.us</dc:creator>
				<category><![CDATA[Web Programming]]></category>
		<category><![CDATA[2.6]]></category>
		<category><![CDATA[admin_cookie_path]]></category>
		<category><![CDATA[authentication]]></category>
		<category><![CDATA[auth_redirect]]></category>
		<category><![CDATA[cookie]]></category>
		<category><![CDATA[cookie path]]></category>
		<category><![CDATA[cookie paths]]></category>
		<category><![CDATA[cookies]]></category>
		<category><![CDATA[security]]></category>
		<category><![CDATA[user]]></category>
		<category><![CDATA[user authentication]]></category>
		<category><![CDATA[user login]]></category>
		<category><![CDATA[wordpress]]></category>
		<category><![CDATA[wordpress 2.6]]></category>
		<category><![CDATA[wp]]></category>
		<category><![CDATA[wp2.6]]></category>

		<guid isPermaLink="false">http://2718.us/blog/?p=68</guid>
		<description><![CDATA[I&#8217;ve been hoping for the last hour or two that there&#8217;d be just one post on this topic, giving the problem and solution all together, but I have yet to solve it and so I&#8217;m just going to post the issue for now, until I have a solution. As a security measure in WP2.6, login [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been hoping for the last hour or two that there&#8217;d be just one post on this topic, giving the problem and solution all together, but I have yet to solve it and so I&#8217;m just going to post the issue for now, until I have a solution.</p>
<p>As a security measure in WP2.6, login cookies are now split into what seem to be at least three different cookies—two with paths like /wp-admin and /wp-content/plugins that are the full cookie that auth_redirect() checks against and one that&#8217;s different, with path / [paths relative to the blog root].  Near as I can tell, this immediately breaks any attempt to use auth_redirect() for authentication (e.g. <a href="http://2718.us/blog/2008/04/12/using-wordpress-for-user-authentication/">this</a> and <a href="http://2718.us/blog/2008/04/16/using-wordpress-for-user-authentication-part-2/">this</a>) outside the /wp-admin and /wp-content/plugins directories.  It is also not immediately clear to me how to authenticate against the whole-site cookie, if there&#8217;s any way to do that at all.</p>
<p>A temporary, but <strong>very bad</strong> fix would be to completely defeat the security by defining ADMIN_COOKIE_PATH to be the site root, rather than the path to /wp-admin.  I&#8217;m thinking that, from a quick skim of pluggable.php, there might be plugin action hooks to allow setting other cookies that would allow authentication on other paths&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://2718.us/blog/2008/07/29/authenticating-with-wordpress-26-part-1/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Since I already Mentioned OpenBSD for Routers&#8230;</title>
		<link>http://2718.us/blog/2008/05/18/since-i-already-mentioned-openbsd-for-routers/</link>
		<comments>http://2718.us/blog/2008/05/18/since-i-already-mentioned-openbsd-for-routers/#comments</comments>
		<pubDate>Sun, 18 May 2008 16:12:48 +0000</pubDate>
		<dc:creator>2718.us</dc:creator>
				<category><![CDATA[Networking]]></category>
		<category><![CDATA[cartoon]]></category>
		<category><![CDATA[comic]]></category>
		<category><![CDATA[debian]]></category>
		<category><![CDATA[openbsd]]></category>
		<category><![CDATA[openssh]]></category>
		<category><![CDATA[openssl]]></category>
		<category><![CDATA[security]]></category>
		<category><![CDATA[xkcd]]></category>

		<guid isPermaLink="false">http://2718.us/blog/?p=36</guid>
		<description><![CDATA[I subscribe to a few security-alert email lists, most of which I skim and delete (since I already know that there are new fixes for multiple vulnerabilities in MS Windows and/or Office without being told and since I don&#8217;t care about issues with multi-thousand-dollar Oracle/Cisco/Sun products).  It&#8217;s rare that an alert really catches my eye [...]]]></description>
			<content:encoded><![CDATA[<p>I subscribe to a few security-alert email lists, most of which I skim and delete (since I already know that there are new fixes for multiple vulnerabilities in MS Windows and/or Office without being told and since I don&#8217;t care about issues with multi-thousand-dollar Oracle/Cisco/Sun products).  It&#8217;s rare that an alert really catches my eye the way the Debian/OpenSSL thing did.  I think the key thing to point out is that it seems that somewhere along the way someone in the Debian realm broke OpenSSL&#8211;that&#8217;s why this is a Debian-specific issue.  I&#8217;d also like to point out that this is why I use OpenBSD for high-security machines (i.e. router/firewall machines): careful, detailed security auditing.</p>
<p><a href="http://xkcd.com/424/"><img style="border: 0pt none;" src="http://imgs.xkcd.com/comics/security_holes.png" alt="security holes comic from xkcd" width="493" height="527" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://2718.us/blog/2008/05/18/since-i-already-mentioned-openbsd-for-routers/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The SECRET_KEY in WordPress</title>
		<link>http://2718.us/blog/2008/04/24/the-secret_key-in-wordpress/</link>
		<comments>http://2718.us/blog/2008/04/24/the-secret_key-in-wordpress/#comments</comments>
		<pubDate>Thu, 24 Apr 2008 22:20:59 +0000</pubDate>
		<dc:creator>2718.us</dc:creator>
				<category><![CDATA[Blogging]]></category>
		<category><![CDATA[bbpress]]></category>
		<category><![CDATA[cookies]]></category>
		<category><![CDATA[integrate]]></category>
		<category><![CDATA[integration]]></category>
		<category><![CDATA[SECRET_KEY]]></category>
		<category><![CDATA[security]]></category>
		<category><![CDATA[wordpress]]></category>
		<category><![CDATA[wordpress 2.5]]></category>
		<category><![CDATA[wp]]></category>
		<category><![CDATA[wp2.5]]></category>

		<guid isPermaLink="false">http://2718.us/blog/?p=27</guid>
		<description><![CDATA[I&#8217;ve gotten into the habit of actually reading the various blogs to which there are links on my WordPress dashboard and I saw this today from boren.nu: To make cookies secure against attacks where someone has managed to get into your database through an SQL injection exploit or other means, WordPress 2.5 introduced a user-definable [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve gotten into the habit of actually reading the various blogs to which there are links on my WordPress dashboard and I saw <a href="http://boren.nu/archives/2008/04/24/cookie-security-in-wordpress-25/">this today from boren.nu</a>:</p>
<blockquote><p>To make cookies secure against attacks where someone has managed to get into your database through an SQL injection exploit or other means, WordPress 2.5 introduced a user-definable constant called SECRET_KEY. If you look at the sample wp-config.php shipped with 2.5, you’ll see these lines.</p>
<blockquote><p>// Change SECRET_KEY to a unique phrase.  You won’t have to remember it later,<br />
// so make it long and complicated.  You can visit https://www.grc.com/passwords<br />
.htm<br />
// to get a phrase generated for you, or just make something up.<br />
define(’SECRET_KEY’, ‘put your unique phrase here’); // Change this to a unique phrase</p></blockquote>
<p>If you upgraded from a previous version of WordPress you probably won’t have these lines in your wp-config.php.</p></blockquote>
<p>That last bit is, of course, the critical thing for me and had me going back and inserting SECRET_KEYs into all my older/upgraded WordPress installs.  Just remember that if you&#8217;re integrating with bbPress, you have to match the SECRET_KEYs in wp-config.php and bb-config.php.</p>
]]></content:encoded>
			<wfw:commentRss>http://2718.us/blog/2008/04/24/the-secret_key-in-wordpress/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Matt (yes, that Matt) on WordPress Security</title>
		<link>http://2718.us/blog/2008/04/14/matt-yes-that-matt-on-wordpress-security/</link>
		<comments>http://2718.us/blog/2008/04/14/matt-yes-that-matt-on-wordpress-security/#comments</comments>
		<pubDate>Mon, 14 Apr 2008 17:28:56 +0000</pubDate>
		<dc:creator>2718.us</dc:creator>
				<category><![CDATA[Blogging]]></category>
		<category><![CDATA[alert]]></category>
		<category><![CDATA[false alarm]]></category>
		<category><![CDATA[false alert]]></category>
		<category><![CDATA[faulkner]]></category>
		<category><![CDATA[hack]]></category>
		<category><![CDATA[ma.tt]]></category>
		<category><![CDATA[macbeth]]></category>
		<category><![CDATA[security]]></category>
		<category><![CDATA[shakespeare]]></category>
		<category><![CDATA[sound and fury]]></category>
		<category><![CDATA[sql]]></category>
		<category><![CDATA[wordpress]]></category>
		<category><![CDATA[wp]]></category>

		<guid isPermaLink="false">http://2718.us/blog/?p=19</guid>
		<description><![CDATA[Even though the post title and first paragraph are about calling out a sound-and-fury-signifying-nothing alert, most of his post is good stuff on WordPress, with lots of links. &#8230; there is a wave of attacks going around targeting old WordPress blogs, particularly those on the 2.1 or 2.2 branch. They’re exploiting problems that have been [...]]]></description>
			<content:encoded><![CDATA[<p>Even though the post title and first paragraph are about calling out a sound-and-fury-signifying-nothing alert, most of <a href="http://ma.tt/2008/04/securityfocus-sql-injection-bogus/">his post</a> is good stuff on WordPress, with lots of links.</p>
<blockquote><p>&#8230; there is a wave of attacks going around targeting <em>old</em> WordPress blogs, particularly those on the 2.1 or 2.2 branch. They’re exploiting problems that have been fixed for a year or more. This typically manifests itself through hidden spam being put on your site, either in the post or in a directory, and people notice when they get dropped from Google.</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://2718.us/blog/2008/04/14/matt-yes-that-matt-on-wordpress-security/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

