<?xml version="1.0" encoding="UTF-8"?>
<!--Generated by Squarespace Site Server v5.11.5 (http://www.squarespace.com/) on Fri, 30 Jul 2010 10:37:03 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>2010-07-30T10:37:03Z</dc:date><admin:generatorAgent rdf:resource="http://www.squarespace.com/">Squarespace Site Server v5.11.5 (http://www.squarespace.com/)</admin:generatorAgent><rss:items><rdf:Seq><rdf:li rdf:resource="http://www.rorsecurity.info/journal/2010/6/8/ruby-on-rails-3-security-updated.html"/><rdf:li rdf:resource="http://www.rorsecurity.info/journal/2009/11/27/xss-weakness-in-strip_tags-and-some-notes-on-parsing-htmlxml.html"/><rdf:li rdf:resource="http://www.rorsecurity.info/journal/2009/9/4/two-vulnerabilities-fixed-in-rails-234.html"/><rdf:li rdf:resource="http://www.rorsecurity.info/journal/2009/6/10/dos-vulnerability-in-bigdecimal.html"/><rdf:li rdf:resource="http://www.rorsecurity.info/journal/2009/6/4/vulnerability-in-rails-23-http-authentication.html"/><rdf:li rdf:resource="http://www.rorsecurity.info/journal/2009/5/29/hacking-ruby-on-rails-railswaycon09.html"/><rdf:li rdf:resource="http://www.rorsecurity.info/journal/2009/5/12/securing-a-website-with-client-ssl-certificates.html"/><rdf:li rdf:resource="http://www.rorsecurity.info/journal/2009/5/1/webappsec-twitters-admin-panel-compromised.html"/><rdf:li rdf:resource="http://www.rorsecurity.info/journal/2009/4/30/server-nessus-vulnerability-scanner-for-networks-and-systems.html"/><rdf:li rdf:resource="http://www.rorsecurity.info/journal/2009/4/24/hidden-actions-render-templates.html"/></rdf:Seq></rss:items></rss:channel><rss:item rdf:about="http://www.rorsecurity.info/journal/2010/6/8/ruby-on-rails-3-security-updated.html"><rss:title>Ruby on Rails 3 Security Updated</rss:title><rss:link>http://www.rorsecurity.info/journal/2010/6/8/ruby-on-rails-3-security-updated.html</rss:link><dc:creator>Heiko</dc:creator><dc:date>2010-06-08T12:13:13Z</dc:date><dc:subject>cross-site scripting rails ruby on rails security sql injection sqli web security xss</dc:subject><content:encoded><![CDATA[<p>I hold a talk about Rails 3 Security at the <a href="http://it-republik.de/conferences/railswaycon2010/">RailsWayCon10</a>. It is about the new Cross-Site Scription protection in Rails 3, what is going to change in ActiveRecord and other Rails Security topics. You can find the presentation <a href="http://www.slideshare.net/heikowebers/ruby-on-rails-security-updated-rails-3-at-railswaycon">at Slideshare</a>.</p>
<p><div style="width:425px" id="__ss_4438876"><strong style="display:block;margin:12px 0 4px"><a href="http://www.slideshare.net/heikowebers/ruby-on-rails-security-updated-rails-3-at-railswaycon" title="Ruby on Rails Security Updated (Rails 3) at RailsWayCon">Ruby on Rails Security Updated (Rails 3) at RailsWayCon</a></strong><object id="__sse4438876" width="425" height="355"><param name="movie" value="http://static.slidesharecdn.com/swf/ssplayer2.swf?doc=railswaycon10presentation-100608070817-phpapp02&rel=0&stripped_title=ruby-on-rails-security-updated-rails-3-at-railswaycon" /><param name="allowFullScreen" value="true"/><param name="allowScriptAccess" value="always"/><embed name="__sse4438876" src="http://static.slidesharecdn.com/swf/ssplayer2.swf?doc=railswaycon10presentation-100608070817-phpapp02&rel=0&stripped_title=ruby-on-rails-security-updated-rails-3-at-railswaycon" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="425" height="355"></embed></object><div style="padding:5px 0 12px">View more <a href="http://www.slideshare.net/">presentations</a> from <a href="http://www.slideshare.net/heikowebers">heikowebers</a>.</div></div></p>]]></content:encoded></rss:item><rss:item rdf:about="http://www.rorsecurity.info/journal/2009/11/27/xss-weakness-in-strip_tags-and-some-notes-on-parsing-htmlxml.html"><rss:title>XSS Weakness in strip_tags and some notes on parsing HTML/XML</rss:title><rss:link>http://www.rorsecurity.info/journal/2009/11/27/xss-weakness-in-strip_tags-and-some-notes-on-parsing-htmlxml.html</rss:link><dc:creator>Heiko</dc:creator><dc:date>2009-11-27T08:30:35Z</dc:date><dc:subject></dc:subject><content:encoded><![CDATA[<p>There is another <a href="http://guides.rubyonrails.org/security.html#cross-site-scripting-xss" target="_blank">Cross-Site Scripting</a> (XSS) <a href="http://groups.google.com/group/rubyonrails-security/browse_thread/thread/4d4f71f2aef4c0ab?hl=en" target="_blank">Weakness</a> in the Rails method strip_tag(). The problem was found in the HTML::Tokenizer which has bugs when parsing non-printable ASCII characters.</p>
<p>According to the original post, this has been fixed in Rails 2.3.5 and there is a patch for the 2.2. branch. Earlier versions are unsupported. Upgrade to a newer version if you make use of this method.</p>
<p>The workaround is this:</p>
<p>Users using strip_tags can pass the resulting output to the regular escaping functionality:</p>
<p>&nbsp; &lt;%= h(strip_tag(...)) %&gt;</p>
<p><strong>However</strong>, this is not how it should be. The strip_tags() method should work correctly. The workaround does work, but strip_tags() is based on HTML::Tokenizer which uses a very naive approach to parsing HTML code. It is based on regular expressions to analyze the code. For serious/enterprise implementations, you should not use an error-prone parser library.</p>
<ul>
<li>The REXML is a little better, but not very fast for large amounts of data. It has some bugs and it's not 100% standard compliant. For larger amounts of data, it may even be used to use a pull parser: REXML::Parsers::PullParser. Some people have successfully parsed HTML with it.</li>
<li>And there is <a href="http://libxml.rubyforge.org/" target="_blank">libxml</a>, which is a real parser, now with ruby bindings. We haven't used it with (X)HTML, though. It has a pull parser too, and its quite like the REXML pull parser. LibXML is an extensive C-library which might not available on exotic Linux-derivates or Windows. <a href="http://nokogiri.rubyforge.org/nokogiri/" target="_blank">Nokogiri</a> is also based on LibXML.</li>
<li>Update: If you're using JRuby, you can use tried and tested Java XHTML/XML parsers. For example Apache Xerces or the pull parser <a href="http://woodstox.codehaus.org/" target="_blank">Woodstox</a> which supports "almost well-formed" documents (like legacy (X)HTML content).</li>
</ul>]]></content:encoded></rss:item><rss:item rdf:about="http://www.rorsecurity.info/journal/2009/9/4/two-vulnerabilities-fixed-in-rails-234.html"><rss:title>Two vulnerabilities fixed in Rails 2.3.4</rss:title><rss:link>http://www.rorsecurity.info/journal/2009/9/4/two-vulnerabilities-fixed-in-rails-234.html</rss:link><dc:creator>Heiko</dc:creator><dc:date>2009-09-04T11:11:49Z</dc:date><dc:subject></dc:subject><content:encoded><![CDATA[<p>Rails version 2.3.4 has been released to fix two vulnerabilities.</p>
<ul>
<li>A <a href="http://weblog.rubyonrails.org/2009/9/4/timing-weakness-in-ruby-on-rails">timing weakness</a> in the ClientCookieStore. Rails version 2.1.0 and all subsequent versions are affected. Detailed information c<a href="http://codahale.com/a-lesson-in-timing-attacks/">an be found here</a>.</li>
<li>And a <a href="http://weblog.rubyonrails.org/2009/9/4/xss-vulnerability-in-ruby-on-rails">XSS vulnerability</a> in the way Rails handles Unicode. This affects all versions in the Rails 2 branch, but not applications running with Ruby 1.9.</li>
</ul>
<p>Upgrade to <a href="http://weblog.rubyonrails.org/2009/9/4/ruby-on-rails-2-3-4">version 2.3.4 now</a>, or apply a patch (available on the pages linked above).</p>]]></content:encoded></rss:item><rss:item rdf:about="http://www.rorsecurity.info/journal/2009/6/10/dos-vulnerability-in-bigdecimal.html"><rss:title>DoS vulnerability in BigDecimal</rss:title><rss:link>http://www.rorsecurity.info/journal/2009/6/10/dos-vulnerability-in-bigdecimal.html</rss:link><dc:creator>Heiko</dc:creator><dc:date>2009-06-10T07:40:00Z</dc:date><dc:subject></dc:subject><content:encoded><![CDATA[<p>A Denial of Service (DoS) vulnerability was found in the BigDecimal standard Ruby library. An attacker could cause a segmentation fault and crash the Ruby interpreter. This is due to the BigDecimal method mishandling certain large values. Almost every Rails application is vulnerable to this because ActiveRecord relies on this method.</p>
<p>You are advised <a href="http://www.ruby-lang.org/en/news/2009/06/09/dos-vulnerability-in-bigdecimal/">to update your Ruby</a> installation. There is a temporary fix on <a href="http://github.com/NZKoz/bigdecimal-segfault-fix/tree/master">Github</a>. This fix breaks valid formats supported by BigDecimal, so you are advised to plan migrating to a new Ruby version.</p>]]></content:encoded></rss:item><rss:item rdf:about="http://www.rorsecurity.info/journal/2009/6/4/vulnerability-in-rails-23-http-authentication.html"><rss:title>Vulnerability in Rails 2.3 HTTP Authentication</rss:title><rss:link>http://www.rorsecurity.info/journal/2009/6/4/vulnerability-in-rails-23-http-authentication.html</rss:link><dc:creator>Heiko</dc:creator><dc:date>2009-06-04T12:57:15Z</dc:date><dc:subject></dc:subject><content:encoded><![CDATA[<p>There has been a security vulnerability in Rails in the HTTP digest authentication in Rails 2.3. That way someone can authenticate without any user name and password. The HTTP <span style="text-decoration: underline;">basic</span> authentication seems to be not vulnerable to this problem.</p>
<p>The problem arises in the authenticate_or_request_with_http_digest method which will proceed even if the user name check returns nil.</p>
<p>You can find out more, including countermeasures at <a href="http://n8.tumblr.com/post/117477059/security-hole-found-in-rails-2-3s" target="_blank">Nate's blog</a> and the <a href="http://weblog.rubyonrails.org/2009/6/3/security-problem-with-authenticate_with_http_digest" target="_blank">Rails weblog</a>.</p>]]></content:encoded></rss:item><rss:item rdf:about="http://www.rorsecurity.info/journal/2009/5/29/hacking-ruby-on-rails-railswaycon09.html"><rss:title>Hacking Ruby on Rails @ RailsWayCon09</rss:title><rss:link>http://www.rorsecurity.info/journal/2009/5/29/hacking-ruby-on-rails-railswaycon09.html</rss:link><dc:creator>Heiko</dc:creator><dc:date>2009-05-29T12:14:24Z</dc:date><dc:subject></dc:subject><content:encoded><![CDATA[<p>I'm back from the nice RailsWayCon(ference) in Berlin. I did a session on Ruby on Rails Security, check out the slides:</p>
<p>&nbsp;</p>
<div id="__ss_1505963" style="width: 425px; text-align: left;"><a style="font:14px Helvetica,Arial,Sans-serif;display:block;margin:12px 0 3px 0;text-decoration:underline;" title="Hacking Ruby on Rails at Railswaycon09" href="http://www.slideshare.net/heikowebers/hacking-ruby-on-rails-at-railswaycon09-1505963?type=powerpoint">Hacking Ruby on Rails at Railswaycon09</a><object style="margin:0px" width="425" height="355"><param name="movie" value="http://static.slidesharecdn.com/swf/ssplayer2.swf?doc=railswaycon09presentation-090529071741-phpapp01&rel=0&stripped_title=hacking-ruby-on-rails-at-railswaycon09-1505963" /><param name="allowFullScreen" value="true"/><param name="allowScriptAccess" value="always"/><embed src="http://static.slidesharecdn.com/swf/ssplayer2.swf?doc=railswaycon09presentation-090529071741-phpapp01&rel=0&stripped_title=hacking-ruby-on-rails-at-railswaycon09-1505963" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="425" height="355"></embed></object>
<div style="font-size: 11px; font-family: tahoma,arial; height: 26px; padding-top: 2px;"></div>
</div>
<p>&nbsp;</p>]]></content:encoded></rss:item><rss:item rdf:about="http://www.rorsecurity.info/journal/2009/5/12/securing-a-website-with-client-ssl-certificates.html"><rss:title>Securing A Website With Client SSL Certificates</rss:title><rss:link>http://www.rorsecurity.info/journal/2009/5/12/securing-a-website-with-client-ssl-certificates.html</rss:link><dc:creator>Heiko</dc:creator><dc:date>2009-05-12T12:57:51Z</dc:date><dc:subject></dc:subject><content:encoded><![CDATA[<p>In the comments of the last article Morgan came up with the idea of <strong>client </strong>SSL certificates to secure the admin panel. This is not authentication in a classical sense, it is saying which SSL certificates (which you self-signed) you allow to access a particular site. This is a better solution than limiting the access to various IP adresses when you are a work nomad and you have to access it from different parts in the world.</p>
<p>The steps to do this are:</p>
<ol>
<li>Setup OpenSSL to become a Certificate Authority (CA)</li>
<li>Create a root CA key</li>
<li>Create a key for the (sub)domain in question</li>
<li>Setup your web server</li>
<li>Create a client certificate and install it in your browser</li>
</ol>
<p><a href="http://it.toolbox.com/blogs/securitymonkey/howto-securing-a-website-with-client-ssl-certificates-11500" target="_blank">Here is the HOWTO: Securing A Website With Client SSL Certificates</a></p>]]></content:encoded></rss:item><rss:item rdf:about="http://www.rorsecurity.info/journal/2009/5/1/webappsec-twitters-admin-panel-compromised.html"><rss:title>[WebAppSec] Twitter's admin panel compromised</rss:title><rss:link>http://www.rorsecurity.info/journal/2009/5/1/webappsec-twitters-admin-panel-compromised.html</rss:link><dc:creator>Heiko</dc:creator><dc:date>2009-05-01T12:19:42Z</dc:date><dc:subject></dc:subject><content:encoded><![CDATA[<p>One of the best known Rails application, Twitter, was compromised very recently. A French <a href="http://www.korben.info/twitter-vu-de-linterieur-interface-admin-piratee.html" target="_blank">hacker</a> <a href="http://blogs.zdnet.com/security/?p=3292" target="_blank">claimed</a> that he gained access to Twitter's admin panel at https://admin.twitter.com/. Twitter <a href="http://blog.twitter.com/2009/04/unauthorized-access-update-on-security.html" target="_blank">confirmed</a> that an outside individual gained access to details of several accounts, including accounts from Ashton Kutcher, Lily Allen, Britney Spears and Barack Obama.</p>
<p>It seems that the hacker gained access to a Yahoo Mail account of a Twitter employee by answering his "secret question" and thus he could reset the password and access his mail account. In one of the e-mails he found the Twitter administration password.</p>
<p>Here is list of must-have security countermeasures for admin panels:</p>
<ul>
<li>Don't make the admin panel publicly available unless you really have to! It seems that admin.twitter.com was secured with a .htaccess file. I recommend to at least allow access only from several IP addresses.</li>
<li>Don't make admin panels pretty, make sure they are Cross-Site Scripting and CSRF-safe! A simple message to the support panel containing Cross-Site Scripting is sometimes already enough to gain access to the panels.</li>
<li>Forgotten passwords are a huge problem. Resetting it with a simple answer to an easy question is definitely not enough. Sending a password-reset URL to an e-mail address is currently one of the best solutions (but it isn't totally secure).</li>
<li>It seems that everyone with access to the Twitter admin panel may do everything. Why can everyone download "emails to gzipped CSV file"? Why not require to re-enter another password for sensitive actions or use a role-based admin user model?</li>
<li><a href="http://www.sophos.com/blogs/gc/g/2009/05/01/twitter-security-breach-exposes-accounts-hackers/" target="_blank">Someone suggested</a> using authentication tokens that provide a randomly generated key upon login</li>
</ul>
<p><a href="http://www.rorsecurity.info/journal/2008/3/3/intranet-and-admin-security.html">I wrote about this</a> already a while ago.</p>]]></content:encoded></rss:item><rss:item rdf:about="http://www.rorsecurity.info/journal/2009/4/30/server-nessus-vulnerability-scanner-for-networks-and-systems.html"><rss:title>[Server] Nessus vulnerability scanner for networks and systems</rss:title><rss:link>http://www.rorsecurity.info/journal/2009/4/30/server-nessus-vulnerability-scanner-for-networks-and-systems.html</rss:link><dc:creator>Heiko</dc:creator><dc:date>2009-04-30T13:34:09Z</dc:date><dc:subject></dc:subject><content:encoded><![CDATA[<p><span class="full-image-float-right ssNonEditable"><span><img style="width: 300px;" src="http://www.rorsecurity.info/storage/post-images/nessus.jpg?__SQUARESPACE_CACHEVERSION=1241098722370" alt="" /></span></span><a href="http://www.tenablesecurity.com/solutions/" target="_blank">Tenable Network Security</a> has announced the release of <a href="http://www.nessus.org/nessus/" target="_blank">Nessus 4</a> a short while ago. Nessus is a network vulnerability scanner that can be used to identify potential vulnerabilities in your systems and networks. You can use it to find open ports, unpatched software, configuration errors and possibly leaks of private data.<br /><br />The software package consists of a client and server. The server keeps the scanner plugins up to date and the client performs the actual scan.<br /></p>
<ol>
<li>Download the package from the homepage (you need to provide your e-mail address)</li>
<li>Install it, start the server program and download the newest scanner plugins</li>
<li>After you started the server, you can connect to it from the client</li>
<li>Add an IP address on the left side and add scanner types to the right side (choose all plugins for a start)</li>
<li>&bdquo;Scan now&ldquo;: The scan takes about 5 minutes</li>
</ol>
<p><br /><a href="http://www.nessus.org/download/" target="_blank">Nessus is available</a> free of charge for non-enterprise and personal use. The commercial version (Professional Feed) costs $1,200 which you can evaluate for 15 days. Even a one-time check gives you a great overview of what a potential attacker would see.</p>]]></content:encoded></rss:item><rss:item rdf:about="http://www.rorsecurity.info/journal/2009/4/24/hidden-actions-render-templates.html"><rss:title>Hidden actions render templates</rss:title><rss:link>http://www.rorsecurity.info/journal/2009/4/24/hidden-actions-render-templates.html</rss:link><dc:creator>Heiko</dc:creator><dc:date>2009-04-24T07:37:59Z</dc:date><dc:subject></dc:subject><content:encoded><![CDATA[<p>Sometimes you have to temporarely exclude actions from a controller or someone just forgot to remove legacy actions. The <a href="http://api.rubyonrails.org/classes/ActionController/Base.html#M000617" target="_blank">hide_action method</a> can be used in controllers to hide the given methods from being callable as actions. However, it <a href="https://rails.lighthouseapp.com/projects/8994/tickets/2551-actioncontrollerbasehide_action-not-working-as-expected-when-template-exists" target="_blank">might not work as expected</a>, because it still renders the template associated with it, but it doesn't call the code in the action method. This could be a security issue if the template contained only text or if it didn't throw errors on nil objects.</p>
<p>Now, one could think that moving an action to the protected or private part of the controller solves the problem and hides the methods from being callable as actions. No, this is the same problem. The only way to actually hide actions is to remove them altogether or remove the route for it. Remember that there might be the standard route still in place.</p>]]></content:encoded></rss:item></rdf:RDF>