I am doing a security audit in Rails 2.3.8, and one of the things that came up is the lack of attr_protected or attr_accessible in my model definitions. I understand the arguments behind them and even wrote a gem to help with mass assignment, but I'm looking for attributes that I could potentially be missing.
The problem I have is determining which fields should be protected. Are there any rules that people usually follow for this? I think attributes like foreign keys and logical elements like admin? it makes sense to protect. I am also interested in fields of type STI type and polymorphic * _type / * _ id. I see that Rails 3 introduced attributes that are protected by default , but Rails 2.3.8 does not seem to have this.
Any advice on this would be greatly appreciated.
source share