<?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"
	>

<channel>
	<title>Lior Gradstein's Blog &#187; security</title>
	<atom:link href="http://www.gradstein.info/category/security/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.gradstein.info</link>
	<description></description>
	<pubDate>Sun, 13 Apr 2008 21:33:17 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.6</generator>
	<language>en</language>
			<item>
		<title>Security patching Wordpress themes against Cross-Script Attacks (XSS)</title>
		<link>http://www.gradstein.info/security/security-patching-wordpress-themes-against-cross-script-attacks-xss/</link>
		<comments>http://www.gradstein.info/security/security-patching-wordpress-themes-against-cross-script-attacks-xss/#comments</comments>
		<pubDate>Mon, 11 Jun 2007 21:27:02 +0000</pubDate>
		<dc:creator>Lior Gradstein</dc:creator>
		
		<category><![CDATA[security]]></category>

		<category><![CDATA[wordpress]]></category>

	<!-- AutoMeta Start -->
	<category>worpdress</category>
	<category>themes</category>
	<category>in</category>
	<category>fact</category>
	<category>a</category>
	<category>nice</category>
	<category>article</category>
	<category>explaining</category>
	<category>the</category>
	<category>vulnerability</category>
	<!-- AutoMeta End -->
	
		<guid isPermaLink="false">http://www.gradstein.info/wordpress/security-patching-wordpress-themes-against-cross-script-attacks-xss/</guid>
		<description><![CDATA[A nice article explaining the vulnerability in Worpdress themes (in fact anything using php :-) was published some days ago. Now, there&#8217;s even a vulnerability scanner available (done in Perl).
I ran it on several of the blogs I manage, and all of them were vulnerable to XSS (wp-scanner also tests other vulnerabilities) :-(
I followed the [...]]]></description>
			<content:encoded><![CDATA[<p><a href="/wp-content/uploads/wp_scanner.png" onclick="ps_imagemanager_popup(this.href,\'WP Scanner\',\'781\',\'431\');return false" onfocus="this.blur()" rel="lightbox"><img src="/wp-content/uploads/.thumbs/.wp_scanner.png" alt="WP Scanner" title="WP Scanner" align="right" width="96" height="53" border="0" /></a>A <a href="http://blogsecurity.net/wordpress/articles/article-070607/" class="liexternal">nice</a> article explaining the vulnerability in Worpdress themes (in fact anything using php :-) was published some days ago. Now, there&#8217;s even a <a href="http://blogsecurity.net/wordpress/tools/wp-scanner/" class="liexternal">vulnerability scanner available</a> (done in Perl).</p>
<p>I ran it on several of the blogs I manage, and <strong>all of them were vulnerable to XSS</strong> (wp-scanner also tests other vulnerabilities) :-(<br />
I followed the advices on blogsecurity&#8217;s website and modified all of the search functions I could find. Now wp-scanner doesn&#8217;t report any vulnerability (<em>it doesn&#8217;t mean it is cracker-proof, but it&#8217;s a good start</em>).</p>
<p>So if anybody else uses the <a href="http://www.deanjrobinson.com/wordpress/redoable" class="liexternal">Redoable theme</a> like me, you should patch the
<div class="python" style="font-family: monospace;color: #000066; border: 1px solid orange; margin: 5px; padding: 5px; background-color: #ffffff;">header.<span style="color: black;">php</span></div>
<p> file. Near the top of the file, find the
<div class="python" style="font-family: monospace;color: #000066; border: 1px solid orange; margin: 5px; padding: 5px; background-color: #ffffff;"><span style="color: #483d8b;">&quot;Search for&quot;</span></div>
<p> string, and enclose the
<div class="python" style="font-family: monospace;color: #000066; border: 1px solid orange; margin: 5px; padding: 5px; background-color: #ffffff;">$s</div>
<p> string with the
<div class="python" style="font-family: monospace;color: #000066; border: 1px solid orange; margin: 5px; padding: 5px; background-color: #ffffff;">htmlspecialchars<span style="color: black;">&#40;</span><span style="color: black;">&#41;</span></div>
<p> method:</p>
<p class="code">Search for &lt;?php echo htmlspecialchars($s); }</p>
<p>Do the same for the
<div class="python" style="font-family: monospace;color: #000066; border: 1px solid orange; margin: 5px; padding: 5px; background-color: #ffffff;">searchform.<span style="color: black;">php</span></div>
<p> file:</p>
<p class="code">searchform&#8221; action=&#8221;&lt;?php echo htmlspecialchars($_SERVER['PHP_SELF']);</p>
<p>An even better protection would be to use the <a href="http://www.modsecurity.org/" class="liexternal">mod_security module</a> for Apache/Apache2, which can detect and block these kind of attacks. But this requires that you control your server.<br />
To prevent web visitors from sending tags, you can add the following rule in your virtual host:</p>
<p class="code">SecFilter &#8220;&lt;(.|\n)+&gt;&#8221;</p>
<p>Now, when someone requests &lt; anything &gt;, the visitor gets a 403 error, and in your audit log, you now have:</p>
<p class="code">==36d82a37==============================<br />
Request: www.gradstein.info 82.67.175.56 - - [11/Jun/2007:11:10:56 +0200] &#8220;GET /?s=%3Cwpscan%3E HTTP/1.1&#8243; 403 202 &#8220;-&#8221; &#8220;Mozilla/5.0&#8243; - &#8220;-&#8221;<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
GET /?s=%3Cwpscan%3E HTTP/1.1<br />
mod_security-message: Access denied with code 403. Pattern match &#8220;<(.|\\n)+>&#8221; at REQUEST_URI [severity "EMERGENCY"]<br />
mod_security-action: 403<br />
HTTP/1.1 403 Forbidden<br />
Content-Length: 202
</p>
<p class="information">Please note, that mod_security does not correct your application. Here if you only use mod_security, Wordpress theme will still be vulnerable on the underlaying level. It is OK to use mod_security, but it is much much more advisable to correct the origin of the problem and not cover it.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.gradstein.info/security/security-patching-wordpress-themes-against-cross-script-attacks-xss/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Security monitoring of Debian alerts is less than practical</title>
		<link>http://www.gradstein.info/debian/security-monitoring-of-debian-alerts-is-less-than-practical/</link>
		<comments>http://www.gradstein.info/debian/security-monitoring-of-debian-alerts-is-less-than-practical/#comments</comments>
		<pubDate>Tue, 12 Sep 2006 14:17:00 +0000</pubDate>
		<dc:creator>Lior Gradstein</dc:creator>
		
		<category><![CDATA[debian]]></category>

		<category><![CDATA[rant]]></category>

		<category><![CDATA[security]]></category>

	<!-- AutoMeta Start -->
	<category>the</category>
	<category>www debian org security 2006 dsa 1174</category>
	<category>here</category>
	<category>begins</category>
	<category>the</category>
	<category>fun</category>
	<category>the</category>
	<category>affected</category>
	<category>packages</category>
	<category>and</category>
	<category>the</category>
	<category>corrected</category>
	<category>version</category>
	<category>numbers</category>
	<category>the</category>
	<category>check</category>
	<category>a</category>
	<category>debian</category>
	<category>system  was</category>
	<category>date</category>
	<category>the</category>
	<category>offical</category>
	<category>security</category>
	<category>annoucements</category>
	<category>dsa</category>
	<category>the</category>
	<category>debian</category>
	<category>security</category>
	<category>debian</category>
	<category>security  don</category>
	<category>debian</category>
	<category>search</category>
	<category>disabled</category>
	<category>latest</category>
	<category>security</category>
	<category>alerts</category>
	<category>dsa</category>
	<!-- AutoMeta End -->
	
		<guid isPermaLink="false">http://www.gradstein.info/uncategorized/security-monitoring-of-debian-alerts-is-less-than-practical/</guid>
		<description><![CDATA[I was looking for a program (command-line) that would allow me to check if a Debian system
was up to date against all the offical security annoucements (DSA). Something like the program glsa-check which is available for Gentoo systems.
I just found two, none of them being really useful:

forgotten_name: It works, but the bad point is that [...]]]></description>
			<content:encoded><![CDATA[<p>I was looking for a program (command-line) that would allow me to check if a Debian system<br />
was up to date against all the offical security annoucements (DSA). Something like the program glsa-check which is available for Gentoo systems.</p>
<p>I just found two, none of them being really useful:</p>
<ul>
<li>forgotten_name: It works, but the bad point is that the inner working is to test the upgrade for ALL packages, which is quite slow&#8230;</li>
<li>tiger: They cheated a little, as they made a &#8220;static&#8221; file used to compare to a filesystem.</li>
</ul>
<p>So I decided to make my own. Alas, the people responsible for Debian security<br />
don&#8217;t seem to give any easy way to get the DSA in a stable/correct way.</p>
<p>Here are the different possibilities, and why they&#8217;re hard/impossible to use:</p>
<ul>
<li>There&#8217;s a &#8220;<a href="http://search.debian.org/" class="liexternal">search engine</a>&#8221; that is supposed to allow you to search for CVE entries, but it doesn&#8217;t work (has it worked at one time?) and now you only get a message &#8220;Debian Search disabled&#8221;.</li>
<li>You can get the &#8220;latest&#8221; security alerts (DSA) from the <a href="http://www.debian.org/security/" class="liexternal">Debian security page</a>, even in a <a href="http://www.debian.org/security/dsa" class="liexternal">RDF format</a>. That would be cool, except:<span style="display: block" id="formatbar_CreateLink" title="Link" onmouseover="ButtonHoverOn(this);" onmouseout="ButtonHoverOff(this);" onmousedown="CheckFormatting(event);FormatbarButton('richeditorframe', this, 8);ButtonMouseDown(this);"></span>
<ul>
<li>It&#8217;s just the 15 or less last alerts</li>
<li>The contents are just a title, a link, a two words description and the issued date</li>
</ul>
</li>
<li>There is the security-announce mailing list. Not really practical.</li>
</ul>
<p>To correct the problem of the 15 or less entries in the distributed RDF file, I took instead the &#8220;<a href="http://www.debian.org/security/2006/" class="liexternal">year</a>&#8221; page which gives exactly the same thing but in HTML. Some regexp, and we get the same result as the RDFs, but with the whole list of DSAs (but still not enough information).</p>
<p>Next, to get the detailed data, that is, the affected packages and the corrected version numbers (the most important things) we need to download the corresponding DSA page. For example, for the DSA 1174, you would get the content of the page http://www.debian.org/security/2006/dsa-1174 .</p>
<p>Here begins the fun. That page doesn&#8217;t have a static structure at all! Many inconsistencies are making the parsing of the page unreliable.<br />
For example, let&#8217;s just start with the DSA number. For example, for the DSA 1174, you find that on the details page, it&#8217;s 1174-1.</p>
<p>Next, you would think that with the use of templates, that page would have some kind of fixed format. Que nenni! The text is not always the same. For example, the text &#8216;has been fixed in&#8217; isn&#8217;t always formatted the same way.</p>
<p>About the affected packages, you have a paragraph named &#8216;Affected Packages&#8217;, which is inconsistent with the really affected packages (never more that one package), which can be found later in the page in &#8216;Fixed in&#8217;.</p>
<p>Redhat is submitting its alerts to <a href="http://oval.mitre.org/" class="liexternal">OVAL</a>, which uses a really nice format and also gives an interpreter for the language. I saw just one or two messages on the OVAL mailing list about debian :-(</p>
]]></content:encoded>
			<wfw:commentRss>http://www.gradstein.info/debian/security-monitoring-of-debian-alerts-is-less-than-practical/feed/</wfw:commentRss>
		</item>
	</channel>
</rss>
