<?xml version="1.0" encoding="UTF-8"?>
<!--Generated by Squarespace Site Server v5.0.0 (http://www.squarespace.com/) on Wed, 07 Jan 2009 13:12:19 GMT--><rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:rss="http://purl.org/rss/1.0/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" xmlns:admin="http://webns.net/mvcb/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:cc="http://web.resource.org/cc/"><rss:channel rdf:about="http://www.rorsecurity.info/journal/"><rss:title>Ruby on Rails Security Project</rss:title><rss:link>http://www.rorsecurity.info/journal/</rss:link><rss:description></rss:description><dc:language>en-US</dc:language><dc:date>2009-01-07T13:12:19Z</dc:date><admin:generatorAgent rdf:resource="http://www.squarespace.com/">Squarespace Site Server v5.0.0 (http://www.squarespace.com/)</admin:generatorAgent><rss:items><rdf:Seq><rdf:li rdf:resource="http://www.rorsecurity.info/journal/2008/11/19/circumvent-rails-csrf-protection.html"/><rdf:li rdf:resource="http://www.rorsecurity.info/journal/2008/11/4/rails-security-guide-and-book.html"/><rdf:li rdf:resource="http://www.rorsecurity.info/journal/2008/10/20/header-injection-and-response-splitting.html"/><rdf:li rdf:resource="http://www.rorsecurity.info/journal/2008/10/13/new-redcloth-security.html"/><rdf:li rdf:resource="http://www.rorsecurity.info/journal/2008/10/10/the-updated-rails-security-guide.html"/><rdf:li rdf:resource="http://www.rorsecurity.info/journal/2008/9/8/sql-injection-issue-in-limit-and-offset-parameter.html"/><rdf:li rdf:resource="http://www.rorsecurity.info/journal/2008/8/27/dos-vulnerability-in-rexml.html"/><rdf:li rdf:resource="http://www.rorsecurity.info/journal/2008/6/24/ruby-security-vulnerabilities.html"/><rdf:li rdf:resource="http://www.rorsecurity.info/journal/2008/6/17/automatic-security.html"/><rdf:li rdf:resource="http://www.rorsecurity.info/journal/2008/5/28/server-did-you-update-openssl.html"/></rdf:Seq></rss:items></rss:channel><rss:item rdf:about="http://www.rorsecurity.info/journal/2008/11/19/circumvent-rails-csrf-protection.html"><rss:title>Circumvent Rails CSRF Protection</rss:title><rss:link>http://www.rorsecurity.info/journal/2008/11/19/circumvent-rails-csrf-protection.html</rss:link><dc:creator>Heiko</dc:creator><dc:date>2008-11-19T08:46:46Z</dc:date><dc:subject></dc:subject><content:encoded><![CDATA[<p>There is a security-related bug in <span style="text-decoration: underline;">Ruby on Rails 2.1.x and all 2.2. pre-releases</span>. The CSRF protection given by<br />the protect_from_forgery method may possibly be circumvented by a crafted request.</p>
<p>The problem is that Rails by design will not check the <a href="http://guides.rubyonrails.org/security.html#_csrf_countermeasures" target="_blank">authenticity token</a> if the request has certain content types that are typically not generated by browsers. According to the <a href="http://groups.google.com/group/rubyonrails-security/browse_thread/thread/d741ee286e36e301?hl=en" target="_blank">original security message</a>, this list also includes "text/plain" which may be generated by browsers. This <a href="http://pseudo-flaw.net/content/web-browsers/form-data-encoding-roundup/" target="_blank">form data encoding roundup</a> gives an overview of what can be generated by today's browsers. See <a href="http://github.com/rails/rails/commit/099a98e9b7108dae3e0f78b207e0a7dc5913bd1a" target="_blank">this changset</a> for details of which content types will be checked.</p>
<p>&nbsp;</p>
<h2>Possible Exploit<br /></h2>
<p>The content type can be set with the enctype attribute in HTML forms:</p>
<p>&lt;form method="post" enctype="text/plain" action="&lt;%= some_post_action_path(@var) %&gt;"&gt;&lt;%= submit_tag "Start" %&gt;&lt;/form&gt;</p>
<p>This was found in this <a href="http://rails.lighthouseapp.com/projects/8994/tickets/1145-bug-invalidauthenticitytoken-incorrectly-raised-for-xml-controllerdestroy-request#ticket-1145-29" target="_blank">Lighthouse ticket</a>. The <a href="http://groups.google.com/group/rubyonrails-security/browse_thread/thread/d741ee286e36e301?hl=en" target="_blank">original security message</a> states that Rails does not parse the parameters for these requests. However, I was able to craft requests where all parameters where correctly parsed and used.</p>
<p>&nbsp;</p>
<h2>Temporary Solution</h2>
<p>Users of 2.1.x releases are advised to insert the following code into a file in config/initializers/</p>
<p>Mime::Type.unverifiable_types.delete(:text)</p>
<p>Or you apply <a href="http://github.com/rails/rails/commit/099a98e9b7108dae3e0f78b207e0a7dc5913bd1a" target="_blank">this patch</a> for the 2.1.x releases. Users of Edge Rails should upgrade to the latest version.</p>
<p>&nbsp;</p>
<h2>Fixes</h2>
<p>Fixes will be in Rails version <a href="http://rails.lighthouseapp.com/projects/8994-ruby-on-rails/milestones" target="_blank">2.1.3 and 2.2.2</a>.</p>]]></content:encoded></rss:item><rss:item rdf:about="http://www.rorsecurity.info/journal/2008/11/4/rails-security-guide-and-book.html"><rss:title>Rails Security Guide and Book</rss:title><rss:link>http://www.rorsecurity.info/journal/2008/11/4/rails-security-guide-and-book.html</rss:link><dc:creator>Heiko</dc:creator><dc:date>2008-11-04T11:10:38Z</dc:date><dc:subject></dc:subject><content:encoded><![CDATA[<p>That's it, the Ruby on Rails Security guide is ready. It is available as a Rails manual at <a href="http://guides.rubyonrails.org/security.html">http://guides.rubyonrails.org/security.html</a> and as a free e-book at <a href="http://www.rorsecurity.info/the-book/">http://www.rorsecurity.info/the-book/</a>. The first batch of <a href="http://guides.rubyonrails.org/">the new Rails Guides</a> also includes 14 other quality manuals 