The Brakeman gem will scan the Ruby code of a Rails application and alert you to common security vulnerabilities.

Read more at the source