Skip to content
Advertisement

Tag: sql-injection

Is NamedParameterJdbcTemplate vulnerable safe?

We are using NamedParameterJdbcTemplate to achieve “IN” operator functionality. Is there any SQL Injection vulnerability when we use NamedParameterJdbcTemplate? Answer Since NamedParameterJdbcTemplate internally use PreparedStatement for querying , and if you can make sure that you do not build the SQL query by somehow concatenating the input from the user , but using the placeholder :xxxx to specify their value,

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 similar to point #

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 method anyway? And if so, why? Answer Virtually never;

Advertisement