News for hackers. Stuff that matters.
Re:Two Active Record SQL Injection Vulnerabilities Affecting... by X-Istence on Wednesday July 02, 2014 @05:22PM (#7979820)
Yes, all ORM's build their SQL using string concatenation, BUT the good ORM's won't use string concatenation on user data, instead they will use bind parameters.

This way the query sent to the server looks like this:

  SELECT * FROM whatever WHERE email = :1 AND user_name = :2;
And then the parameters are passed to the database server separately to bind to the above placeholders.

This way the database server knows what is user provided data and what is part of the SQL, and no special quoting is required since the database server handles that internally. It's much safer in that SQL injection becomes impossible at that point.

Re:Two Active Record SQL Injection Vulnerabilities Affecting... by warmwaffles on Wednesday July 02, 2014 @06:43PM (#7980301)
That's not what OP was saying. That SQL string you just provided is static. At some point the ORM has to assemble that string.
Re:Two Active Record SQL Injection Vulnerabilities Affecting... by X-Istence on Wednesday July 02, 2014 @08:33PM (#7980748)
OP said:

  > Prepared statements with bind variables only work when the SQL string is static and only the variables change
This is wrong.
Re:Two Active Record SQL Injection Vulnerabilities Affecting... by simonw on Wednesday July 02, 2014 @10:10PM (#7981085)
I said "All ORMs build at least some of their SQL using string concatenation"

The "at least some" was meant to imply that they also use bind variables.