Scotland on Rails – Web Application Security

Mar 31st, 2009

Comments: 1
Category: Ruby On Rails

Scotland on Rails – Web Application Security

It was the Scotland on Rails 2009 conference on Friday/Saturday of last week. A great couple of days with loads of interesting Ruby and Rails talks (I’m planning more of a recap once the videos are out)
I presented on Web Application Security (slides here), which seemed to go down reasonably well.
One of the main themes of my presentation was that, whilst Rails provides a variety of mechanisms to help developers to create secure applications, it still leaves a lot to the individual to think about, and relies on implementation of the protection that it provides.
One major example of this it Rails default protection mechanism from XSS which is the h() function. This HTML encodes the contents of the argument passed to it. This is an effective defense against XSS but relies on developers to use it consistently, which can be tricky to remember.
There’s a couple of potential ways for improving this situation with plugins.
The Safe ERB plugin is designed to help developers by raising an exception when information pulled from an ActiveRecord model is displayed in a view without h() being used.
The other way to approach the problem of XSS is to validate input when it’s passed to the application. There are a number of Rails plugins which take this approach including Sanitize Params and XSS Terminate

DISCUSSION 1 Comments

  1. John Topley April 8, 2009 at 6:08 pm

    Your talk was very good and very useful – thanks!

Add a comment

Your email address will not be shared or published. Required fields are marked *