<?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>Brightbox Blog &#187; rails 2.2</title>
	<atom:link href="http://blog.brightbox.co.uk/tag/rails-22/feed" rel="self" type="application/rss+xml" />
	<link>http://blog.brightbox.co.uk</link>
	<description></description>
	<lastBuildDate>Fri, 02 Dec 2011 12:56:25 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>Rails CSRF Security Vulnerability</title>
		<link>http://blog.brightbox.co.uk/posts/rails-csrf-security-vulnerability</link>
		<comments>http://blog.brightbox.co.uk/posts/rails-csrf-security-vulnerability#comments</comments>
		<pubDate>Wed, 19 Nov 2008 20:27:25 +0000</pubDate>
		<dc:creator>Rahoul Baruah</dc:creator>
				<category><![CDATA[Misc]]></category>
		<category><![CDATA[csrf]]></category>
		<category><![CDATA[rails]]></category>
		<category><![CDATA[rails 2.1]]></category>
		<category><![CDATA[rails 2.2]]></category>
		<category><![CDATA[security]]></category>

		<guid isPermaLink="false">http://blog.brightbox.co.uk/?p=223</guid>
		<description><![CDATA[Users of Rails 2.1 and 2.2 need to be aware of a vulnerability in Rails&#8217; CSRF forgery protection. For those that don&#8217;t know, Rails generates an authentication token within your forms and verifies this token when the form is submitted back to your application. This prevents attackers from crafting malicious requests whilst pretending to be [...]]]></description>
			<content:encoded><![CDATA[<p>Users of <a href="http://weblog.rubyonrails.com/2008/11/18/potential-circumvention-of-csrf-protection-in-rails-2-1">Rails 2.1 and 2.2</a> need to be aware of a <a href="http://www.rorsecurity.info/journal/2008/11/19/circumvent-rails-csrf-protection.html">vulnerability</a> in Rails&#8217; <a href="http://en.wikipedia.org/wiki/Cross-site_request_forgery">CSRF</a> forgery protection.  </p>
<p>For those that don&#8217;t know, Rails generates an <a href="http://guides.rubyonrails.org/security.html#_csrf_countermeasures">authentication token</a> within your forms and verifies this token when the form is submitted back to your application.  This prevents attackers from crafting malicious requests whilst pretending to be your authenticated user.  </p>
<p>However, for certain types of request (supposedly those that cannot be generated from a browser) this authentication token is ignored &#8211; in order to make it simpler for automated API access to your application (using JSON, XML or a few other data transport types).  Unfortunately, <tt>text/plain</tt> is wrongly included as one of these types.  </p>
<p>Luckily, the fix is simple.  The long-term solution is to upgrade your application to Rails 2.1.3 or 2.2.2 (when they are released); the quick fix is even easier &#8211; tell Rails to verify <tt>text/plain</tt> requests by creating a file (called <tt>mime_type_csrf_fix.rb</tt>) in your <tt>config/initializers</tt> folder: </p>
<p><code><br />
# temporary fix for http://www.rorsecurity.info/journal/2008/11/19/circumvent-rails-csrf-protection.html<br />
Mime::Type.unverifiable_types.delete(:text)<br />
</code></p>]]></content:encoded>
			<wfw:commentRss>http://blog.brightbox.co.uk/posts/rails-csrf-security-vulnerability/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>&#8220;uninitialized constant REXML::VERSION&#8221; with Rails 2.1.1 and Rails 2.2</title>
		<link>http://blog.brightbox.co.uk/posts/uninitialized-constant-rexmlversion-with-rails-211-and-rails-22</link>
		<comments>http://blog.brightbox.co.uk/posts/uninitialized-constant-rexmlversion-with-rails-211-and-rails-22#comments</comments>
		<pubDate>Wed, 10 Sep 2008 10:48:02 +0000</pubDate>
		<dc:creator>Rahoul Baruah</dc:creator>
				<category><![CDATA[tech]]></category>
		<category><![CDATA[bugs]]></category>
		<category><![CDATA[rails]]></category>
		<category><![CDATA[rails 2.1.1]]></category>
		<category><![CDATA[rails 2.2]]></category>
		<category><![CDATA[rexml]]></category>

		<guid isPermaLink="false">http://blog.brightbox.co.uk/?p=137</guid>
		<description><![CDATA[We&#8217;ve found a minor problem with Rails 2.1.1 (and Rails 2.2) on our Brightboxes. Because we use Ubuntu Dapper, which ships with Ruby 1.8.4, it includes an earlier version of the REXML library (for XML processing). As you may know, there was a recent security vulnerability to do with the REXML library and these latest [...]]]></description>
			<content:encoded><![CDATA[<p>We&#8217;ve found a minor problem with Rails 2.1.1 (and Rails 2.2) on our Brightboxes.  </p>
<p>Because we use Ubuntu Dapper, which ships with Ruby 1.8.4, it includes an earlier version of the REXML library (for XML processing).  As you may know, there was a recent security vulnerability to do with the REXML library and these latest two versions of Rails include a fix for this.  </p>
<p>Unfortunately, the library that ships with 1.8.4 is slightly incorrect.  Ruby conventions state that a constant should be all capitals so, quite rightly, the Rails updates check for a constant called <tt>REXML::VERSION</tt>.  However, in 1.8.4, the constant is actually called <tt>REXML::Version</tt> meaning that Rails falls over with an &#8220;<tt>uninitialized constant REXML::VERSION</tt>&#8221; error.  </p>
<p>The quick fix is to manually edit <tt> /usr/lib/ruby/1.8/rexml/rexml.rb</tt> and add a new (correctly named constant).  You will need to use sudo to edit the file, as it is owned by root; after editing the file should look something like: </p>
<pre><code>
module REXML
        Copyright = "Copyright © 2001, 2002, 2003, 2004 Sean Russell <&#x73;&#x65;&#x72;&#x40;&#x67;&#x65;&#x72;&#x6d;&#x61;&#x6e;&#x65;&#x2d;&#x73;&#x6f;&#x66;&#x74;&#x77;&#x61;&#x72;&#x65;&#x2e;&#x63;om>"
        Date = "2005/224"
        Version = "3.1.3"
        VERSION = "3.1.3"
end
</code></pre>
<p>We are also looking at our options for a permanent fix for this issue.  </p>]]></content:encoded>
			<wfw:commentRss>http://blog.brightbox.co.uk/posts/uninitialized-constant-rexmlversion-with-rails-211-and-rails-22/feed</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
	</channel>
</rss>

