News for hackers. Stuff that matters.
Re:SQL Injection Vulnerability in Rails by joevandyk on Friday June 01, 2012 @01:28PM (#4054560)
A better solution would be to have a way to indicate "this parameter needs to be this type".

params[:id] could be a string, integer, hash, or array when accessed in the controller actions.

Re:SQL Injection Vulnerability in Rails by revetkn on Friday June 01, 2012 @09:10PM (#4056610)
> A better solution would be to have a way to indicate "this parameter needs to be this type".

If only there were some kind of concept of typing, perhaps enforced by the language and statically applied, which would eliminate this class of error entirely...boy, that would be helpful in larger systems.

Re:SQL Injection Vulnerability in Rails by keeperofdakeys on Saturday June 02, 2012 @10:13AM (#4058098)
For those who don't know, these are called prepared statements. Instead of mashing strings together, you define variables in your sql string, and associate a value and type with each variable. Of course this doesn't stop bugs in the implementation, as in this case.
Re:SQL Injection Vulnerability in Rails by __float on Saturday June 02, 2012 @10:33AM (#4058139)
I believe the parent was mocking Ruby for its dynamic typing, rather than what you're discussing.