<?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>Inliniac &#187; WordPress</title>
	<atom:link href="http://www.inliniac.net/blog/category/wordpress/feed" rel="self" type="application/rss+xml" />
	<link>http://www.inliniac.net/blog</link>
	<description>Everything inline.</description>
	<lastBuildDate>Wed, 11 Jan 2012 19:09:17 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>WordPress version 2.6 &amp; ModSecurity</title>
		<link>http://www.inliniac.net/blog/2008/07/16/wordpress-version-26-modsecurity.html</link>
		<comments>http://www.inliniac.net/blog/2008/07/16/wordpress-version-26-modsecurity.html#comments</comments>
		<pubDate>Wed, 16 Jul 2008 16:29:25 +0000</pubDate>
		<dc:creator>Victor Julien</dc:creator>
				<category><![CDATA[ModSecurity]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://www.inliniac.net/blog/?p=127</guid>
		<description><![CDATA[Today I updated my WordPress installation to version 2.6. The upgrade went smooth as usual. However afterwards I couldn&#8217;t login anymore because one of my ModSecurity rules was triggered at the login. Turns out the WordPress developers changed the use of the &#8216;redirect_to&#8217; argument in wp-login.php. WordPress uses it to redirect the browser to some [...]]]></description>
			<content:encoded><![CDATA[<p>Today I updated my WordPress installation to version 2.6. The upgrade went smooth as usual. However afterwards I couldn&#8217;t login anymore because one of my ModSecurity rules was triggered at the login. Turns out the WordPress developers changed the use of the &#8216;redirect_to&#8217; argument in wp-login.php. WordPress uses it to redirect the browser to some part of the weblog software after a successful login. Some time ago there used to be a vulnerability in WordPress as described here: <a href="http://www.securityfocus.com/archive/1/463291" target="_blank">http://www.securityfocus.com/archive/1/463291</a>. To prevent exploitation on my box at the time I created the following rule:</p>
<blockquote style="text-align: left;"><p>SecRule REQUEST_FILENAME &#8220;/wp-login.php&#8221; &#8220;chain,msg:&#8217;WORDPRESS wp-login.php redirect_to credentials stealing attempt&#8217;,severity:2,t:normalisePath&#8221;<br />
SecRule ARGS:/^\s*redirect_to$/ &#8220;^(ht|f)tps?\://&#8221;</p></blockquote>
<p>This worked because WordPress only used relative paths as values for the &#8216;redirect_to&#8217; argument. With 2.6 however, this has changed. WordPress now tries to redirect to a full URI. So the above rule needed an update. What I wanted is to adapt the rule so that it only allows the redirect to my own domain. So I created the following rule:</p>
<blockquote style="text-align: left;"><p>SecRule REQUEST_FILENAME &#8220;/wp-login.php&#8221; &#8220;chain,msg:&#8217;WORDPRESS wp-login.php redirect_to credentials stealing attempt&#8217;,severity:2,t:normalisePath&#8221;<br />
SecRule ARGS:/^\s*redirect_to$/ &#8220;^(?:ht|f)tps?\://(.*)$&#8221; &#8220;chain,capture&#8221;<br />
SecRule TX:1 &#8220;!@beginsWith %{SERVER_NAME}&#8221;</p></blockquote>
<p>What it does is take the domain name from the &#8216;redirect_to&#8217; variable and strip the leading http:// or https:// from it. Next, that is compared with Apache2&#8242;s SERVER_NAME variable. It is tested using &#8216;beginsWith&#8217; so the rule can&#8217;t be bypassed using something like &#8216;redirect_to=http://evil.com/www.inliniac.net/&#8217;.</p>
<p style="text-align: left;">This way the logins work again and I still should be notified when someone tries this old (and patched) trick on me!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.inliniac.net/blog/2008/07/16/wordpress-version-26-modsecurity.html/feed</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>New WordPress issue + Snort and ModSecurity rules</title>
		<link>http://www.inliniac.net/blog/2007/03/20/new-wordpress-issue-modsecurity-rule.html</link>
		<comments>http://www.inliniac.net/blog/2007/03/20/new-wordpress-issue-modsecurity-rule.html#comments</comments>
		<pubDate>Tue, 20 Mar 2007 18:03:21 +0000</pubDate>
		<dc:creator>Victor Julien</dc:creator>
				<category><![CDATA[ModSecurity]]></category>
		<category><![CDATA[Snort]]></category>
		<category><![CDATA[Snort_inline]]></category>
		<category><![CDATA[Vulnerability]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[bleedingthreats]]></category>
		<category><![CDATA[rules]]></category>
		<category><![CDATA[Ryan Barnett]]></category>

		<guid isPermaLink="false">http://www.inliniac.net/blog/?p=71</guid>
		<description><![CDATA[I just read about a new issue with WordPress here at SecurityFocus. It&#8217;s a potential credential stealing vulnerability, so I quickly created these ModSecurity 2 rules: SecDefaultAction &#8220;log,deny,status:403,phase:2,t:lowercase,t:escapeSeqDecode&#8221; SecRule REQUEST_FILENAME &#8220;/wp-login.php$&#8221; &#8220;chain,msg:&#8217;WORDPRESS wp-login.php redirect_to credentials stealing attempt&#8217;,severity:2,t:normalisePath&#8221; SecRule ARGS_NAMES &#8220;^redirect_to$&#8221; &#8220;chain&#8221; SecRule ARGS:redirect_to &#8220;(ht&#124;f)tps?\://&#8221; I can still login to my WordPress install, so it seems [...]]]></description>
			<content:encoded><![CDATA[<p>I just read about a new issue with <a href="http://www.wordpress.org/">WordPress</a> <a href="http://www.securityfocus.com/archive/1/463291">here</a> at SecurityFocus. It&#8217;s a potential credential stealing vulnerability, so I quickly created these <a href="http://www.modsecurity.org">ModSecurity</a> 2 rules:</p>
<p align="left"><strong>SecDefaultAction &#8220;log,deny,status:403,phase:2,t:lowercase,t:escapeSeqDecode&#8221;<br />
SecRule REQUEST_FILENAME &#8220;/wp-login.php$&#8221; &#8220;chain,msg:&#8217;WORDPRESS wp-login.php redirect_to credentials stealing attempt&#8217;,severity:2,t:normalisePath&#8221;<br />
SecRule ARGS_NAMES &#8220;^redirect_to$&#8221; &#8220;chain&#8221;<br />
SecRule ARGS:redirect_to &#8220;(ht|f)tps?\://&#8221; </strong></p>
<p>I can still login to my WordPress install, so it seems that the rule does no harm. Use at your own risk!</p>
<p><strong>Update</strong>: I&#8217;ve created a Snort rule as well:</p>
<p align="left"><strong>alert tcp $EXTERNAL_NET any -&gt; $HTTP_SERVERS $HTTP_PORTS (msg:&#8221;WORDPRESS wp-login.php redirect_to credentials stealing attempt&#8221;; flow:to_server,established; uricontent:&#8221;/wp-login.php&#8221;; nocase; uricontent:&#8221;redirect_to&#8221;; pcre:&#8221;/redirect_to=(ht|f)tps?\:\//iU&#8221;; classtype:web-application-attack; sid:4000003; rev:1;)</strong></p>
<p><strong>Update 2</strong>: fixed the Snort rule, thanks to Shirkdog for pointing out that it had some broken pcre in it. The rule is now included in the <a href="http://www.bleedingthreats.net/">BleedingThreats</a> ruleset (check <a href="http://doc.bleedingthreats.net/bin/view/Main/2003508">here</a>), however that (slightly modified) rule doesn&#8217;t detect the attack for me.</p>
<p><strong>Update 3</strong>: the Bleeding rule is now fixed. I&#8217;ve updated the above rule as well.</p>
<p><strong>Update 4</strong>: updated the ModSecurity rule to prevent a possible evasion by prepending tab chars to the redirect url. Thanks to Ryan Barnett for pointing this out.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.inliniac.net/blog/2007/03/20/new-wordpress-issue-modsecurity-rule.html/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

