<?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; csrf</title>
	<atom:link href="http://blog.brightbox.co.uk/tag/csrf/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>
	</channel>
</rss>

