Skip to content

Tag: sql-injection

How to sanitize Arel SQL?

I have the following Arel SQL: I get SQL Injection warning when I run brakeman. I tried the following: However, I get the following error: How do I sanitize sql statement with Arel? Answer I am answering my own question. I am using Arel following the Github wiki for Ransack gem. I was doing something very sim…

SQL injection curiosity

Student here, just learned that in order to avoid SQL injections it’s better to use the prepare/execute duo: instead of the using: the question is: In what situations does anybody use query instead, since we have a pretty quick way to secure ourselves from SQL injections, does anybody use the query meth…