Security Issues Related to Ruby on Rails Applications by Jay March 14, 2011 2 Minutes ReadSecurity of any software product or application is something which every software solution provider is wary of. It is no different in the case of a Ruby on Rails application. Even after an application is successfully developed and deployed, there can be possibilities for many unseemly activities. US based high end software solution provider Andolasoft.Inc sheds some light on some of the basic precautions that are worked upon before deploying an application. The Company’s Rails developers pay special attention to security issues in every undertaken venture. Authentication and authorization of User model are two different things. Actions like create/update/delete always need to be protected. Even popular plug-ins like Restful authentication and Clearance only authenticate whereas providing no helper methods for authorization. Mass assignment of sensitive attributes from re-assignment should be protected. This can be taken care of by disabling mass assignment with the help of attr_accessible or attr_protected in the respective models. Attributes like account_id’s and user_id’ should be protected. Also disabling updates on protected attributes can be by using attr_readonly, so that the Ids don’t get updated once set. Content types of files being uploaded can be faked, so uploaded files should be placed in protected directories or servers. Also file extensions should be checked and the web server should be disabled so as not to execute such files in the uploaded directories. Sessions are prone to vulnerabilities like hijacks, replaying cookies and session fixation. Extra caution must be taken regarding storing data in sessions. Active record Objects should never be stored in sessions which might change that Object’s behavior while migration and future code changes. Best practice is to only store the ids of the records. Also sensitive data like User access privileges and money based information should not be stored in sessions. Related Posts: Security Checks you must do before Rails App release Top 5 Security Guides for your Rails App A Re-Introduction to Ruby on Rails Tags: Rails, RoR, Ruby Jayadev Das email@example.com Do what you do best in – that’s what I’ve always believed in and that’s what I preach. Over the past 25+ years (yup that’s my expertise ‘n’ experience in the Information Technology domain), I’ve been consulting to small, medium and large companies ‘bout Web Technologies, Mobile Future as well as on the good-and-bad of tech. Blogger, International Business Advisor, Web Technology Expert, Sales Guru, Startup Mentor, Insurance Sales Portal Expert & a Tennis Player. And top of all – a complete family man!