<?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>More Than Scratch The Surface &#187; security</title>
	<atom:link href="http://www.scratch99.com/tag/security/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.scratch99.com</link>
	<description>A Journey In Web Development</description>
	<lastBuildDate>Mon, 30 Aug 2010 23:52:14 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>The Solution To The Lack Of WordPress Beta Testing</title>
		<link>http://www.scratch99.com/2010/02/the-solution-to-the-lack-of-wordpress-beta-testing/</link>
		<comments>http://www.scratch99.com/2010/02/the-solution-to-the-lack-of-wordpress-beta-testing/#comments</comments>
		<pubDate>Thu, 11 Feb 2010 03:23:24 +0000</pubDate>
		<dc:creator>Stephen Cronin</dc:creator>
				<category><![CDATA[WordPress]]></category>
		<category><![CDATA[security]]></category>
		<category><![CDATA[software]]></category>
		<category><![CDATA[testing]]></category>

		<guid isPermaLink="false">http://www.scratch99.com/?p=250</guid>
		<description><![CDATA[Copyright © 2010 Stephen Cronin. Visit the original article at http://www.scratch99.com/2010/02/the-solution-to-the-lack-of-wordpress-beta-testing/.While catching up on some old podcasts, specifically Episode 82 of WordPress Weekly, I came across a discussion about WordPress beta testing. The discussion centers around the problem of bugs not being caught during beta testing because there just aren&#8217;t enough beta testers. To me, [...]]]></description>
			<content:encoded><![CDATA[Copyright © 2010 <a href="http://www.scratch99.com">Stephen Cronin</a>. Visit the original article at <a href="http://www.scratch99.com/2010/02/the-solution-to-the-lack-of-wordpress-beta-testing/">http://www.scratch99.com/2010/02/the-solution-to-the-lack-of-wordpress-beta-testing/</a>.<br /><p>While catching up on some old podcasts, specifically <a href="http://www.wptavern.com/wpweekly-episode-82-%E2%80%93-the-tinfoil-hat-brigade" target="_blank">Episode 82 of WordPress Weekly</a>, I came across a discussion about <a href="http://www.wordpress.org/" target="_blank">WordPress</a> beta testing. The discussion centers around the problem of <strong>bugs not being caught</strong> during beta testing because there just <strong>aren&#8217;t enough beta testers</strong>.</p>
<p>To me, the solution seems straightforward &#8211; but that may be because I worked in the software industry for 10 years and have experience in <strong>software release management</strong>, so I&#8217;ll take the long path and set the scene properly. </p>
<p>That makes it a long post, but stick with it &#8211; you need to read it all to fully understand my reasoning. First we need to consider the following question:</p>
<h2>Should You Upgrade WordPress Immediately After A Release?</h2>
<p>Short answer: Sometimes, but <strong>not always</strong>.</p>
<p>Over the last couple of years, there have been repeated calls for WordPress users to update their blogs immediately after a new version has been released. At times, the call to upgrade has almost become a frenzy. </p>
<p>I&#8217;ve taken this with a grain of salt and held to my belief that upgrading immediately isn&#8217;t always the correct choice. <strong>Sure, upgrade immediately if the release fixes a critical security issue</strong> &#8211; but most of the time it&#8217;s better to wait and see whether:</p>
<ul>
<li>there are any major bugs in the new version </li>
<li>your theme works with the new version </li>
<li>all of the plugins you&#8217;re using work with the new version </li>
</ul>
<p>I&#8217;ve developed this &#8216;hold back&#8217; approach while working in the software industry over the last 15 years or so &#8211; I&#8217;d contend that it&#8217;s &#8216;best practice&#8217;. <strong>Upgrading</strong> to a new version <strong>without testing</strong> the new version in your environment (including server, theme and plugins) <strong>is the sign of immature processes</strong>.</p>
<p>Some may argue that this approach is overkill for a simple blog, but there are many sites out there running WordPress that are a little more complicated. </p>
<p>Even simple blogs are often not that simple, especially as so many are now monetized. Ask yourself, will I lose money if WordPress doesn&#8217;t work after an upgrade? If the answer is yes, you should probably be testing new versions before upgrading.</p>
<div class="csstextbox1">Note: I&#8217;m a relatively sophisticated WordPress user and can judge the need to upgrade pretty well from the release notes. <strong>If the release notes don&#8217;t make much sense to you, it&#8217;s better to err on the side of caution and upgrade</strong>.</div>
<p>You&#8217;re probably asking how does this relate to beta testing? Well, in a couple of ways:</p>
<h3>1. Bugs In New Releases Mean Less People Will Upgrade</h3>
<p>Let&#8217;s leave aside the fact that I don&#8217;t personally subscribe to the &#8216;upgrade immediately&#8217; advice and assume that it&#8217;s a good thing (which it would be in the ideal world). </p>
<p>Bugs in new releases undermine this advice. After the recent <a href="http://wordpress.org/support/topic/343080" target="_blank">problem with scheduled posts</a>, introduced in the WordPress 2.9 release, there have been people questioning whether upgrading immediately was a good thing.</p>
<p>If beta testing was improved and caught more of these problems, then there&#8217;d be less of the &#8216;hold back&#8217; people out there and more people would follow the advice, in theory making WordPress more secure. There&#8217;d be:</p>
<ul>
<li>less people (such as <a href="http://scobleizer.com/2009/09/05/i-dont-feel-safe-with-wordpress-hackers-broke-in-and-took-things/" target="_blank">Robert Scoble</a>) complaining about WordPress security.</li>
<li>less need for Matt to <a href="http://wordpress.org/development/2009/09/keep-wordpress-secure/" target="_blank">write public responses</a> outlining why people should upgrade.</li>
<li>less complaints about bugs and the loss of functionality.</li>
</ul>
<p>There&#8217;ll always be bugs in software and there&#8217;ll always be people who complain &#8211; but more comprehensive beta testing would lead to less bugs, leading to less unhappy users, leading to more sites being updated immediately, leading to less hacking, leading to even less unhappy users.</p>
<p><strong>Better beta testing begets better security</strong>.</p>
<h3>2. Balance Between Upgrade Speed Vs Security</h3>
<p>Alternatively, if we don&#8217;t leave aside my beliefs, if we can moderate the <strong>unthinking update immediately</strong> advice, then we&#8217;re provided with a tremendous opportunity:</p>
<p>On a case by case basis, we can decide if an upgrade is in the &#8220;update immediately&#8221; category or in the &#8220;can wait for critical bugs to be fixed&#8221; category.</p>
<p>My solution, way down the bottom of this post, is going to propose delays to upgrades that are not for critical security issues, so that user experience less critical bugs. But more on that later.</p>
<h2>The Problem: A Lack Of Beta Testers</h2>
<p>The problem, which has been mentioned in various places including the podcast, is that although WordPress has a beta testing phase, <strong>there aren&#8217;t enough end users testing it</strong> to catch all the critical bugs. The software appears to runs fine during beta testing, but bugs rise to the surface when the release is rolled out to everyone. </p>
<p>First, some facts:</p>
<ul>
<li>Software is always going to have bugs </li>
<li>Beta testing will never find all the bugs </li>
</ul>
<p>There will always be some bugs that are only triggered when the software is run in an obscure environment or is used in a way that&#8217;s slightly different from how most people use it.</p>
<p>So it&#8217;s not about eliminating bugs, just about reducing the number of critical bugs that get through beta testing. The only way to do this is to get more people, using the software in different ways, on different server environments, to test the software.</p>
<p><strong>How do we get more people to test the software</strong>? The answer&#8217;s coming soon (honest).</p>
<h2>Software Release Management Anecdotes </h2>
<p>First, let me say that I worked in the software industry (for a <a href="http://www.softlinkint.com/" target="_blank">library management system</a> vendor) for 10 years. For quite a bit of that time, I was the person who authorised the release of software to clients and/or agents. </p>
<p>I could bore you with <strong>software release management</strong> anecdotes going back to 1994. Luckily for you, I came to my senses and edited them out! I&#8217;ll just say that making sure that major releases were properly tested and free of bugs was extremely important for the following reasons:</p>
<ul>
<li><strong>Loss of reputation, harming future sales</strong>: Upset users are significant in the relatively small library software marketplace. </li>
<li><strong>Direct financial loss</strong>: yes, it cost a significant amount of money to burn 5000 CDs back in 1994 (and then post them out). </li>
<li><strong>Lots of additional work</strong>: printing letters, packaging CDs and supporting users who were upgrading, etc. </li>
</ul>
<p>Obviously, WordPress operates in a very different environment from library software industry of old and many of these points are less of an issue: </p>
<p>If WordPress lose one user, or even ten thousand users, because of loss of reputation, <strong>they don&#8217;t actually lose any money in sales</strong> (actually there is no they!). If they have to release an upgrade, there are no costs for CDs and postage, people just download it. There&#8217;s no surge in the amount of support they need to provide, as support is crowd sourced.</p>
<p>Does that mean WordPress can afford to ignore this issue? </p>
<p>I say No &#8211; they should care about their reputation (and their users), even if there isn&#8217;t the same financial emphasis that there is in the closed source software industry. In fact, they should look to the closed source software industry and learn from it. <strong>Solutions to this very problem have been worked on and refined for decades</strong>. </p>
<p>In my particular case, we had several major incidents that led to us refining our <strong>testing and release processes</strong>. We ended up moving to a process that involved three phases of testing &#8211; I&#8217;ll outline these and relate them to WordPress in the next section. </p>
<h2>The Three Phases Of Testing</h2>
<h3>1. Developer Testing</h3>
<p>I&#8217;m sure this is done comprehensively by the WordPress developers. Ultimately, we employed a couple of full time testers, which Automattic could possibly consider funding. They may already have some testers (besides the Chief BBQ Taste Tester), although it&#8217;s not obvious from <a href="http://automattic.com/about/" target="_blank">their About page</a>. </p>
<div class="csstextbox1">I&#8217;m not going to explain the relationship between the WordPress project and Automattic here. This post is long enough. Let&#8217;s just say that the WordPress project itself doesn&#8217;t have any money (as I understand it). Automattic does have money and they have a record of employing people to work on the project.</div>
<p>But the problem isn&#8217;t here and full time testers would only have limited impact, so let&#8217;s keep moving.</p>
<h3>2. Beta Testing</h3>
<p>This is being done, but the problem is that <strong>not enough end users are involved</strong>. WordPress could look at ways to entice more users to join the beta testing program, but many of the methods that the closed source software industry use, such as offering discounts to beta testers, won&#8217;t work in the open source world.</p>
<p>One idea could be to build in a &quot;do you want to upgrade to the beta version (for the greater good)&quot; message into the automatic update function. When a beta version is released, everyone gets this message. </p>
<p>It would have to be very clear that it was a beta version and that there may be some problems and it would need Yes, No and Never Ask Me Again options, but it could work. Not many would choose to upgrade, but <strong>1% of 3 million is 30,000</strong>, which is a lot more than the number of current beta testers.</p>
<p>Once again, though, I don&#8217;t think the answer is here. It would be a significant improvement, but could cause <strong>a lot of negative publicity</strong>: there&#8217;d be too many people who&#8217;d choose it accidentally, then blame WordPress for upgrading them to beta software.</p>
<h3>3. Live User Testing / Staged Release</h3>
<p>So <strong>we come to the solution at last</strong> (I told you we would) and it&#8217;s not in the beta testing phase. </p>
<p>Instead, <strong>the answer lies in a staged roll-out to users</strong>: limiting new releases to a relatively small number of people until it&#8217;s proven that there are no major problems. </p>
<p>If any major problems are found, a decision can be made on whether they are serious enough to fix immediately, <strong>before making the software available to the rest of the users</strong>. Even if it&#8217;s decided not to fix the problems, users can be made aware of issues that may affect them before they upgrade. Even that small improvement would make a real difference to users.</p>
<div class="csstextbox1">WordPress.com is sometimes used for live user testing &#8211; and this is great for testing the pure functionality of new features &#8211; but it doesn&#8217;t test the software on the myriad of different server environments or with all the themes, plugins and advanced customisations that are out there. You need to test with live (self hosted) users.</div>
<p>The staged release approach been used for decades. I was using it 15 years ago. Google uses it today: they roll-out new features in Google Analytics or Google Adsense slowly. </p>
<h2>How Would A Staged Release Work?</h2>
<p>A staged roll-out of WordPress would work something like this:</p>
<ol>
<li>Once the beta testing phase is complete, the automatic upgrade notice would be sent out to say 100,000 people. </li>
<li>There would then be a period of say one week, where the feedback would be monitored and any critical bugs identified and investigated. </li>
<li>At the end of the period:
<ul>
<li>if no critical bugs have been identified, then the automatic upgrade would appear to everyone else. </li>
<li>If critical issues have been identified, a decision would be made on whether to proceed with the release or delay it until the problem is fixed. </li>
</ul>
</li>
</ol>
<p><strong>It goes without saying that urgent security releases would bypass this</strong>. </p>
<p>Now I&#8217;m not talking about physically denying the software to anyone, just manipulating who gets it through the automatic upgrade process. Anyone would still be able to visit wordpress.org and download the lastest version.</p>
<h2>How Would A Staged Release Be Achieved Technically?</h2>
<p>I&#8217;m not the best person to answer that, but I&#8217;d imagine it wouldn&#8217;t be too hard to do. It would require the automatic upgrade function to be modified: instead of WordPress installations asking &quot;is there a new version&quot;, they&#8217;d ask &quot;is there a new version and can I have it&quot;. </p>
<p>On the server side, it would check the download count and, when it reached the threshold, start saying no. You could make it complicated (checking whether it&#8217;s been downloaded from this IP address before), but it would be best to keep it simple.</p>
<p>There exists the potential that some users may be unhappy about either getting the new version before it&#8217;s been through live testing, or having to wait until after. The key here is that users are not getting the beta version, they&#8217;re getting the real version that&#8217;s been through beta testing, just as they would now. It&#8217;s just that it&#8217;s being rolled out slowly to further protect users. </p>
<p><strong>This would need to be well communicated</strong>. </p>
<p>Of course, <strong>it could be made it opt-in</strong>. The first 100,000 users could be shown the message: &quot;WordPress 3.1 is available! Update or Wait&quot;. If they choose Wait, it won&#8217;t ask them again until the live release testing is complete. The rest of the users would be shown: &quot;WordPress 3.1 is available, but we recommend you wait for moment. Wait or Upgrade anyway&quot;.</p>
<h2>Final Thoughts</h2>
<p>So the solution to the beta testing problem isn&#8217;t actually within the actual beta testing phase. It&#8217;s just to roll out the upgrades slowly, giving time for critical bugs to be caught before they affect too many people. <strong>This would protect the majority of users from any serious bugs</strong>.</p>
<p>Personally, I have doubts that this would ever be adopted: I think it would be seen as too complicated. But really, it wouldn&#8217;t be that hard to do and would make life better for the vast majority.</p>
<p><strong>What do you think</strong>? Am I crazy? Do you disagree with me? Do closed source practices have no place in the open source world? Do you have a better idea? Let me know!</p>
<script type="text/javascript">Nifty("div.csstextbox1","bgcolor-#FFFFFF");</script>]]></content:encoded>
			<wfw:commentRss>http://www.scratch99.com/2010/02/the-solution-to-the-lack-of-wordpress-beta-testing/feed/</wfw:commentRss>
		<slash:comments>35</slash:comments>
		</item>
		<item>
		<title>Subscribe To Comments &amp; Protected Wp-admin Folder</title>
		<link>http://www.scratch99.com/2009/06/subscribe-to-comments-protected-wp-admin-folder/</link>
		<comments>http://www.scratch99.com/2009/06/subscribe-to-comments-protected-wp-admin-folder/#comments</comments>
		<pubDate>Tue, 30 Jun 2009 03:03:10 +0000</pubDate>
		<dc:creator>Stephen Cronin</dc:creator>
				<category><![CDATA[WordPress]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[security]]></category>
		<category><![CDATA[spam]]></category>

		<guid isPermaLink="false">http://www.scratch99.com/?p=180</guid>
		<description><![CDATA[Copyright © 2010 Stephen Cronin. Visit the original article at http://www.scratch99.com/2009/06/subscribe-to-comments-protected-wp-admin-folder/.Earlier today I received an email from an irate commentator, accusing me of spamming him and threatening to report me. He was receiving emails from my blog, via the Subscribe To Comments plugin, but he thought couldn&#8217;t unsubscribe. The cause: my wp-admin folder is password [...]]]></description>
			<content:encoded><![CDATA[Copyright © 2010 <a href="http://www.scratch99.com">Stephen Cronin</a>. Visit the original article at <a href="http://www.scratch99.com/2009/06/subscribe-to-comments-protected-wp-admin-folder/">http://www.scratch99.com/2009/06/subscribe-to-comments-protected-wp-admin-folder/</a>.<br /><p>Earlier today I received an email from an irate commentator, accusing me of spamming him and threatening to report me. He was receiving emails from my blog, via the <a href="http://txfx.net/code/wordpress/subscribe-to-comments/" target="_blank">Subscribe To Comments</a> plugin, but he thought couldn&#8217;t unsubscribe. The cause: my <a href="http://www.scratch99.com/2008/10/password-protecting-the-wp-admin-folder/">wp-admin folder is password protected</a>.</p>
<p>As it happens, the commentator had successfully blocked notifications from my site. However, he thought he hadn&#8217;t because he received a username / password prompt when he clicked the Unsubscribe link in the email. </p>
<div class="csstextbox1">Note: This post only applies to people using <strong>Subscribe To Comments</strong> who have <strong>password protected the wp-admin folder</strong>, either&#160; by manually editing the .htaccess file in the wp-admin folder, using the CPanel Password Protect function, or using a WordPress plugin such as <a href="http://www.askapache.com/wordpress/htaccess-password-protect.html" target="_blank">Ask Apache Password Protect</a>.</div>
<h2>Cause &#8211; Subscribe To Comments Calling Wp-admin.css</h2>
<p>I wasn&#8217;t sure why this was happening. The URL used for the Unsubscribe link didn&#8217;t appear to be going to the wp-admin folder and I couldn&#8217;t see any reason why it would need to. I rolled my sleeves up and jumped into the Subscribe To Comments code. I quickly found the reason on line 951 (in version 2.1.2):</p>
<pre class="brush: css;">@import url( &amp;lt;?php echo get_settings('siteurl'); ?&amp;gt;/wp-admin/wp-admin.css );</pre>
<p>The plugin is calling a CSS file from the wp-admin folder, which invokes the password prompt. As the user doesn&#8217;t know the password, they will probably click Cancel and the CSS file will not be served. </p>
<p>This CSS file is only used to style the Unsubscribe page. It <strong>does not</strong> affect the functionality of the Unsubscribe / Block function. It will continue to run and <strong>will unsubscribe the user</strong>. The only negative outcome will be it won&#8217;t look quite as nice. Well, not the only negative outcome: </p>
<p><strong>The user will be confused as hell because of the password prompt</strong>.</p>
<h2>Solution &#8211; Excluding Wp-admin.css From Protection</h2>
<p>I had to resolve this issue. The easiest solution would have been to just hack the code of the Subscribe To Comments plugin and <strong>remove the call to the CSS file</strong>. However, if the plugin is ever updated, then it would have overwritten my hack and we&#8217;d be back where we started.</p>
<p>The sensible alternative seemed to be to <strong>exclude the wp-admin.css file from the password protection</strong>. A CSS file is highly unlikely to be used in any attack on my site. </p>
<p>There didn&#8217;t seem to be anyway to exclude the file via CPanel, but I knew there&#8217;d be a way to do it by editing.htaccess. I&#8217;m no .htaccess expert, so I did a search on the topic, finding the answer in Brett Batie&#8217;s <a href="http://brett.batie.com/software-development/password-protect-all-but-one-file-htaccess/" target="_blank">Password Protect All but One File</a> post. </p>
<p>That post tells you how to exclude a file in general terms, so here are the instructions for excluding wp-admin.css file.</p>
<div class="csstextbox1">Note: This assumes you know how to FTP into your host, download the file in question, edit it, and upload it again. Remember, you should <strong>always make a copy of the file</strong> first, so you can put it back if something goes wrong.</div>
<p>Go to the wp-admin folder (make sure it is the wp-admin folder) on your server and edit the .htaccess file. It will probably look something like:</p>
<pre class="brush: jscript;">
AuthType Basic
AuthName &quot;Authorised Only&quot;
require valid-user
AuthUserFile &quot;&lt;path-to-site-root&gt;/wp-admin/passwd&quot;
</pre>
<div class="csstextbox1">Note: I&#8217;ve replaced my server path with &lt;path-to-site-root&gt;. Yours should have the path to the root of the site on your host&#8217;s server.</div>
<p>Leaving the first 4 lines exactly the same, add the following 4 lines directly after them:</p>
<pre class="brush: jscript;">
&lt;Files &quot;wp-admin.css&quot;&gt;
  Allow from all
  Satisfy any
&lt;/Files&gt;
</pre>
<p>That&#8217;s telling Apache to allow access to wp-admin.css. The final .htaccess (in the wp-admin folder), should look something like:</p>
<pre class="brush: jscript;">
AuthType Basic
AuthName &quot;Authorised Only&quot;
require valid-user
AuthUserFile &quot;&lt;path-to-site-root&gt;/wp-admin/passwd&quot;

&lt;Files &quot;wp-admin.css&quot;&gt;
  Allow from all
  Satisfy any
&lt;/Files&gt;
</pre>
<p>Problem solved. My visitors can now unsubscribe again (though why would they want to!). I still have the hardened security provided by password protecting the wp-admin folder. I haven&#8217;t had to hack Subscribe To Comments, which would cause problems when the plugin is upgraded.</p>
<h2>Final Thoughts</h2>
<p>Mark Jaquith, if you read this, many thanks for a <strong>great plugin </strong>- but could you consider copying the wp-admin.css file into the plugin folder and calling it from there? I&#8217;m fine with you making this post redundant!</p>
<script type="text/javascript">Nifty("div.csstextbox1","bgcolor-#FFFFFF");</script>]]></content:encoded>
			<wfw:commentRss>http://www.scratch99.com/2009/06/subscribe-to-comments-protected-wp-admin-folder/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Google Adsense Serving Up Malware?</title>
		<link>http://www.scratch99.com/2009/05/google-adsense-serving-up-malware/</link>
		<comments>http://www.scratch99.com/2009/05/google-adsense-serving-up-malware/#comments</comments>
		<pubDate>Thu, 28 May 2009 13:51:47 +0000</pubDate>
		<dc:creator>Stephen Cronin</dc:creator>
				<category><![CDATA[Web Related]]></category>
		<category><![CDATA[Adsense]]></category>
		<category><![CDATA[google]]></category>
		<category><![CDATA[security]]></category>
		<category><![CDATA[virus]]></category>

		<guid isPermaLink="false">http://www.scratch99.com/2009/05/google-adsense-serving-up-malware/</guid>
		<description><![CDATA[Copyright © 2010 Stephen Cronin. Visit the original article at http://www.scratch99.com/2009/05/google-adsense-serving-up-malware/.Tonight I was browsing the Internet, when my virus software notified me of a potential threat from openstat.ws. None of the websites open in Firefox had a link to this site in the source. After some investigation, it appears that the potentially malicious site is [...]]]></description>
			<content:encoded><![CDATA[Copyright © 2010 <a href="http://www.scratch99.com">Stephen Cronin</a>. Visit the original article at <a href="http://www.scratch99.com/2009/05/google-adsense-serving-up-malware/">http://www.scratch99.com/2009/05/google-adsense-serving-up-malware/</a>.<br /><p>Tonight I was browsing the Internet, when my virus software notified me of a potential <strong>threat from openstat.ws</strong>. None of the websites open in Firefox had a link to this site in the source. After some investigation, it appears that the <strong><em>potentially</em> malicious site is called by Google Adsense</strong>.</p>
<h2>Avast Anti-virus Warning Message</h2>
<p>I use <strong>Avast Antivirus</strong> on my computer and tonight it gave the following warning message while I was browsing the Internet:</p>
<blockquote>
<p>Sign of &quot;HTML:Iframe-inf&quot; has been found in &quot;http://openstat.ws/top.php\{gzip}&quot; file</p>
</blockquote>
<p>The inclusion of a URL made me suspect that one of the sites I was browsing was linking to a dodgy website (ie <strong>openstat.ws</strong>). </p>
<p>The obvious thing to do was to check the source of the sites open in Firefox, to see which one was the culprit. However, <strong>openstat.ws</strong> did not appear in the source of any of the pages. Not to be put off, I used the Web Developer toolbar to examine the generated source. Still nothing.</p>
<h2>Google Says Openstat.ws Is Suspicious</h2>
<p>Next stop, a Google search for <strong>openstat.ws</strong>. The number one result was the <a href="http://google.com/safebrowsing/diagnostic?site=openstat.ws/">Google Safe Browsing diagnostic page for openstat.ws</a> page. Because the nature of this page is that it may change often, I&#8217;ve grabbed a screenshot of what it&#8217;s showing tonight:</p>
<p><a href='http://www.scratch99.com/wp-content/uploads/2009/05/google-safe-browsing.png' title='Google Safe Browsing - openstat.ws'><img src='http://www.scratch99.com/wp-content/uploads/2009/05/google-safe-browsing.png' width='500px' height='362px' alt='Google Safe Browsing - openstat.ws' /></a></p>
<p>Okay, so Google are saying:</p>
<blockquote>
<p>Site is listed as suspicious &#8211; visiting this web site may harm your computer.</p>
</blockquote>
<p>They say the site was only listed for suspicious activity once in the last 90 days, but they also say:</p>
<blockquote>
<p>Of the 6 pages we tested on the site over the past 90 days, 3 page(s) resulted in malicious software being downloaded and installed without user consent.</p>
</blockquote>
<p>I&#8217;m not a security expert and I may be reading this wrong (please let me know if I am), but that seems to be indicating that there&#8217;s a <strong>50% chance of malicious software being installed</strong> from openstat.ws.</p>
<h2>Norton Say Openstat.ws Is A Threat</h2>
<p>The third result in the Google search was <a href="http://safeweb.norton.com/report/show?name=openstat.ws" target="_blank">Norton Safe Web&#8217;s page on openstat.ws</a>. Let&#8217;s see what they say about openstat.ws:</p>
<p><a href='http://www.scratch99.com/wp-content/uploads/2009/05/norton-safe-web.png' title='Norton says openstat.ws is a threat'><img src='http://www.scratch99.com/wp-content/uploads/2009/05/norton-safe-web.png' alt='Norton says openstat.ws is a threat' /></a></p>
<p>Norton are saying that there are <strong>two threats found on openstat.ws</strong>, one of which is:</p>
<blockquote>
<p>Threat Name: Direct link to <a href="http://www.symantec.com/avcenter/attack_sigs/s23086.html">HTTP Malicious Toolkit Variant Activity</a> </p>
<p>Location: http://openstat.ws/top.htm</p>
</blockquote>
<p>The file Avast picked up on my computer is <strong>top.php</strong>, but <strong>top.htm</strong> is pretty close. <strong>HTTP Malicious Toolkit Variant Activity</strong> sounds pretty nasty. Norton say:</p>
<blockquote>
<h5>Severity: High</h5>
<p>This attack could pose a serious security threat. You should take immediate action to stop any damage or prevent further damage from happening.</p>
</blockquote>
<p>Okay, I&#8217;m convinced now that I don&#8217;t want <strong>openstat.ws</strong> being called on my computer. But how can I stop it where I can&#8217;t find where it&#8217;s being called from.</p>
<h2>Looking Under Firefox&#8217;s Hood &#8211; Sessionstore.js</h2>
<p>If <strong>openstat.ws</strong> wasn&#8217;t being called by the websites I was visiting, perhaps it was being called by <strong>Firefox itself</strong>. I started thinking that Firefox or one of the extensions I run must have been compromised. I started looking through the Firefox files &#8211; admittedly without much of an idea of what I was looking for.</p>
<p>I started by looking in the <code>\Documents and Settings\[username]\ Application Data\Mozilla\Firefox\Profiles\[profilename] </code>folder. I ordered the files in date order and started going through the most recently modified files. </p>
<p>I soon came to <strong>sessionstore.js</strong>. It gave me the answer, although it wasn&#8217;t the answer I was expecting. <strong>Sessionstore.js</strong> seems to store the current session, presumably so it can be restored in the case of Firefox crashing. I&#8217;m not sure if this is default behaviour or part of the <strong>Session Manager</strong> extension.</p>
<p>It consists of a series of <strong>entries</strong> tags, one for each tab that&#8217;s open. In examining this, I found the following:</p>
<p><strong>EDIT: Due to Syntax Highlighter performance issues, I&#8217;ve moved the <a href="http://www.scratch99.com/wp-content/uploads/2009/05/sessionstore.txt">sessionstore.js snippet into a text file</a>.</strong></p>
<p>That&#8217;s not particularly readable, but it&#8217;s saying that I&#8217;ve got Ozh&#8217;s <a href="http://planetozh.com/blog/2009/05/handling-plugins-options-in-wordpress-28-with-register_setting/">Handling Plugins Options in WordPress 2.8 with register_setting()</a> post open. Inside that there is a child URL open (http://googleads.g.doubleclick.net/etc) which is a Google Adsense ad. Inside that, there are some further children, down until we come to one for http://openstat.ws/top.php, which is our suspicious site. </p>
<p>At this point we are still inside the Google Adsense child, meaning that <strong>the site that Google lists as suspicious is actually being served through Adsense</strong>. This is a little worrying to say the least!</p>
<p>Note: There is absolutely nothing wrong with Ozh&#8217;s site apart from the fact that he is running Adsense &#8211; as do I and hundreds of thousands of other sites.</p>
<h2>Final Thoughts</h2>
<p>As I said, I&#8217;m not a security expert, so I&#8217;d love some feedback from some more knowledgable. I&#8217;d also love to hear if anyone else out there has come across this problem.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.scratch99.com/2009/05/google-adsense-serving-up-malware/feed/</wfw:commentRss>
		<slash:comments>17</slash:comments>
		</item>
		<item>
		<title>Password Protecting The Wp-admin Folder</title>
		<link>http://www.scratch99.com/2008/10/password-protecting-the-wp-admin-folder/</link>
		<comments>http://www.scratch99.com/2008/10/password-protecting-the-wp-admin-folder/#comments</comments>
		<pubDate>Fri, 03 Oct 2008 13:42:11 +0000</pubDate>
		<dc:creator>Stephen Cronin</dc:creator>
				<category><![CDATA[WordPress]]></category>
		<category><![CDATA[security]]></category>
		<category><![CDATA[virus]]></category>

		<guid isPermaLink="false">http://www.scratch99.com/2008/10/password-protecting-the-wp-admin-folder/</guid>
		<description><![CDATA[Copyright © 2010 Stephen Cronin. Visit the original article at http://www.scratch99.com/2008/10/password-protecting-the-wp-admin-folder/.I recently listened to the WordPress Podcast &#8211; Episode 44. Although it&#8217;s a couple of months old now, it was quite interesting and one issue really caught my eye ear: the security related question for Matt Mullenweg at around 1:13:30 of the podcast. A listener, [...]]]></description>
			<content:encoded><![CDATA[Copyright © 2010 <a href="http://www.scratch99.com">Stephen Cronin</a>. Visit the original article at <a href="http://www.scratch99.com/2008/10/password-protecting-the-wp-admin-folder/">http://www.scratch99.com/2008/10/password-protecting-the-wp-admin-folder/</a>.<br /><p>I recently listened to the <a href="http://wp-community.org/2008/08/04/episode-44/" target="_blank">WordPress Podcast &#8211; Episode 44</a>. Although it&#8217;s a couple of months old now, it was quite interesting and one issue really caught my <s>eye</s> ear: the <strong>security related question</strong> for Matt Mullenweg at around 1:13:30 of the podcast.</p>
<p>A listener, Simon Jones from <a href="http://beforeiforget.co.uk" target="_blank">beforeiforget.co.uk</a>, talked about the difficulty of changing the default WordPress user name from <strong>admin</strong> to something a <strong>little harder for hackers to guess</strong>. The only way to do this is to change it in the database itself &#8211; it can&#8217;t be done through WordPress. </p>
<p>Simon&#8217;s main question was &quot;Why isn&#8217;t there an easier way to <strong>change the default user from admin to something else</strong>?&quot;. Matt didn&#8217;t actually answer this, presumably because Simon&#8217;s question was fairly long and to be honest, could have been a little more to the point. </p>
<p>However, Matt did mention that it&#8217;s <strong>very difficult to brute force WordPress</strong> because such an attempt would need to submit thousands of requests per second and web servers won&#8217;t allow that many requests. He also mentioned that he&#8217;d changed his user name, though obviously not for security reasons, because he told everyone what it was!</p>
<p>Anyway, the podcast has inspired me to go on to discuss a couple of points related to <strong>WordPress security</strong>:</p>
<h2>Password Strength</h2>
<p>What Matt didn&#8217;t say (because it&#8217;s elemental) is that having a strong password is essential. A user name / password combination of Admin and dS35Hg68p1d will be much harder to break than one of admin and WordPress.</p>
<p>If you have a strong password, leaving user name as admin is less of an issue. So make sure your password is reasonably strong.</p>
<h2>Protecting The Wp-admin Folder</h2>
<p>For the paranoid, such as myself, who are worried about their WordPress login being hacked, it&#8217;s possible to add an <strong>extra layer of security to the wp-admin folder</strong>. This is more effective than just changing the default user. There are different ways to do this, including:</p>
<ul>
<li>only allowing users from a certain <a href="http://money.bigbucksblogger.com/blog-security-htaccess-block/" target="_blank"><strong>IP address or range to access the wp-admin folder</strong></a></li>
<li>using the <a href="http://www.askapache.com/wordpress/htaccess-password-protect.html" target="_blank"><strong>AskApache Password Protect plugin</strong></a> to password protect the wp-admin folder</li>
<li>using <strong>CPanel</strong> to password protect the wp-admin folder (here&#8217;s a <strong>general tutorial</strong>, but one that could be applied to wp-admin) </li>
</ul>
<p>The second two methods will present the user with an additional user name / password prompt before the normal WordPress login screen can be accessed. This obviously takes longer to log in, but it also makes it <strong>much more unlikely that your site can be hacked</strong>. </p>
<div class="csstextbox1">These two methods work in a similar way, setting security through the .htaccess file. If you really know what you&#8217;re doing, you could set this up manually.</div>
<h2>Problem With Password Protecting The Wp-admin Folder</h2>
<p>When I first tried to password protect the wp-admin folder, using the AskApache Password Protect plugin, I ran into a serious problem. <strong>I wasn&#8217;t given the &#8220;Authentication Required&#8221; window, I just got a 404 File not found message</strong>. This meant I was unable to log into my WordPress system and couldn&#8217;t access the plugin screen to turn off the password protection.</p>
<p>So how did I get access to my site again? I logged into my host via FTP and removed the following files:</p>
<ul>
<li>.aahtpasswd from the public_html folder </li>
<li>.htaccess from the public_html/wp-admin directory (<b>not the one from public_html</b>)<b></b></li>
</ul>
<p>I later experienced this same problem when <strong>password protecting the wp-admin folder via Cpanel</strong>, but of course, I could just turn off the password protection again via Cpanel. </p>
<p>I found a permanent solution to this problem at Developed Traffic&#8217;s <a href="http://developedtraffic.com/2007/05/27/wordpress-admin-password-protection-404/" target="_blank">WordPress admin password protection 404</a> post. The solution is to create an empty file called myerror.html and upload it to your public_html folder, then add the following to your .htaccess file (in public_html):</p>
<p class="codebox"><code>ErrorDocument 401 /myerror.html<br />
ErrorDocument 403 /myerror.html</code></p>
<p>If you want to store the myerror.html file in a folder, rather than in public_html, then simply add the folder&#8217;s name to the two lines, ie:</p>
<p class="codebox"><code>ErrorDocument 401 /foldername/myerror.html<br />
ErrorDocument 403 /foldername/myerror.html</code></p>
<p>That should fix the problem &#8211; although I&#8217;m not sure what impact it may have on other things (ie by having 401 and 403 go to the new file rather than WordPress handling it). If anyone out there know this please let me know in the comments.</p>
<h2>The Real Lesson About WordPress Security</h2>
<p>This post is all about trying to minimize the slight chance that someone may be able to break into your WordPress system via the login screen. I&#8217;m willing to bet that <strong>out of all the WordPress blogs ever hacked, very few of them would have been hacked via the login screen</strong>.</p>
<p>In the previous section, I mentioned how I locked myself out of the WordPress login screen, but got around it by FTPing in. <strong>All that security</strong> on the login screen <strong>is worth nothing</strong> if someone gets access to your host account via FTP.</p>
<p>From what I&#8217;ve heard, most hacked sites were compromised via:</p>
<ul>
<li>their host login being stolen after their email account was hijacked and used by the hackers to get the login details from the host service provider</li>
<li>through an XSS exploit in WordPress</li>
</ul>
<p>So the real lesson is to <strong>keep your computer free of viruse</strong>s and spyware and <strong>your WordPress installation up to date</strong> with the latest security releases.</p>
<p>If you have any further thoughts on WordPress security, please let me know in the comments.</p>
<script type="text/javascript">Nifty("div.csstextbox1","bgcolor-#FFFFFF");</script>]]></content:encoded>
			<wfw:commentRss>http://www.scratch99.com/2008/10/password-protecting-the-wp-admin-folder/feed/</wfw:commentRss>
		<slash:comments>64</slash:comments>
		</item>
	</channel>
</rss>

<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Page Caching using disk (enhanced)
Database Caching 1/16 queries in 0.077 seconds using disk
Object Caching 628/657 objects using disk

Served from: www.scratch99.com @ 2010-09-06 22:22:19 -->